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

2017-02-18 Thread Mihail Konev
On Sat, Feb 18, 2017 at 01:24:19PM +0500, Mihail Konev wrote:
> On Mon, Feb 13, 2017 at 11:01:39PM -0800, Alan Coopersmith wrote:
> > > On 02/ 9/17 09:47 PM, Mihail Konev wrote:
> > >> 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.
> > 
> > ld -r was used not because of libtool, but because the dtrace data in the
> > ELF files gets properly included in a relocatable object, but not a static
> > library.  (This is probably because of a misuse of ELF by dtrace, but that's
> > the way it works, and has for over a decade.)
> > 
> 
> Then rather than "Fixes:", it should be
> 
>   Updates: 49a26681 ("Add DTrace probe points")
> 

Sorry, the patch had no mistake there.
Instead, looking at the message, but not the build logs, I only recalled
the ar-is-insufficient issue, and not the libos-is-ar-ed one.

> 
> Mihail

Mihail
___
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

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

2017-02-18 Thread Mihail Konev
On Mon, Feb 13, 2017 at 11:01:39PM -0800, Alan Coopersmith wrote:
> > On 02/ 9/17 09:47 PM, Mihail Konev wrote:
> >> 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.
> 
> ld -r was used not because of libtool, but because the dtrace data in the
> ELF files gets properly included in a relocatable object, but not a static
> library.  (This is probably because of a misuse of ELF by dtrace, but that's
> the way it works, and has for over a decade.)
> 

Then rather than "Fixes:", it should be

  Updates: 49a26681 ("Add DTrace probe points")


Mihail
___
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

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

2017-02-14 Thread Mihail Konev
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 
Signed-off-by: Mihail Konev 
---
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

___
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