[Mesa-dev] [PATCH v2] automake: don't enable -Wl, --no-undefined on OpenBSD

Jonathan Gray jsg at jsg.id.au
Wed Apr 2 21:46:01 PDT 2014


OpenBSD does not have DT_NEEDED entries for libc by design,
over concerns how the symbols would be referenced after
changing the major version of the library.

So avoid -no-undefined checks on OpenBSD as they will fail.

v2: don't include the -no-undefined libtool option in the variable
    and change -Wl,--no-undefined references in Automake.inc as well.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76856
Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
---
 configure.ac                                | 13 +++++++++++++
 src/egl/main/Makefile.am                    |  2 +-
 src/egl/wayland/wayland-egl/Makefile.am     |  2 +-
 src/gallium/Automake.inc                    |  6 +++---
 src/gallium/targets/egl-static/Makefile.am  |  2 +-
 src/gallium/targets/gbm/Makefile.am         |  2 +-
 src/gallium/targets/libgl-xlib/Makefile.am  |  2 +-
 src/gallium/targets/opencl/Makefile.am      |  2 +-
 src/gallium/targets/osmesa/Makefile.am      |  2 +-
 src/gallium/targets/pipe-loader/Makefile.am |  2 +-
 src/gallium/targets/xa/Makefile.am          |  2 +-
 src/gbm/Makefile.am                         |  2 +-
 src/glx/Makefile.am                         |  2 +-
 src/mapi/es1api/Makefile.am                 |  2 +-
 src/mapi/es2api/Makefile.am                 |  2 +-
 src/mapi/shared-glapi/Makefile.am           |  2 +-
 src/mapi/vgapi/Makefile.am                  |  2 +-
 src/mesa/drivers/osmesa/Makefile.am         |  2 +-
 src/mesa/drivers/x11/Makefile.am            |  2 +-
 19 files changed, 33 insertions(+), 20 deletions(-)

diff --git a/configure.ac b/configure.ac
index 187006a..94b6dc2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -332,6 +332,19 @@ LDFLAGS=$save_LDFLAGS
 AC_SUBST([GC_SECTIONS])
 
 dnl
+dnl OpenBSD does not have DT_NEEDED entries for libc by design
+dnl so when these flags are passed to ld via libtool the checks will fail
+dnl
+case "$host_os" in
+openbsd*)
+    LD_NO_UNDEFINED="" ;;
+*)
+    LD_NO_UNDEFINED="-Wl,--no-undefined" ;;
+esac
+
+AC_SUBST([LD_NO_UNDEFINED])
+
+dnl
 dnl compatibility symlinks
 dnl
 case "$host_os" in
diff --git a/src/egl/main/Makefile.am b/src/egl/main/Makefile.am
index e4c2539..4b42bd6 100644
--- a/src/egl/main/Makefile.am
+++ b/src/egl/main/Makefile.am
@@ -78,7 +78,7 @@ libEGL_la_LDFLAGS = \
 	-version-number 1:0 \
 	-Wl,-Bsymbolic \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 if HAVE_EGL_PLATFORM_X11
 AM_CFLAGS += -DHAVE_X11_PLATFORM
diff --git a/src/egl/wayland/wayland-egl/Makefile.am b/src/egl/wayland/wayland-egl/Makefile.am
index d3fe117..a03a7bf 100644
--- a/src/egl/wayland/wayland-egl/Makefile.am
+++ b/src/egl/wayland/wayland-egl/Makefile.am
@@ -12,7 +12,7 @@ libwayland_egl_la_LDFLAGS = \
 	-no-undefined \
 	-version-info 1 \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 TESTS = wayland-egl-symbols-check
 
diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 56f1433..beec755 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -67,7 +67,7 @@ GALLIUM_VDPAU_LINKER_FLAGS = \
 	-version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
 	-export-symbols-regex $(VDPAU_EXPORTS) \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 GALLIUM_XVMC_LINKER_FLAGS = \
 	-shared \
@@ -76,7 +76,7 @@ GALLIUM_XVMC_LINKER_FLAGS = \
 	-version-number $(XVMC_MAJOR):$(XVMC_MINOR) \
 	-export-symbols-regex '^XvMC' \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 GALLIUM_OMX_LINKER_FLAGS = \
 	-shared \
