[Mesa-dev] [PATCH] automake: don't enable -Wl, --no-undefined on OpenBSD
Jonathan Gray
jsg at jsg.id.au
Tue Apr 1 20:55:24 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.
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 | 3 +--
src/egl/wayland/wayland-egl/Makefile.am | 3 +--
src/gallium/targets/egl-static/Makefile.am | 3 +--
src/gallium/targets/gbm/Makefile.am | 3 +--
src/gallium/targets/libgl-xlib/Makefile.am | 3 +--
src/gallium/targets/opencl/Makefile.am | 3 +--
src/gallium/targets/osmesa/Makefile.am | 3 +--
src/gallium/targets/pipe-loader/Makefile.am | 3 +--
src/gallium/targets/xa/Makefile.am | 3 +--
src/gbm/Makefile.am | 3 +--
src/glx/Makefile.am | 3 +--
src/mapi/es1api/Makefile.am | 3 +--
src/mapi/es2api/Makefile.am | 3 +--
src/mapi/shared-glapi/Makefile.am | 3 +--
src/mapi/vgapi/Makefile.am | 3 +--
src/mesa/drivers/osmesa/Makefile.am | 3 +--
src/mesa/drivers/x11/Makefile.am | 3 +--
18 files changed, 30 insertions(+), 34 deletions(-)
diff --git a/configure.ac b/configure.ac
index 187006a..c1ce3e9 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 these checks will fail
+dnl
+case "$host_os" in
+openbsd*)
+ LD_NO_UNDEFINED="" ;;
+*)
+ LD_NO_UNDEFINED="-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..d7d2581 100644
--- a/src/egl/main/Makefile.am
+++ b/src/egl/main/Makefile.am
@@ -74,11 +74,10 @@ libEGL_la_SOURCES = \
libEGL_la_LIBADD = \
$(EGL_LIB_DEPS)
libEGL_la_LDFLAGS = \
- -no-undefined \
-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..9a12448 100644
--- a/src/egl/wayland/wayland-egl/Makefile.am
+++ b/src/egl/wayland/wayland-egl/Makefile.am
@@ -9,10 +9,9 @@ lib_LTLIBRARIES = libwayland-egl.la
noinst_HEADERS = wayland-egl-priv.h
libwayland_egl_la_SOURCES = wayland-egl.c
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/targets/egl-static/Makefile.am b/src/gallium/targets/egl-static/Makefile.am
index 58ecf69..fb2b4a8 100644
--- a/src/gallium/targets/egl-static/Makefile.am
+++ b/src/gallium/targets/egl-static/Makefile.am
@@ -46,10 +46,9 @@ AM_CPPFLAGS = \
AM_LDFLAGS = \
-module \
- -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..956802a 100644
--- a/src/gallium/targets/gbm/Makefile.am
+++ b/src/gallium/targets/gbm/Makefile.am
@@ -68,10 +68,9 @@ endif
gbm_gallium_drm_la_LDFLAGS = \
-module \
- -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..a45fc7b 100644
--- a/src/gallium/targets/libgl-xlib/Makefile.am
+++ b/src/gallium/targets/libgl-xlib/Makefile.am
@@ -45,10 +45,9 @@ lib_LTLIBRARIES = libGL.la
nodist_EXTRA_libGL_la_SOURCES = dummy.cpp
libGL_la_SOURCES = xlib.c
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..8a59151 100644
--- a/src/gallium/targets/opencl/Makefile.am
+++ b/src/gallium/targets/opencl/Makefile.am
@@ -4,10 +4,9 @@ lib_LTLIBRARIES = lib at OPENCL_LIBNAME@.la
lib at OPENCL_LIBNAME@_la_LDFLAGS = \
$(LLVM_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..91670c2 100644
--- a/src/gallium/targets/osmesa/Makefile.am
+++ b/src/gallium/targets/osmesa/Makefile.am
@@ -41,10 +41,9 @@ lib at OSMESA_LIB@_la_SOURCES = target.c
lib at OSMESA_LIB@_la_LDFLAGS = \
-module \
- -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..64a3ea6 100644
--- a/src/gallium/targets/pipe-loader/Makefile.am
+++ b/src/gallium/targets/pipe-loader/Makefile.am
@@ -47,10 +47,9 @@ PIPE_LIBS = \
AM_LDFLAGS = \
-module \
- -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..6f5768f 100644
--- a/src/gallium/targets/xa/Makefile.am
+++ b/src/gallium/targets/xa/Makefile.am
@@ -65,10 +65,9 @@ libxatracker_la_LIBADD += \
endif
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..15db67d 100644
--- a/src/gbm/Makefile.am
+++ b/src/gbm/Makefile.am
@@ -20,10 +20,9 @@ libgbm_la_SOURCES = \
main/gbm.c \
main/backend.c
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..eaf210b 100644
--- a/src/glx/Makefile.am
+++ b/src/glx/Makefile.am
@@ -109,11 +109,10 @@ GL_LIBS = \
$(GL_LIB_DEPS)
GL_LDFLAGS = \
- -no-undefined \
-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..6471f5b 100644
--- a/src/mapi/es1api/Makefile.am
+++ b/src/mapi/es1api/Makefile.am
@@ -45,10 +45,9 @@ 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 = \
- -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..cdab636 100644
--- a/src/mapi/es2api/Makefile.am
+++ b/src/mapi/es2api/Makefile.am
@@ -50,10 +50,9 @@ lib_LTLIBRARIES = libGLESv2.la
libGLESv2_la_SOURCES = ../entry.c glapi_mapi_tmp.h
libGLESv2_la_LIBADD = $(GLESv2_LIB_DEPS)
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..05343b1 100644
--- a/src/mapi/shared-glapi/Makefile.am
+++ b/src/mapi/shared-glapi/Makefile.am
@@ -10,9 +10,8 @@ lib_LTLIBRARIES = libglapi.la
libglapi_la_SOURCES = $(MAPI_GLAPI_FILES)
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..9f7d23a 100644
--- a/src/mapi/vgapi/Makefile.am
+++ b/src/mapi/vgapi/Makefile.am
@@ -45,10 +45,9 @@ include ../Makefile.sources
libOpenVG_la_SOURCES = $(MAPI_FILES) vgapi_tmp.h
libOpenVG_la_LIBADD = $(VG_LIB_DEPS)
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..425cf8e 100644
--- a/src/mesa/drivers/osmesa/Makefile.am
+++ b/src/mesa/drivers/osmesa/Makefile.am
@@ -37,10 +37,9 @@ lib at OSMESA_LIB@_la_SOURCES = osmesa.c
lib at OSMESA_LIB@_la_LDFLAGS = \
-module \
- -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..917436e 100644
--- a/src/mesa/drivers/x11/Makefile.am
+++ b/src/mesa/drivers/x11/Makefile.am
@@ -62,9 +62,8 @@ lib at GL_LIB@_la_LIBADD = \
$(GL_LIB_DEPS)
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