[PATCH xserver] os,dix: relocate when without dtrace

Mihail Konev k.mvc at ya.ru
Wed Feb 15 01:17:02 UTC 2017


When building with dtrace compiler, "ld -r" is applied to the
entire os/ and dix/, making their symbols visible from everywhere
on linker command line.
This alters the build from a non-dtrace one:
* 3f8c2f94483bf0b96e129c97ef4950170a3f05b4 was only necessary without dtrace.
* 3ef16dfb9830bd6b41ae428f4f213ae0c35c1056 fixed the with-dtrace, but broke
  the without-dtrace build.
The "-r" is required for Solaris linker
(needs dtrace objects in a Relocatable Object).
To ensure consistency across with- and without- dtrace builds,
use it for the latter too.

Fixes "./configure --enable-dmx --with-dtrace=no" build.

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>
---
Compatible with Solaris, adds comments about ld.
Not --disable-xorg ready.

 configure.ac    |  9 ++-------
 dix/Makefile.am | 11 ++++++-----
 os/Makefile.am  | 12 +++++++-----
 3 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4dcf8b5c27a0..981c10dee7e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1579,13 +1579,8 @@ AC_DEFINE(XSYNC, 1, [Support XSync extension])
 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)'
-else
-  DIX_LIB='$(top_builddir)/dix/libdix.la'
-  OS_LIB='$(top_builddir)/os/libos.la'
-fi
+DIX_LIB='$(top_builddir)/dix/dix.O'
+OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS) $(LIBUNWIND_LIBS)'
 AC_SUBST([DIX_LIB])
 AC_SUBST([OS_LIB])
 
diff --git a/dix/Makefile.am b/dix/Makefile.am
index a4171d7e1f12..1f7f4df4dc31 100644
--- a/dix/Makefile.am
+++ b/dix/Makefile.am
@@ -1,4 +1,5 @@
 noinst_LTLIBRARIES = libdix.la libmain.la
+noinst_PROGRAMS = dix.O
 
 AM_CPPFLAGS = -I$(top_srcdir)/include
 AM_CFLAGS = $(DIX_CFLAGS)
@@ -59,16 +60,16 @@ Xserver-dtrace.h: $(srcdir)/Xserver.d
 
 endif
 
+DTRACE_OBJS =
 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)
+DTRACE_OBJS += dtrace-dix.o
+endif
 
-noinst_PROGRAMS = dix.O
-
-dix_O_SOURCES =
-dix.O: dtrace-dix.o libdix.la
+# "ld -r" is required for Solaris
+dix.O: $(DTRACE_OBJS) libdix.la
 	$(AM_V_GEN)ld -r -o $@ $(am_libdix_la_OBJECTS:%.lo=.libs/%.o)
-endif
 
 CLEANFILES = Xserver-dtrace.h
diff --git a/os/Makefile.am b/os/Makefile.am
index c6e78cb99fd5..ac4299657c0c 100644
--- a/os/Makefile.am
+++ b/os/Makefile.am
@@ -1,4 +1,5 @@
 noinst_LTLIBRARIES = libos.la
+noinst_PROGRAMS = os.O
 
 AM_CFLAGS = $(DIX_CFLAGS) $(SHA1_CFLAGS)
 
@@ -56,14 +57,15 @@ endif
 
 EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS)
 
+DTRACE_OBJS =
 if SPECIAL_DTRACE_OBJECTS
 # Generate dtrace object code for probes in libos & libdix
 dtrace.o: $(top_srcdir)/dix/Xserver.d libos.la
 	$(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o ../dix/.libs/*.o
-
-noinst_PROGRAMS = os.O
+DTRACE_OBJS += dtrace.o
+endif
 
 os_O_SOURCES =
-os.O: dtrace.o libos.la
-	$(AM_V_GEN)ld -r -o $@ dtrace.o .libs/*.o
-endif
+# "ld -r" is required for Solaris
+os.O: $(DTRACE_OBJS) libos.la
+	$(AM_V_GEN)ld -r -o $@ $(DTRACE_OBJS) .libs/*.o
-- 
2.9.2



More information about the xorg-devel mailing list