[Mesa-dev] [PATCH] automake: correctly append the version-script
Emil Velikov
emil.l.velikov at gmail.com
Sun May 25 09:47:12 PDT 2014
Turns out that the AC conditional did not include the
the version-scripts as expected. Rather it truncated
the remaining linker flags.
Cc: Jon TURNEY <jon.turney at dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
I was under the silly impression that the original approach is
correct, and naively did not check the symbols in the binaries.
The libraries work, but automake did not produce any warnings :(
Emil
src/gallium/Automake.inc | 27 +++++++++++++++------------
src/gallium/targets/egl-static/Makefile.am | 8 +++++---
src/gallium/targets/gbm/Makefile.am | 8 +++++---
src/gallium/targets/opencl/Makefile.am | 7 ++++---
src/gallium/targets/osmesa/Makefile.am | 5 ++++-
src/gallium/targets/pipe-loader/Makefile.am | 8 +++++---
6 files changed, 38 insertions(+), 25 deletions(-)
diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 70921ec..97735ab 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -56,9 +56,6 @@ GALLIUM_DRI_LINKER_FLAGS = \
-shrext .so \
-module \
-avoid-version \
-if HAVE_LD_VERSION_SCRIPT
- -Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri.sym \
-endif
$(GC_SECTIONS)
GALLIUM_VDPAU_LINKER_FLAGS = \
@@ -66,9 +63,6 @@ GALLIUM_VDPAU_LINKER_FLAGS = \
-module \
-no-undefined \
-version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
-if HAVE_LD_VERSION_SCRIPT
- -Wl,--version-script=$(top_srcdir)/src/gallium/targets/vdpau.sym \
-endif
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
@@ -77,9 +71,6 @@ GALLIUM_XVMC_LINKER_FLAGS = \
-module \
-no-undefined \
-version-number $(XVMC_MAJOR):$(XVMC_MINOR) \
-if HAVE_LD_VERSION_SCRIPT
- -Wl,--version-script=$(top_srcdir)/src/gallium/targets/xvmc.sym \
-endif
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
@@ -88,12 +79,24 @@ GALLIUM_OMX_LINKER_FLAGS = \
-module \
-no-undefined \
-avoid-version \
-if HAVE_LD_VERSION_SCRIPT
- -Wl,--version-script=$(top_srcdir)/src/gallium/targets/omx.sym \
-endif
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
+if HAVE_LD_VERSION_SCRIPT
+GALLIUM_DRI_LINKER_FLAGS += \
+ -Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri.sym
+
+GALLIUM_VDPAU_LINKER_FLAGS += \
+ -Wl,--version-script=$(top_srcdir)/src/gallium/targets/vdpau.sym
+
+GALLIUM_XVMC_LINKER_FLAGS += \
+ -Wl,--version-script=$(top_srcdir)/src/gallium/targets/xvmc.sym
+
+GALLIUM_OMX_LINKER_FLAGS += \
+ -Wl,--version-script=$(top_srcdir)/src/gallium/targets/omx.sym
+endif
+
+
GALLIUM_COMMON_LIB_DEPS = \
-lm \
$(CLOCK_LIB) \
diff --git a/src/gallium/targets/egl-static/Makefile.am b/src/gallium/targets/egl-static/Makefile.am
index bd18f99..ec09b28 100644
--- a/src/gallium/targets/egl-static/Makefile.am
+++ b/src/gallium/targets/egl-static/Makefile.am
@@ -48,12 +48,14 @@ AM_LDFLAGS = \
-module \
-no-undefined \
-avoid-version \
-if HAVE_LD_VERSION_SCRIPT
- -Wl,--version-script=$(top_srcdir)/src/gallium/targets/egl-static/egl.sym \
-endif
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
+if HAVE_LD_VERSION_SCRIPT
+AM_LDFLAGS += \
+ -Wl,--version-script=$(top_srcdir)/src/gallium/targets/egl-static/egl.sym
+endif
+
egldir = $(EGL_DRIVER_INSTALL_DIR)
egl_LTLIBRARIES = egl_gallium.la
diff --git a/src/gallium/targets/gbm/Makefile.am b/src/gallium/targets/gbm/Makefile.am
index ccfddac..5efc0e4 100644
--- a/src/gallium/targets/gbm/Makefile.am
+++ b/src/gallium/targets/gbm/Makefile.am
@@ -67,12 +67,14 @@ gbm_gallium_drm_la_LDFLAGS = \
-module \
-no-undefined \
-avoid-version \
-if HAVE_LD_VERSION_SCRIPT
- -Wl,--version-script=$(top_srcdir)/src/gallium/targets/gbm/gbm.sym \
-endif
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
+if HAVE_LD_VERSION_SCRIPT
+gbm_gallium_drm_la_LDFLAGS += \
+ -Wl,--version-script=$(top_srcdir)/src/gallium/targets/gbm/gbm.sym
+endif
+
if HAVE_MESA_LLVM
gbm_gallium_drm_la_LIBADD += $(LLVM_LIBS)
gbm_gallium_drm_la_LDFLAGS += $(LLVM_LDFLAGS)
diff --git a/src/gallium/targets/opencl/Makefile.am b/src/gallium/targets/opencl/Makefile.am
index 55a73b4..7f2854d 100644
--- a/src/gallium/targets/opencl/Makefile.am
+++ b/src/gallium/targets/opencl/Makefile.am
@@ -6,12 +6,13 @@ lib at OPENCL_LIBNAME@_la_LDFLAGS = \
$(LLVM_LDFLAGS) \
-no-undefined \
-version-number 1:0 \
-if HAVE_LD_VERSION_SCRIPT
- -Wl,--version-script=$(top_srcdir)/src/gallium/targets/opencl/opencl.sym \
-endif
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
+if HAVE_LD_VERSION_SCRIPT
+lib at OPENCL_LIBNAME@_la_LDFLAGS += \
+ -Wl,--version-script=$(top_srcdir)/src/gallium/targets/opencl/opencl.sym
+endif
lib at OPENCL_LIBNAME@_la_LIBADD = \
$(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader_client.la \
diff --git a/src/gallium/targets/osmesa/Makefile.am b/src/gallium/targets/osmesa/Makefile.am
index 0ec8a26..3a554a9 100644
--- a/src/gallium/targets/osmesa/Makefile.am
+++ b/src/gallium/targets/osmesa/Makefile.am
@@ -45,10 +45,13 @@ lib at OSMESA_LIB@_la_LDFLAGS = \
-module \
-no-undefined \
-version-number @OSMESA_VERSION@ \
- -Wl,--version-script=$(top_srcdir)/src/gallium/targets/osmesa/osmesa.sym \
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
+if HAVE_LD_VERSION_SCRIPT
+lib at OSMESA_LIB@_la_LDFLAGS += \
+ -Wl,--version-script=$(top_srcdir)/src/gallium/targets/osmesa/osmesa.sym
+endif
if HAVE_SHARED_GLAPI
SHARED_GLAPI_LIB = $(top_builddir)/src/mapi/shared-glapi/libglapi.la
diff --git a/src/gallium/targets/pipe-loader/Makefile.am b/src/gallium/targets/pipe-loader/Makefile.am
index 93e497f..500dfce 100644
--- a/src/gallium/targets/pipe-loader/Makefile.am
+++ b/src/gallium/targets/pipe-loader/Makefile.am
@@ -47,12 +47,14 @@ AM_LDFLAGS = \
-module \
-no-undefined \
-avoid-version \
-if HAVE_LD_VERSION_SCRIPT
- -Wl,--version-script=$(top_srcdir)/src/gallium/targets/pipe-loader/pipe.sym \
-endif
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
+if HAVE_LD_VERSION_SCRIPT
+AM_LDFLAGS += \
+ -Wl,--version-script=$(top_srcdir)/src/gallium/targets/pipe-loader/pipe.sym
+endif
+
if HAVE_MESA_LLVM
PIPE_LIBS += $(LLVM_LIBS)
AM_LDFLAGS += $(LLVM_LDFLAGS)
--
1.9.3
More information about the mesa-dev
mailing list