Classic GNU ld resolves symbol dependencies only forward, while GOLD
seems to work regardless of the specified library order.

I assume that the original author of the changes (just like me), has
been using GNU ld with GOLD enabled (default on ArchLinux), and did
not check on older distros like Ubuntu 16.04 which shows the issue.

Suggested-by: Eero Tamminen <eero.t.tammi...@intel.com>
Signed-off-by: Martin Peres <martin.pe...@linux.intel.com>
---
 test/Makefile.am | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/test/Makefile.am b/test/Makefile.am
index 111b60788b..e7fe587bb8 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -64,7 +64,7 @@ tests_LDFLAGS = \
        -Wl,-wrap,GrabButton \
        $()
 
-tests_LDADD = $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS)
+tests_LDADD =
 
 tests_SOURCES = \
         tests-common.c \
@@ -225,6 +225,10 @@ 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.11.0

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to