You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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>
This commit is contained in:
8
configure
vendored
8
configure
vendored
@@ -1146,10 +1146,16 @@ check_func_headers(){
|
|||||||
for hdr in $headers; do
|
for hdr in $headers; do
|
||||||
print_include $hdr
|
print_include $hdr
|
||||||
done
|
done
|
||||||
|
echo "#include <stdint.h>"
|
||||||
for func in $funcs; do
|
for func in $funcs; do
|
||||||
echo "long check_$func(void) { return (long) $func; }"
|
echo "long check_$func(void) { return (long) $func; }"
|
||||||
done
|
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
|
} | check_ld "cc" "$@" && enable $funcs && enable_safe $headers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user