fi
fi
+dnl
+dnl Check if linker supports garbage collection
+dnl
+save_LDFLAGS=$LDFLAGS
+LDFLAGS="$LDFLAGS -Wl,--gc-sections"
+AC_MSG_CHECKING([whether ld supports --gc-sections])
+AC_LINK_IFELSE(
+ [AC_LANG_SOURCE([static char UnusedFunc() { return 5; } int main() { return 0;}])],
+ [AC_MSG_RESULT([yes])
+ GC_SECTIONS="-Wl,--gc-sections";],
+ [AC_MSG_RESULT([no])
+ GC_SECTIONS="";])
+LDFLAGS=$save_LDFLAGS
+
+AC_SUBST([GC_SECTIONS])
+
dnl
dnl compatibility symlinks
dnl
-no-undefined \
-version-number 1:0 \
-Wl,-Bsymbolic \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
if HAVE_EGL_PLATFORM_X11
libwayland_egl_la_LDFLAGS = \
-no-undefined \
-version-info 1 \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
TESTS = wayland-egl-symbols-check
-shared \
-module \
-avoid-version \
+ $(GC_SECTIONS) \
-Wl,--version-script=$(DRI_VERSION_SCRIPT)
GALLIUM_VDPAU_LINKER_FLAGS = \
-no-undefined \
-version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
-export-symbols-regex $(VDPAU_EXPORTS) \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
GALLIUM_XVMC_LINKER_FLAGS = \
-no-undefined \
-version-number $(XVMC_MAJOR):$(XVMC_MINOR) \
-export-symbols-regex '^XvMC' \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
GALLIUM_OMX_LINKER_FLAGS = \
-module \
-no-undefined \
-export-symbols-regex $(EXPORTS) \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
GALLIUM_VDPAU_LIB_DEPS = \
-module \
-no-undefined \
-avoid-version \
+ $(GC_SECTIONS) \
-Wl,--no-undefined \
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/egl-static/egl.link
-module \
-no-undefined \
-avoid-version \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
if HAVE_MESA_LLVM
libGL_la_LDFLAGS = \
-no-undefined \
-version-number $(GL_MAJOR):$(GL_MINOR):$(GL_TINY) \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
libGL_la_LIBADD = \
$(LLVM_LDFLAGS) \
-no-undefined \
-version-number 1:0 \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
-module \
-no-undefined \
-version-number @OSMESA_VERSION@ \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
-module \
-no-undefined \
-avoid-version \
+ $(GC_SECTIONS) \
-Wl,--no-undefined \
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/pipe-loader/pipe.link
libxatracker_la_LDFLAGS = \
-no-undefined \
-version-number $(XA_MAJOR):$(XA_MINOR):$(XA_TINY) \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
if HAVE_MESA_LLVM
libgbm_la_LDFLAGS = \
-no-undefined \
-version-info 1:0 \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
libgbm_la_LIBADD = \
-no-undefined \
-version-number 1:2 \
-Wl,-Bsymbolic \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
lib@GL_LIB@_la_SOURCES =
libGLESv1_CM_la_LDFLAGS = \
-no-undefined \
-version-number 1:1 \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
if HAVE_SHARED_GLAPI
libGLESv2_la_LDFLAGS = \
-no-undefined \
-version-number 2 \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
if HAVE_SHARED_GLAPI
libglapi_la_LIBADD = $(PTHREAD_LIBS) $(SELINUX_LIBS)
libglapi_la_LDFLAGS = \
-no-undefined \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
include $(GLAPI)/gen/glapi_gen.mk
libOpenVG_la_LDFLAGS = \
-no-undefined \
-version-number 1 \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
vgapi_tmp.h: $(srcdir)/vgapi.csv $(top_srcdir)/src/mapi/mapi_abi.py
mesa_dri_drivers_la_LDFLAGS = \
-module -avoid-version -shared \
-Wl,-Bsymbolic \
+ $(GC_SECTIONS) \
$()
mesa_dri_drivers_la_LIBADD = \
../../libmesa.la \
-module \
-no-undefined \
-version-number @OSMESA_VERSION@ \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
lib@GL_LIB@_la_LDFLAGS = \
-no-undefined \
-version-number $(GL_MAJOR):$(GL_MINOR):$(GL_PATCH) \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
include $(top_srcdir)/install-lib-links.mk