@@ -84,7 +84,7 @@ GALLIUM_OMX_LINKER_FLAGS = \
 	-no-undefined \
 	-export-symbols-regex $(EXPORTS) \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 GALLIUM_VDPAU_LIB_DEPS = \
 	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
diff --git a/src/gallium/targets/egl-static/Makefile.am b/src/gallium/targets/egl-static/Makefile.am
index 58ecf69..40e7a96 100644
--- a/src/gallium/targets/egl-static/Makefile.am
+++ b/src/gallium/targets/egl-static/Makefile.am
@@ -49,7 +49,7 @@ AM_LDFLAGS = \
 	-no-undefined \
 	-avoid-version \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined \
+	$(LD_NO_UNDEFINED) \
 	-Wl,--version-script=$(top_srcdir)/src/gallium/targets/egl-static/egl.link
 
 egldir = $(EGL_DRIVER_INSTALL_DIR)
diff --git a/src/gallium/targets/gbm/Makefile.am b/src/gallium/targets/gbm/Makefile.am
index 22b4826..2b54e3c 100644
--- a/src/gallium/targets/gbm/Makefile.am
+++ b/src/gallium/targets/gbm/Makefile.am
@@ -71,7 +71,7 @@ gbm_gallium_drm_la_LDFLAGS = \
 	-no-undefined \
 	-avoid-version \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 if HAVE_MESA_LLVM
 gbm_gallium_drm_la_LIBADD += $(LLVM_LIBS)
diff --git a/src/gallium/targets/libgl-xlib/Makefile.am b/src/gallium/targets/libgl-xlib/Makefile.am
index ef3d23e..4ee364e 100644
--- a/src/gallium/targets/libgl-xlib/Makefile.am
+++ b/src/gallium/targets/libgl-xlib/Makefile.am
@@ -48,7 +48,7 @@ libGL_la_LDFLAGS = \
 	-no-undefined \
 	-version-number $(GL_MAJOR):$(GL_MINOR):$(GL_TINY) \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 libGL_la_LIBADD = \
 	$(top_builddir)/src/gallium/state_trackers/glx/xlib/libxlib.la \
diff --git a/src/gallium/targets/opencl/Makefile.am b/src/gallium/targets/opencl/Makefile.am
index aae31ff..f23c26b 100644
--- a/src/gallium/targets/opencl/Makefile.am
+++ b/src/gallium/targets/opencl/Makefile.am
@@ -7,7 +7,7 @@ lib at OPENCL_LIBNAME@_la_LDFLAGS = \
 	-no-undefined \
 	-version-number 1:0 \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 
 lib at OPENCL_LIBNAME@_la_LIBADD = \
diff --git a/src/gallium/targets/osmesa/Makefile.am b/src/gallium/targets/osmesa/Makefile.am
index 559135c..8b7eb00 100644
--- a/src/gallium/targets/osmesa/Makefile.am
+++ b/src/gallium/targets/osmesa/Makefile.am
@@ -44,7 +44,7 @@ lib at OSMESA_LIB@_la_LDFLAGS = \
 	-no-undefined \
 	-version-number @OSMESA_VERSION@ \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 
 if HAVE_SHARED_GLAPI
diff --git a/src/gallium/targets/pipe-loader/Makefile.am b/src/gallium/targets/pipe-loader/Makefile.am
index fa463ad..7822b69 100644
--- a/src/gallium/targets/pipe-loader/Makefile.am
+++ b/src/gallium/targets/pipe-loader/Makefile.am
@@ -50,7 +50,7 @@ AM_LDFLAGS = \
 	-no-undefined \
 	-avoid-version \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined \
+	$(LD_NO_UNDEFINED) \
 	-Wl,--version-script=$(top_srcdir)/src/gallium/targets/pipe-loader/pipe.link
 
 if HAVE_MESA_LLVM
diff --git a/src/gallium/targets/xa/Makefile.am b/src/gallium/targets/xa/Makefile.am
index 21f29cf..747cbbe 100644
--- a/src/gallium/targets/xa/Makefile.am
+++ b/src/gallium/targets/xa/Makefile.am
@@ -68,7 +68,7 @@ libxatracker_la_LDFLAGS = \
 	-no-undefined \
 	-version-number $(XA_MAJOR):$(XA_MINOR):$(XA_TINY) \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 if HAVE_MESA_LLVM
 libxatracker_la_LIBADD += $(LLVM_LIBS)
