aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2016-05-27 20:14:21 +0200
committerDiego Biurrun <diego@biurrun.de>2016-05-30 14:59:43 +0200
commitb2d5d6a7f20a255a5f3c9bf539cc507afd909ce5 (patch)
treeb02478d50d7c2937fae6aa4d3a3eefa6f0539e60 /configure
parentc5fd4b50610f62cbb3baa4f4108139363128dea1 (diff)
downloadffmpeg-b2d5d6a7f20a255a5f3c9bf539cc507afd909ce5.tar.gz
build: Only enable symbol reduction if the compiler does proper DCE
With compilers that do not support proper dead code elimination, like Sun C 5.12, linking fails due to missing references to unavailable, but also unused, symbols. Bug-Id: 895
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure18
1 files changed, 13 insertions, 5 deletions
diff --git a/configure b/configure
index 1b5e0173a7..e68cd3ed2e 100755
--- a/configure
+++ b/configure
@@ -4831,17 +4831,25 @@ enabled xmm_clobber_test &&
-Wl,--wrap,sws_scale ||
disable xmm_clobber_test
-echo "X { local: *; };" > $TMPV
-if test_ldflags -Wl,${version_script},$TMPV; then
- append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
- check_cc <<EOF && enable symver_asm_label
+check_ld <<EOF && enable proper_dce
+extern const int array[512];
+static inline int func(void) { return array[0]; }
+int main(void) { return 0; }
+EOF
+
+if enabled proper_dce; then
+ echo "X { local: *; };" > $TMPV
+ if test_ldflags -Wl,${version_script},$TMPV; then
+ append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
+ check_cc <<EOF && enable symver_asm_label
void ff_foo(void) __asm__ ("av_foo@VERSION");
void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
EOF
- check_cc <<EOF && enable symver_gnu_asm
+ check_cc <<EOF && enable symver_gnu_asm
__asm__(".symver ff_foo,av_foo@VERSION");
void ff_foo(void) {}
EOF
+ fi
fi
if [ -z "$optflags" ]; then