summaryrefslogtreecommitdiff
path: root/numpy/core/setup_common.py
diff options
context:
space:
mode:
authorChris Burr <chrisburr@users.noreply.github.com>2019-11-05 10:32:49 +1030
committerGitHub <noreply@github.com>2019-11-05 10:32:49 +1030
commit502625b6740fa789aa8ba7f279d07721c3311d6f (patch)
tree527b6fdf8ddba8a315a15b4ebe953a5dc488dba2 /numpy/core/setup_common.py
parent96cc014bfc6de9be0ac23d6a02f8f32fb4da7ff3 (diff)
downloadnumpy-502625b6740fa789aa8ba7f279d07721c3311d6f.tar.gz
BLD: Review feedback for clang -flto fix
Diffstat (limited to 'numpy/core/setup_common.py')
-rw-r--r--numpy/core/setup_common.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py
index ba183e8b9..6356f08ba 100644
--- a/numpy/core/setup_common.py
+++ b/numpy/core/setup_common.py
@@ -266,8 +266,9 @@ def check_long_double_representation(cmd):
except ValueError:
# try linking to support CC="gcc -flto" or icc -ipo
# struct needs to be volatile so it isn't optimized away
+ # additionally "clang -flto" requires the foo struct to be used
body = body.replace('struct', 'volatile struct')
- body += "int main(void) { return foo.before[1]; }\n"
+ body += "int main(void) { return foo.before[0]; }\n"
src, obj = cmd._compile(body, None, None, 'c')
cmd.temp_files.append("_configtest")
cmd.compiler.link_executable([obj], "_configtest")