diff --git a/src/gbm/Makefile.am b/src/gbm/Makefile.am
index ea06ce1..48951b8 100644
--- a/src/gbm/Makefile.am
+++ b/src/gbm/Makefile.am
@@ -23,7 +23,7 @@ libgbm_la_LDFLAGS = \
 	-no-undefined \
 	-version-info 1:0 \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 libgbm_la_LIBADD = \
 	$(top_builddir)/src/loader/libloader.la \
diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am
index aa7666a..482d952 100644
--- a/src/glx/Makefile.am
+++ b/src/glx/Makefile.am
@@ -113,7 +113,7 @@ GL_LDFLAGS = \
 	-version-number 1:2 \
 	-Wl,-Bsymbolic \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 lib at GL_LIB@_la_SOURCES =
 lib at GL_LIB@_la_LIBADD = $(GL_LIBS)
diff --git a/src/mapi/es1api/Makefile.am b/src/mapi/es1api/Makefile.am
index febb137..63ea5e7 100644
--- a/src/mapi/es1api/Makefile.am
+++ b/src/mapi/es1api/Makefile.am
@@ -48,7 +48,7 @@ libGLESv1_CM_la_LDFLAGS = \
 	-no-undefined \
 	-version-number 1:1 \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 if HAVE_SHARED_GLAPI
 libGLESv1_CM_la_LIBADD += ../shared-glapi/libglapi.la
diff --git a/src/mapi/es2api/Makefile.am b/src/mapi/es2api/Makefile.am
index c9dd1e0..337f902 100644
--- a/src/mapi/es2api/Makefile.am
+++ b/src/mapi/es2api/Makefile.am
@@ -53,7 +53,7 @@ libGLESv2_la_LDFLAGS = \
 	-no-undefined \
 	-version-number 2 \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 if HAVE_SHARED_GLAPI
 libGLESv2_la_LIBADD += ../shared-glapi/libglapi.la
diff --git a/src/mapi/shared-glapi/Makefile.am b/src/mapi/shared-glapi/Makefile.am
index 33a939a..330719c 100644
--- a/src/mapi/shared-glapi/Makefile.am
+++ b/src/mapi/shared-glapi/Makefile.am
@@ -12,7 +12,7 @@ libglapi_la_LIBADD = $(PTHREAD_LIBS) $(SELINUX_LIBS)
 libglapi_la_LDFLAGS = \
 	-no-undefined \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 include $(GLAPI)/gen/glapi_gen.mk
 glapi_mapi_tmp.h : $(GLAPI)/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
diff --git a/src/mapi/vgapi/Makefile.am b/src/mapi/vgapi/Makefile.am
index f946b9b..a2b13e5 100644
--- a/src/mapi/vgapi/Makefile.am
+++ b/src/mapi/vgapi/Makefile.am
@@ -48,7 +48,7 @@ libOpenVG_la_LDFLAGS = \
 	-no-undefined \
 	-version-number 1 \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_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 \
diff --git a/src/mesa/drivers/osmesa/Makefile.am b/src/mesa/drivers/osmesa/Makefile.am
index b133fd6..4157792 100644
--- a/src/mesa/drivers/osmesa/Makefile.am
+++ b/src/mesa/drivers/osmesa/Makefile.am
@@ -40,7 +40,7 @@ lib at OSMESA_LIB@_la_LDFLAGS = \
 	-no-undefined \
 	-version-number @OSMESA_VERSION@ \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 
 if HAVE_SHARED_GLAPI
diff --git a/src/mesa/drivers/x11/Makefile.am b/src/mesa/drivers/x11/Makefile.am
index 2b38ad3..7a35132 100644
--- a/src/mesa/drivers/x11/Makefile.am
+++ b/src/mesa/drivers/x11/Makefile.am
@@ -65,6 +65,6 @@ lib at GL_LIB@_la_LDFLAGS = \
 	-no-undefined \
 	-version-number $(GL_MAJOR):$(GL_MINOR):$(GL_PATCH) \
 	$(GC_SECTIONS) \
-	-Wl,--no-undefined
+	$(LD_NO_UNDEFINED)
 
 include $(top_srcdir)/install-lib-links.mk
-- 
1.9.0



More information about the mesa-dev mailing list