[FFmpeg-devel] [PATCH] configure: make sure check_func_headers tests work with dead code stripping

Rodger Combs rodger.combs at gmail.com
Fri Jan 29 04:07:51 CET 2016


OSX's ld's -Wl,-dead_strip is applied before symbols are resolved, so if the
check functions aren't called, they're stripped out and the test is useless.
This calls the functions, so they won't be stripped.
---
 configure | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 4fceaaa..c5d55d7 100755
--- a/configure
+++ b/configure
@@ -1108,7 +1108,11 @@ check_func_headers(){
         for func in $funcs; do
             echo "long check_$func(void) { return (long) $func; }"
         done
-        echo "int main(void) { return 0; }"
+        echo "int main(void) { return (0"
+        for func in $funcs; do
+            echo "||!check_$func()"
+        done
+        echo "); }"
     } | check_ld "cc" "$@" && enable $funcs && enable_safe $headers
 }
 
-- 
2.7.0



More information about the ffmpeg-devel mailing list