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

Mihail Konev k.mvc at ya.ru
Fri Feb 10 03:47:34 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).

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>
---
Simpler fix that does the same no-*.O, but another way.
(Forgot to mention the libtool's move of .O in the previous patch).
This does assume there is no another source of additional objects like dtrace.

 configure.ac       |  5 +++--
 dix/Makefile.am    |  8 ++++----
 hw/dmx/Makefile.am |  3 +--
 os/Makefile.am     | 10 +++++-----
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4dcf8b5c27a0..6a362ab96a1c 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])
@@ -1580,8 +1581,8 @@ AC_DEFINE(XCMISC, 1, [Support XCMisc extension])
 AC_DEFINE(BIGREQS, 1, [Support BigRequests extension])
 
 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)'
+  DIX_LIB='$(top_builddir)/dix/libdix_dtraced.a'
+  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'
diff --git a/dix/Makefile.am b/dix/Makefile.am
index a4171d7e1f12..707379d86373 100644
--- a/dix/Makefile.am
+++ b/dix/Makefile.am
@@ -64,11 +64,11 @@ if SPECIAL_DTRACE_OBJECTS
 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
+noinst_PROGRAMS = libdix_dtraced.a
 
-dix_O_SOURCES =
-dix.O: dtrace-dix.o libdix.la
-	$(AM_V_GEN)ld -r -o $@ $(am_libdix_la_OBJECTS:%.lo=.libs/%.o)
+libdix_dtraced_a_SOURCES =
+libdix_dtraced.a: dtrace-dix.o libdix.la
+	$(AM_V_GEN) $(AR) cru $@ $(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
-- 
2.9.2



More information about the xorg-devel mailing list