diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-10-25 20:09:46 +0300 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-10-29 00:58:01 +0300 |
commit | 890eb3d7c477b9fd2c6b1fa0785aca1d02a12e29 (patch) | |
tree | 14b46b25a92959bdcae0ae8a220dc973486f6be2 /configure | |
parent | 97792e85c338d129342f5812e2a52048373e57d6 (diff) |
configure: make sure LTO does not optimize out the test functions
Fixes trac ticket #5909
Bud-Id: https://bugs.gentoo.org/show_bug.cgi?id=598054
Acked-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1146,10 +1146,16 @@ check_func_headers(){ for hdr in $headers; do print_include $hdr done + echo "#include <stdint.h>" for func in $funcs; do echo "long check_$func(void) { return (long) $func; }" done - echo "int main(void) { return 0; }" + echo "int main(void) { int ret = 0;" + # LTO could optimize out the test functions without this + for func in $funcs; do + echo " ret |= ((intptr_t)check_$func) & 0xFFFF;" + done + echo "return ret; }" } | check_ld "cc" "$@" && enable $funcs && enable_safe $headers } |