automake: add -Wl,--no-undefined to all libraries
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 13 Mar 2014 05:44:33 +0000 (05:44 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 31 Mar 2014 12:09:23 +0000 (13:09 +0100)
... apart from the dri drivers.
With this final change we can build mesa without fear that
the resulting libraries will have unresolved symbols.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
17 files changed:
src/egl/main/Makefile.am
src/egl/wayland/wayland-egl/Makefile.am
src/gallium/Automake.inc
src/gallium/targets/gbm/Makefile.am
src/gallium/targets/libgl-xlib/Makefile.am
src/gallium/targets/opencl/Makefile.am
src/gallium/targets/osmesa/Makefile.am
src/gallium/targets/pipe-loader/Makefile.am
src/gallium/targets/xa/Makefile.am
src/gbm/Makefile.am
src/glx/Makefile.am
src/mapi/es1api/Makefile.am
src/mapi/es2api/Makefile.am
src/mapi/shared-glapi/Makefile.am
src/mapi/vgapi/Makefile.am
src/mesa/drivers/osmesa/Makefile.am
src/mesa/drivers/x11/Makefile.am

index 46e890a99f6bfdccb038b6a939e9fa9b2a69e140..57c9ccd6abb029b080ae1121c2b21bd797f5fdce 100644 (file)
@@ -73,7 +73,11 @@ libEGL_la_SOURCES = \
 
 libEGL_la_LIBADD = \
        $(EGL_LIB_DEPS)
-libEGL_la_LDFLAGS = -Wl,-Bsymbolic -version-number 1:0 -no-undefined
+libEGL_la_LDFLAGS = \
+       -no-undefined \
+       -version-number 1:0 \
+       -Wl,-Bsymbolic \
+       -Wl,--no-undefined
 
 if HAVE_EGL_PLATFORM_X11
 AM_CFLAGS += -DHAVE_X11_PLATFORM
index b8d1634fe56fbdcf663632145395b170656f9af6..3c2673a648638049291746177a58d27321899eed 100644 (file)
@@ -10,7 +10,8 @@ noinst_HEADERS = wayland-egl-priv.h
 libwayland_egl_la_SOURCES = wayland-egl.c
 libwayland_egl_la_LDFLAGS = \
        -no-undefined \
-       -version-info 1
+       -version-info 1 \
+       -Wl,--no-undefined
 
 TESTS = wayland-egl-symbols-check
 
index f36d93da403fecc3a5a6db23fec399d4b75631ef..1151f916bef7f353e51719090cb07b84cbd0fcca 100644 (file)
@@ -64,20 +64,23 @@ GALLIUM_VDPAU_LINKER_FLAGS = \
        -module \
        -no-undefined \
        -version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
-       -export-symbols-regex $(VDPAU_EXPORTS)
+       -export-symbols-regex $(VDPAU_EXPORTS) \
+       -Wl,--no-undefined
 
 GALLIUM_XVMC_LINKER_FLAGS = \
        -shared \
        -module \
        -no-undefined \
        -version-number $(XVMC_MAJOR):$(XVMC_MINOR) \
-       -export-symbols-regex '^XvMC'
+       -export-symbols-regex '^XvMC' \
+       -Wl,--no-undefined
 
 GALLIUM_OMX_LINKER_FLAGS = \
        -shared \
        -module \
        -no-undefined \
-       -export-symbols-regex $(EXPORTS)
+       -export-symbols-regex $(EXPORTS) \
+       -Wl,--no-undefined
 
 GALLIUM_VDPAU_LIB_DEPS = \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
index bad581d7383fd5e45e35b4ba7a8bd10e6634ff47..c109ddbb463be68b80f5c2c87335d461906db5b5 100644 (file)
@@ -66,7 +66,11 @@ gbm_gallium_drm_la_LIBADD += \
        $(LIBDRM_LIBS)
 endif
 
-gbm_gallium_drm_la_LDFLAGS = -no-undefined -avoid-version -module
+gbm_gallium_drm_la_LDFLAGS = \
+       -module \
+       -no-undefined \
+       -avoid-version \
+       -Wl,--no-undefined
 
 if HAVE_MESA_LLVM
 gbm_gallium_drm_la_LIBADD += $(LLVM_LIBS)
index cc382db08b2d94cd8fa96a284214c57eceb3a11c..d7aec7b5b509181bbaa7e256186a1694d3324493 100644 (file)
@@ -44,7 +44,10 @@ lib_LTLIBRARIES = libGL.la
 
 nodist_EXTRA_libGL_la_SOURCES = dummy.cpp
 libGL_la_SOURCES = xlib.c
-libGL_la_LDFLAGS = -version-number $(GL_MAJOR):$(GL_MINOR):$(GL_TINY) -no-undefined
+libGL_la_LDFLAGS = \
+       -no-undefined \
+       -version-number $(GL_MAJOR):$(GL_MINOR):$(GL_TINY) \
+       -Wl,--no-undefined
 
 libGL_la_LIBADD = \
        $(top_builddir)/src/gallium/state_trackers/glx/xlib/libxlib.la \
index eb25a5e47aacbad7e4cdd07fca9431d20024cfd8..b401d10d7a784394d5867e2920baccc582446ef9 100644 (file)
@@ -5,7 +5,9 @@ lib_LTLIBRARIES = lib@OPENCL_LIBNAME@.la
 lib@OPENCL_LIBNAME@_la_LDFLAGS = \
        $(LLVM_LDFLAGS) \
        -no-undefined \
-       -version-number 1:0
+       -version-number 1:0 \
+       -Wl,--no-undefined
+
 
 lib@OPENCL_LIBNAME@_la_LIBADD = \
        $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader_client.la \
index 2b133c44cb98acd5acd65159fb5ff6d5b6f70c24..651fc5d2b4548f1e2d7ddf38314933ebaf2e2baa 100644 (file)
@@ -39,7 +39,12 @@ lib_LTLIBRARIES = lib@OSMESA_LIB@.la
 nodist_EXTRA_lib@OSMESA_LIB@_la_SOURCES = dummy.cpp
 lib@OSMESA_LIB@_la_SOURCES = target.c
 
-lib@OSMESA_LIB@_la_LDFLAGS = -module -version-number @OSMESA_VERSION@ -no-undefined
+lib@OSMESA_LIB@_la_LDFLAGS = \
+       -module \
+       -no-undefined \
+       -version-number @OSMESA_VERSION@ \
+       -Wl,--no-undefined
+
 
 if HAVE_SHARED_GLAPI
 SHARED_GLAPI_LIB = $(top_builddir)/src/mapi/shared-glapi/libglapi.la
index 6e78a75b6d286d009f78814304ef2b48b3c66569..00823fe5bdde13573b72677e79c32991d07205e6 100644 (file)
@@ -49,6 +49,7 @@ AM_LDFLAGS = \
        -module \
        -no-undefined \
        -avoid-version \
+       -Wl,--no-undefined \
        -Wl,--version-script=$(top_srcdir)/src/gallium/targets/pipe-loader/pipe.link
 
 if HAVE_MESA_LLVM
index ed87b9f59dc4ca174030d7850029ecfd2b95273f..214c51df883b8fdabf9eaa0a5bb38b03262b1dda 100644 (file)
@@ -66,7 +66,8 @@ endif
 
 libxatracker_la_LDFLAGS = \
        -no-undefined \
-       -version-number $(XA_MAJOR):$(XA_MINOR):$(XA_TINY)
+       -version-number $(XA_MAJOR):$(XA_MINOR):$(XA_TINY) \
+       -Wl,--no-undefined
 
 if HAVE_MESA_LLVM
 libxatracker_la_LIBADD += $(LLVM_LIBS)
index d19716309bef0c652b7b861cab06e88f95c2aa6a..c71a974015baabad569cf093438c6e86039faedd 100644 (file)
@@ -21,7 +21,9 @@ libgbm_la_SOURCES = \
        main/backend.c
 libgbm_la_LDFLAGS = \
        -no-undefined \
-       -version-info 1:0
+       -version-info 1:0 \
+       -Wl,--no-undefined
+
 libgbm_la_LIBADD = \
        $(top_builddir)/src/loader/libloader.la \
        $(DLOPEN_LIBS)
index eb202403b677f521272aa14d2952e7becb83ec35..0c99c0709d644354e2388404a7b0d00646d3b002 100644 (file)
@@ -109,8 +109,10 @@ GL_LIBS = \
        $(GL_LIB_DEPS)
 
 GL_LDFLAGS = \
+       -no-undefined \
+       -version-number 1:2 \
        -Wl,-Bsymbolic \
-       -version-number 1:2 -no-undefined
+       -Wl,--no-undefined
 
 lib@GL_LIB@_la_SOURCES =
 lib@GL_LIB@_la_LIBADD = $(GL_LIBS)
index b61f9cb1f6656f8d736b1f1c2b793507763f9266..b9581184a967472232a3f93dfe7b6adb2a6d254f 100644 (file)
@@ -44,7 +44,10 @@ lib_LTLIBRARIES = libGLESv1_CM.la
 
 libGLESv1_CM_la_SOURCES = ../entry.c glapi_mapi_tmp.h
 libGLESv1_CM_la_LIBADD = $(GLESv1_CM_LIB_DEPS)
-libGLESv1_CM_la_LDFLAGS = -version-number 1:1 -no-undefined
+libGLESv1_CM_la_LDFLAGS = \
+       -no-undefined \
+       -version-number 1:1 \
+       -Wl,--no-undefined
 
 if HAVE_SHARED_GLAPI
 libGLESv1_CM_la_LIBADD += ../shared-glapi/libglapi.la
index a94449375059e56c65c7990739cfce2dd1294285..1fb6d7c960482eb6a112a8979151ebcab06a9fbf 100644 (file)
@@ -48,7 +48,10 @@ lib_LTLIBRARIES = libGLESv2.la
 
 libGLESv2_la_SOURCES = ../entry.c glapi_mapi_tmp.h
 libGLESv2_la_LIBADD = $(GLESv2_LIB_DEPS)
-libGLESv2_la_LDFLAGS = -version-number 2 -no-undefined
+libGLESv2_la_LDFLAGS = \
+       -no-undefined \
+       -version-number 2 \
+       -Wl,--no-undefined
 
 if HAVE_SHARED_GLAPI
 libGLESv2_la_LIBADD += ../shared-glapi/libglapi.la
index 8d8b4dd783c74f7f0cbc2d90df10ee7cb232cabc..7e1068fdfec6b1001c25c75fdc768c191819fa0e 100644 (file)
@@ -9,7 +9,9 @@ include $(top_srcdir)/src/mapi/Makefile.sources
 lib_LTLIBRARIES = libglapi.la
 libglapi_la_SOURCES = $(MAPI_GLAPI_FILES)
 libglapi_la_LIBADD = $(PTHREAD_LIBS) $(SELINUX_LIBS)
-libglapi_la_LDFLAGS = -no-undefined
+libglapi_la_LDFLAGS = \
+       -no-undefined \
+       -Wl,--no-undefined
 
 include $(GLAPI)/gen/glapi_gen.mk
 glapi_mapi_tmp.h : $(GLAPI)/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
index 197f19f7d95656e5ce49d62e809f4021ea994498..f85addc7c3165b26c86f62ef25931727bcd889ae 100644 (file)
@@ -44,7 +44,10 @@ TOP=$(top_srcdir)
 include ../Makefile.sources
 libOpenVG_la_SOURCES = $(MAPI_FILES) vgapi_tmp.h
 libOpenVG_la_LIBADD = $(VG_LIB_DEPS)
-libOpenVG_la_LDFLAGS = -version-number 1 -no-undefined
+libOpenVG_la_LDFLAGS = \
+       -no-undefined \
+       -version-number 1 \
+       -Wl,--no-undefined
 
 vgapi_tmp.h: $(srcdir)/vgapi.csv $(top_srcdir)/src/mapi/mapi_abi.py
        $(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) $(top_srcdir)/src/mapi/mapi_abi.py \
index bc1244f52e997d76152be24bd11de2a089ffdbae..cfab70216aca97a05823df031fb44fae0ea36642 100644 (file)
@@ -35,7 +35,12 @@ lib_LTLIBRARIES = lib@OSMESA_LIB@.la
 nodist_EXTRA_lib@OSMESA_LIB@_la_SOURCES = dummy.cpp
 lib@OSMESA_LIB@_la_SOURCES = osmesa.c
 
-lib@OSMESA_LIB@_la_LDFLAGS = -module -version-number @OSMESA_VERSION@ -no-undefined
+lib@OSMESA_LIB@_la_LDFLAGS = \
+       -module \
+       -no-undefined \
+       -version-number @OSMESA_VERSION@ \
+       -Wl,--no-undefined
+
 
 if HAVE_SHARED_GLAPI
 SHARED_GLAPI_LIB = $(top_builddir)/src/mapi/shared-glapi/libglapi.la
index 27343d157918bd75dffc9b8a34ff15e90a3649f1..4c63d59a57cf8910e271934c71b9111658629107 100644 (file)
@@ -62,7 +62,8 @@ lib@GL_LIB@_la_LIBADD = \
        $(GL_LIB_DEPS)
 
 lib@GL_LIB@_la_LDFLAGS = \
+       -no-undefined \
        -version-number $(GL_MAJOR):$(GL_MINOR):$(GL_PATCH) \
-       -no-undefined
+       -Wl,--no-undefined
 
 include $(top_srcdir)/install-lib-links.mk