automake: ask the linker to do garbage collection
[mesa.git] / src / gallium / targets / gbm / Makefile.am
index e36d317b0693fd29f36a0de9ba415e7c691e1595..22b4826391e14095cbf1647e9bf8891106ef8bb9 100644 (file)
@@ -49,7 +49,10 @@ gbm_gallium_drm_la_LIBADD = \
        $(top_builddir)/src/gallium/state_trackers/gbm/libgbm.la \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
        $(LIBDRM_LIBS) \
-       -lm
+       -lm \
+       $(CLOCK_LIB) \
+       $(PTHREAD_LIBS) \
+       $(DLOPEN_LIBS)
 
 if HAVE_DRI
 gbm_gallium_drm_la_LIBADD += \
@@ -63,7 +66,12 @@ 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 \
+       $(GC_SECTIONS) \
+       -Wl,--no-undefined
 
 if HAVE_MESA_LLVM
 gbm_gallium_drm_la_LIBADD += $(LLVM_LIBS)