[PATCH v2 xserver] os,dix: rename *.O to *.a

Mihail Konev k.mvc at ya.ru
Fri Feb 10 05:47:29 UTC 2017


Libtool was moving the *.O libraries in front of all others on
the gcc command line, which was necessiating "ld -r"
(so that symbols from now-moved os.O are visible from the following
libs), which, in turn, was altering the linker behaviour against os/
and dix/ between with-/usr/bin/dtrace and --with-dtrace=no builds.

In particular, commit 3f8c2f94483bf0b96e129c97ef4950170a3f05b4
was necessary for without-dtrace, but not for with-dtrace build.
The 3ef16dfb9830bd6b41ae428f4f213ae0c35c1056 fixed the with-dtrace,
but broke the without-dtrace build (so this commit reverts it).

Also remove dtrace lib from dix/, as only the os/ one was used.

Fixes: 49a26681 ("Add DTrace probe points")
Fixes: 3ef16dfb ("dmx: fix linking")
Reported-by: Byeong-ryeol Kim <brofkims at gmail.com>
Signed-off-by: Mihail Konev <k.mvc at ya.ru>
---
v2:
- remove dtrace lib
- fix the with-dtrace build for tests, as done in dtrace-in-separate-dir patch.
  But this still probably does not work for --disable-xorg.
  Yet the fix shouldn't be attempted right now, as this patch conflicts with the pending
   https://patchwork.freedesktop.org/patch/136119/
  which is required to test the "--disable-xorg"-with-dtrace.

The dtrace-in-a-separate-dir is preferrable, IMO:
- allows for another dtrace-like additional-objects-compiler
- cleaner makefile
- simpler diff
(But note it is still not "--disable-xorg"-ready).

 configure.ac       |  6 +++---
 dix/Makefile.am    | 12 ------------
 hw/dmx/Makefile.am |  3 +--
 os/Makefile.am     | 10 +++++-----
 test/Makefile.am   |  7 ++-----
 5 files changed, 11 insertions(+), 27 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4dcf8b5c27a0..3b56c9daa962 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,6 +73,7 @@ dnl version-config.h covers the version numbers so they can be bumped without
 dnl forcing an entire recompile.x
 AC_CONFIG_HEADERS(include/version-config.h)
 
+AM_PROG_AR
 AM_PROG_AS
 AC_PROG_LN_S
 LT_PREREQ([2.2])
@@ -1579,11 +1580,10 @@ AC_DEFINE(XSYNC, 1, [Support XSync extension])
 AC_DEFINE(XCMISC, 1, [Support XCMisc extension])
 AC_DEFINE(BIGREQS, 1, [Support BigRequests extension])
 
+DIX_LIB='$(top_builddir)/dix/libdix.la'
 if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then
-  DIX_LIB='$(top_builddir)/dix/dix.O'
-  OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS) $(LIBUNWIND_LIBS)'
+  OS_LIB='$(top_builddir)/os/libos_dtraced.a $(SHA1_LIBS) $(DLOPEN_LIBS) $(LIBUNWIND_LIBS)'
 else
-  DIX_LIB='$(top_builddir)/dix/libdix.la'
   OS_LIB='$(top_builddir)/os/libos.la'
 fi
 AC_SUBST([DIX_LIB])
diff --git a/dix/Makefile.am b/dix/Makefile.am
index a4171d7e1f12..476bd35bd566 100644
--- a/dix/Makefile.am
+++ b/dix/Makefile.am
@@ -59,16 +59,4 @@ Xserver-dtrace.h: $(srcdir)/Xserver.d
 
 endif
 
-if SPECIAL_DTRACE_OBJECTS
-# Generate dtrace object code for probes in libdix
-dtrace-dix.o: $(top_srcdir)/dix/Xserver.d libdix.la
-	$(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS:%.lo=.libs/%.o)
-
-noinst_PROGRAMS = dix.O
-
-dix_O_SOURCES =
-dix.O: dtrace-dix.o libdix.la
-	$(AM_V_GEN)ld -r -o $@ $(am_libdix_la_OBJECTS:%.lo=.libs/%.o)
-endif
-
 CLEANFILES = Xserver-dtrace.h
diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am
index 38d6ac409e76..eef84cb66a76 100644
--- a/hw/dmx/Makefile.am
+++ b/hw/dmx/Makefile.am
@@ -80,8 +80,7 @@ XDMX_LIBS = \
 
 Xdmx_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
 Xdmx_DEPENDENCIES= $(XDMX_LIBS)
-Xdmx_LDADD = $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS) \
-             $(top_builddir)/render/librender.la
+Xdmx_LDADD = $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS)
 
 relink:
 	$(AM_V_at)rm -f Xdmx$(EXEEXT) && $(MAKE) Xdmx$(EXEEXT)
diff --git a/os/Makefile.am b/os/Makefile.am
index c6e78cb99fd5..b43113ea5d98 100644
--- a/os/Makefile.am
+++ b/os/Makefile.am
@@ -58,12 +58,12 @@ EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS)
 
 if SPECIAL_DTRACE_OBJECTS
 # Generate dtrace object code for probes in libos & libdix
-dtrace.o: $(top_srcdir)/dix/Xserver.d libos.la
+dtrace.o: $(top_srcdir)/dix/Xserver.d libos.la ../dix/libdix.la
 	$(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o ../dix/.libs/*.o
 
-noinst_PROGRAMS = os.O
+noinst_PROGRAMS = libos_dtraced.a
 
-os_O_SOURCES =
-os.O: dtrace.o libos.la
-	$(AM_V_GEN)ld -r -o $@ dtrace.o .libs/*.o
+libos_dtraced_a_SOURCES =
+libos_dtraced.a: dtrace.o libos.la
+	$(AM_V_GEN) $(AR) cru $@ dtrace.o .libs/*.o
 endif
diff --git a/test/Makefile.am b/test/Makefile.am
index e7fe587bb858..fb61d614bf10 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -140,11 +140,8 @@ tests_LDADD += \
             $(top_builddir)/hw/xfree86/i2c/libi2c.la \
             $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \
             $(top_builddir)/Xext/libXvidmode.la \
-            @XORG_LIBS@
-
-if !SPECIAL_DTRACE_OBJECTS
-tests_LDADD += $(top_builddir)/os/libos.la
-endif
+            $(XORG_LIBS) \
+            $(top_builddir)/os/libos.la
 
 BUILT_SOURCES = sdksyms.c
 CLEANFILES += sdksyms.c
-- 
2.9.2



More information about the xorg-devel mailing list