Skip to content

Commit

Permalink
Merge pull request #14858 from charris/backport-14827
Browse files Browse the repository at this point in the history
BLD: Prevent -flto from optimising long double representation check away
  • Loading branch information
charris committed Nov 8, 2019
2 parents abf284b + 41b0d44 commit 4b94219
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion numpy/core/setup_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,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 0; }\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")
Expand Down

0 comments on commit 4b94219

Please sign in to comment.