[PATCH xserver] dmx: fix linking again by brute-forcing

2017-02-08 Thread Mihail Konev
On Ubuntu 17.04 daily, the following error is seen,
(disappears when librender.a is put before libos.a on the resulting
collect2 linker command line (seen by CFLAGS='-v')):

  ../../render/.libs/librender.a(glyph.o): In function `HashGlyph':
  /mnt/xserver/render/glyph.c:168: undefined reference to `x_sha1_init'
  /mnt/xserver/render/glyph.c:174: undefined reference to `x_sha1_update'
  /mnt/xserver/render/glyph.c:177: undefined reference to `x_sha1_update'
  /mnt/xserver/render/glyph.c:180: undefined reference to `x_sha1_final'
  collect2: error: ld returned 1 exit status
  Makefile:763: recipe for target 'Xdmx' failed

Align XDMX_LIBS to be "... RANDR RENDER ... PRESENT ...",
as in all other DDX-es; but this wouldn't help:

  ../../present/.libs/libpresent.a(present.o): In function 
`present_check_output_slaves_active':
  /mnt/xserver/present/present.c:126: undefined reference to 
`RRHasScanoutPixmap'
  collect2: error: ld returned 1 exit status

Then move PRESENT: "... PRESENT RANDR RENDER ...":

  ../../dix/.libs/libdix.a(pixmap.o): In function `PixmapStartDirtyTracking':
  /mnt/xserver/dix/pixmap.c:204: undefined reference to `RRTransformCompute'
  collect2: error: ld returned 1 exit status

Then align them as "... PRESENT ...LIBDIX... RANDR RENDER ...",
which somehow works.

Then moving PRESENT as "...LIBDIX... PRESENT RANDR RENDER ...",
or surrounding the original RANDR with RENDER or also PRESENT as
"...LIBDIX... PRESENT RANDR RENDER ..." would give the original
HashGlyph error.

Regressed-in: 3ef16dfb ("dmx: fix linking")
Suggested-by: Michel Dänzer 
Reported-by: Byeong-ryeol Kim 
Signed-off-by: Mihail Konev 
---
I was probably wrong in the previous message, as why "linking into"
would be different from listing a library multiple times.

On the other hand, looking at the above, it seems that saying
"randr depends on render" is less a guessing-game than finding
out where to put PRESENT. (Since the "nightmare").

That is, this patch, while smaller and more conservative,
might as well be risky, and is at least less explicit.
(I.e. wouldn't it be harder to figure out whether to reorder the libs,
or to list some the second time, then just to add a LIBADD,
should it break on another toolchain?)
(Also maybe it was not Ubuntu, but gcc 6.3.0).

 configure.ac   | 2 +-
 hw/dmx/Makefile.am | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4dcf8b5c27a0..ddd0a61c9d97 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2330,7 +2330,7 @@ if test "x$DMX" = xyes; then
fi
DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC"
XDMX_CFLAGS="$DMXMODULES_CFLAGS"
-   XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $RECORD_LIB $XI_LIB 
$XKB_LIB $XKB_STUB_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB 
$MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $RANDR_LIB 
$CONFIG_LIB $OS_LIB $FIXES_LIB"
+   XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $PRESENT_LIB $RECORD_LIB $XI_LIB 
$XKB_LIB $XKB_STUB_LIB $DRI3_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB 
$MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB 
$RANDR_LIB $RENDER_LIB $OS_LIB $FIXES_LIB"
XDMX_SYS_LIBS="$DMXMODULES_LIBS"
AC_SUBST([XDMX_CFLAGS])
AC_SUBST([XDMX_LIBS])
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)
-- 
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

Re: [PATCH xserver] dmx: fix linking

2017-02-08 Thread Adam Jackson
On Sat, 2017-02-04 at 00:03 +0500, Mihail Konev wrote:

> diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am
> index eef84cb66a76..38d6ac409e76 100644
> --- a/hw/dmx/Makefile.am
> +++ b/hw/dmx/Makefile.am
> @@ -80,7 +80,8 @@ XDMX_LIBS = \
>  
>  Xdmx_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
>  Xdmx_DEPENDENCIES= $(XDMX_LIBS)
> -Xdmx_LDADD = $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS)
> +Xdmx_LDADD = $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS) \
> + $(top_builddir)/render/librender.la
>  
>  relink:

Merged this, as it fixes things for me here. I think there's a better
solution to be had, since basically all DDXes at this point have the
same set of libraries, so all the BLAHSERVER_LIBS stuff in configure.ac
should stop varying per-ddx at some point. But we can get there
whenever.

- ajax
___
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] dmx: fix linking

2017-02-06 Thread Michel Dänzer
On 04/02/17 06:53 AM, Mihail Konev wrote:
> On Fri, Feb 03, 2017 at 10:08:03AM +0900, Michel Dänzer wrote:
>> On 03/02/17 06:57 AM, Mihail Konev wrote:
>>> Regressed-in: bb9128fd ("present: disable page flip")
>>> Signed-off-by: Mihail Konev 
>>> ---
>>> Maybe there should be #ifdef-s instead - I only bisected :)
>>>
>>>  randr/Makefile.am | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/randr/Makefile.am b/randr/Makefile.am
>>> index 90dc9ec9aac4..90aa1289f958 100644
>>> --- a/randr/Makefile.am
>>> +++ b/randr/Makefile.am
>>> @@ -30,3 +30,4 @@ if XINERAMA
>>>  librandr_la_SOURCES += ${XINERAMA_SRCS}
>>>  endif
>>>  
>>> +librandr_la_LIBADD = $(top_builddir)/render/librender.la
>>>
>>
>> This looks weird. bb9128fd added a RRHasScanoutPixmap call in present
>> code; I'd expect that to require linking randr to wherever the present
>> code ends up, not sure why it would require linking render to randr.
>>
> 
> Linker command line for Xdmx was: render, present, randr
> With bb9128fd, needs to be: present, randr, render
> 
> Probably this is due to how inter-dependencies are resolved, as randr, 
> present, render gives:
> 
>   ../../present/.libs/libpresent.a(present.o): In function 
> `present_check_output_slaves_active':
>   /xserver/present/present.c:126: undefined reference to `RRHasScanoutPixmap'
>   collect2: error: ld returned 1 exit status
> 
> Adding render at the end of Xdmx_LDADD gives just the needed "present, randr, 
> render".
> (libtool probably only leaves the last librender.a).

FWIW, another possibility should be changing the XDMX_LIBS definition in
configure.ac.

I wonder which solution is best.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
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] dmx: fix linking

2017-02-03 Thread Mihail Konev
On Fri, Feb 03, 2017 at 10:08:03AM +0900, Michel Dänzer wrote:
> On 03/02/17 06:57 AM, Mihail Konev wrote:
> > Regressed-in: bb9128fd ("present: disable page flip")
> > Signed-off-by: Mihail Konev 
> > ---
> > Maybe there should be #ifdef-s instead - I only bisected :)
> > 
> >  randr/Makefile.am | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/randr/Makefile.am b/randr/Makefile.am
> > index 90dc9ec9aac4..90aa1289f958 100644
> > --- a/randr/Makefile.am
> > +++ b/randr/Makefile.am
> > @@ -30,3 +30,4 @@ if XINERAMA
> >  librandr_la_SOURCES += ${XINERAMA_SRCS}
> >  endif
> >  
> > +librandr_la_LIBADD = $(top_builddir)/render/librender.la
> > 
> 
> This looks weird. bb9128fd added a RRHasScanoutPixmap call in present
> code; I'd expect that to require linking randr to wherever the present
> code ends up, not sure why it would require linking render to randr.
> 

Linker command line for Xdmx was: render, present, randr
With bb9128fd, needs to be: present, randr, render

Probably this is due to how inter-dependencies are resolved, as randr, present, 
render gives:

  ../../present/.libs/libpresent.a(present.o): In function 
`present_check_output_slaves_active':
  /xserver/present/present.c:126: undefined reference to `RRHasScanoutPixmap'
  collect2: error: ld returned 1 exit status

Adding render at the end of Xdmx_LDADD gives just the needed "present, randr, 
render".
(libtool probably only leaves the last librender.a).
___
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] dmx: fix linking

2017-02-03 Thread Mihail Konev
On Fri, Feb 03, 2017 at 10:08:03AM +0900, Michel Dänzer wrote:
> On 03/02/17 06:57 AM, Mihail Konev wrote:
> > Regressed-in: bb9128fd ("present: disable page flip")
> > Signed-off-by: Mihail Konev 
> > ---
> > Maybe there should be #ifdef-s instead - I only bisected :)
> > 
> >  randr/Makefile.am | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/randr/Makefile.am b/randr/Makefile.am
> > index 90dc9ec9aac4..90aa1289f958 100644
> > --- a/randr/Makefile.am
> > +++ b/randr/Makefile.am
> > @@ -30,3 +30,4 @@ if XINERAMA
> >  librandr_la_SOURCES += ${XINERAMA_SRCS}
> >  endif
> >  
> > +librandr_la_LIBADD = $(top_builddir)/render/librender.la
> > 
> 
> This looks weird. bb9128fd added a RRHasScanoutPixmap call in present
> code; I'd expect that to require linking randr to wherever the present
> code ends up, not sure why it would require linking render to randr.
> 
> Anyway, https://patchwork.freedesktop.org/patch/136239/ and
> https://patchwork.freedesktop.org/patch/136238/ basically undo bb9128fd,
> can you test that the DMX failure is fixed with those?
> 

No failure with them on top of bb9128fdc86decd6f6e3b0e145011a8c08b1d2b5

Was:

../../randr/.libs/librandr.a(rrcrtc.o): In function `ProcRRSetCrtcTransform':
/xserver/randr/rrcrtc.c:1655: undefined reference to 
`PictTransform_from_xRenderTransform'
../../randr/.libs/librandr.a(rrcrtc.o): In function `transform_encode':
/xserver/randr/rrcrtc.c:1718: undefined reference to 
`xRenderTransform_from_PictTransform'
/xserver/randr/rrcrtc.c:1718: undefined reference to 
`xRenderTransform_from_PictTransform'
collect2: error: ld returned 1 exit status
Makefile:760: recipe for target 'Xdmx' failed

