[vlc-commits] configure: use -z,defs where LD supports it

Rémi Denis-Courmont git at videolan.org
Sun Aug 14 21:07:47 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Aug 14 22:06:45 2016 +0300| [afd22356b960c9f63172c56cb691ad952d6b88de] | committer: Rémi Denis-Courmont

configure: use -z,defs where LD supports it

This prevents undefined symbols in ELF shared libraries.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=afd22356b960c9f63172c56cb691ad952d6b88de
---

 configure.ac | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/configure.ac b/configure.ac
index e063f0b..f6fbf20 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1088,6 +1088,17 @@ VLC_RESTORE_FLAGS
 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
 AC_SUBST(SYMBOLIC_LDFLAGS)
 
+VLC_SAVE_FLAGS
+LDFLAGS="${LDFLAGS} -Wl,-z,defs"
+AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
+  AC_TRY_LINK([],, [
+    ac_cv_ld_z_defs="yes"
+  ], [
+    ac_cv_ld_z_defs="no"
+  ])
+])
+AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
+
 dnl Checks for __attribute__(aligned()) directive
 VLC_SAVE_FLAGS
 CFLAGS="${CFLAGS} -Werror"



More information about the vlc-commits mailing list