[PATCH xserver] tests: Add missing -l dependencies

Mihail Konev k.mvc at ya.ru
Thu Feb 2 17:40:07 UTC 2017


It is worth noting, that it was not ld.bfd that scanning in one
direction, but rather ld.gold ignoring the --as-needed flag
(which, at the time of testing, was built-in into gcc -dumpspecs).

Reproducible-by: make CC=" gcc -Wl,--as-needed "

Corrects: b1a69863 ("tests: shuffle around the linking order")
Signed-off-by: Mihail Konev <k.mvc at ya.ru>
---
Tested with all --enable-... except for:
  werror, strict-compilation, config-hal, xselinux, xwin, xquartz

"make -C test tests" works, only Xdmx fails to link :)

 hw/xfree86/dri/Makefile.am | 2 ++
 miext/sync/Makefile.am     | 2 ++
 test/Makefile.am           | 4 ----
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/xfree86/dri/Makefile.am b/hw/xfree86/dri/Makefile.am
index ced04ff388fa..9dd79d018af2 100644
--- a/hw/xfree86/dri/Makefile.am
+++ b/hw/xfree86/dri/Makefile.am
@@ -17,4 +17,6 @@ libdri_la_SOURCES = \
 	sarea.h \
 	xf86dri.c
 
+libdri_la_LIBADD = $(XORG_SYS_LIBS)
+
 sdk_HEADERS = dri.h sarea.h dristruct.h
diff --git a/miext/sync/Makefile.am b/miext/sync/Makefile.am
index 34961d5ff14b..f9b34899727a 100644
--- a/miext/sync/Makefile.am
+++ b/miext/sync/Makefile.am
@@ -16,6 +16,8 @@ libsync_la_SOURCES =	\
 	misyncfd.c	\
 	misyncstr.h
 
+libsync_la_LIBADD = $(XSERVERLIBS_LIBS)
+
 if XSHMFENCE
 libsync_la_SOURCES += $(XSHMFENCE_SRCS)
 endif
diff --git a/test/Makefile.am b/test/Makefile.am
index e7fe587bb858..859bd731cabc 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -225,10 +225,6 @@ endif
 
 endif !XORG
 
-# GNU LD scans only in one direction, add the following dependencies at the end
-# so as they get picked up by the previously-linked libraries
-tests_LDADD += $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS)
-
 endif ENABLE_UNIT_TESTS
 
 EXTRA_DIST = \
-- 
2.9.2



More information about the xorg-devel mailing list