Corrected fix that does not link into, but with:

diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am
index eef84cb66a76..38d6ac409e76 100644
--- a/hw/dmx/Makefile.am
+++ b/hw/dmx/Makefile.am
@@ -80,7 +80,8 @@ XDMX_LIBS = \
 
 Xdmx_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
 Xdmx_DEPENDENCIES= $(XDMX_LIBS)
-Xdmx_LDADD = $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS)
+Xdmx_LDADD = $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS) \
+ $(top_builddir)/render/librender.la
 
 relink:
$(AM_V_at)rm -f Xdmx$(EXEEXT) && $(MAKE) Xdmx$(EXEEXT)

> 
> -- 
> Earthling Michel Dänzer   |   http://www.amd.com
> Libre software enthusiast | Mesa and X developer
___
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] dmx: fix linking

2017-02-02 Thread Michel Dänzer
On 03/02/17 06:57 AM, Mihail Konev wrote:
> Regressed-in: bb9128fd ("present: disable page flip")
> Signed-off-by: Mihail Konev 
> ---
> Maybe there should be #ifdef-s instead - I only bisected :)
> 
>  randr/Makefile.am | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/randr/Makefile.am b/randr/Makefile.am
> index 90dc9ec9aac4..90aa1289f958 100644
> --- a/randr/Makefile.am
> +++ b/randr/Makefile.am
> @@ -30,3 +30,4 @@ if XINERAMA
>  librandr_la_SOURCES += ${XINERAMA_SRCS}
>  endif
>  
> +librandr_la_LIBADD = $(top_builddir)/render/librender.la
> 

This looks weird. bb9128fd added a RRHasScanoutPixmap call in present
code; I'd expect that to require linking randr to wherever the present
code ends up, not sure why it would require linking render to randr.

Anyway, https://patchwork.freedesktop.org/patch/136239/ and
https://patchwork.freedesktop.org/patch/136238/ basically undo bb9128fd,
can you test that the DMX failure is fixed with those?


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
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] dmx: fix linking

2017-02-02 Thread Mihail Konev
Regressed-in: bb9128fd ("present: disable page flip")
Signed-off-by: Mihail Konev 
---
Maybe there should be #ifdef-s instead - I only bisected :)

 randr/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/randr/Makefile.am b/randr/Makefile.am
index 90dc9ec9aac4..90aa1289f958 100644
--- a/randr/Makefile.am
+++ b/randr/Makefile.am
@@ -30,3 +30,4 @@ if XINERAMA
 librandr_la_SOURCES += ${XINERAMA_SRCS}
 endif
 
+librandr_la_LIBADD = $(top_builddir)/render/librender.la
-- 
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