All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/mesa3d: override dri path
@ 2019-01-12 19:07 Romain Naour
  2019-01-13 13:11 ` Thomas Petazzoni
  2019-01-14 21:31 ` Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Romain Naour @ 2019-01-12 19:07 UTC (permalink / raw)
  To: buildroot

Since the bump to 1.5.3, pkgconf prepends the sysroot to all absolute
paths found in the .pc file. This is correct when the paths refer to
something in STAGING_DIR (e.g. libdir, includedir), but not when it
refers to something used for the target.

As reported by #11591, the xerver fail to load dri modules (r600_dri.so):

From Xorg.0.log:
(EE) AIGLX error: dlopen of /full/path/to/sysroot/usr/lib/dri/r600_dri.so failed (/full/path/to/sysroot/usr/lib/dri/r600_dri.so: cannot open shared object file: No such file or directory)
(II) GLX: no usable GL providers found for screen 0

That's because the xserver hardcode the dri divers directory path in
DRI_DRIVER_PATH which come from
dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri`

We can see in dri.pc that dridriverdir use libdir which is now prefixed
by the sysroot by pkgconf 1.5.3:

prefix=/usr
exec_prefix=/usr
libdir=${exec_prefix}/lib
includedir=${prefix}/include
dridriverdir=${libdir}/dri

Since we can't rely on pkgconf anymore, use --with-dri-driverdir="/usr/lib/dri"
to use explicitly "/usr/lib/dri" instead of relying on dri.pc.

Tested using TestGlxinfo test from:
http://patchwork.ozlabs.org/patch/1021669/

Fixes:
https://bugs.buildroot.org/show_bug.cgi?id=11591

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/mesa3d/mesa3d.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk
index 2fe46bdd8b..becc286361 100644
--- a/package/mesa3d/mesa3d.mk
+++ b/package/mesa3d/mesa3d.mk
@@ -136,6 +136,7 @@ endif
 MESA3D_CONF_OPTS += \
 	--enable-shared-glapi \
 	--enable-driglx-direct \
+	--with-dri-driverdir="/usr/lib/dri" \
 	--with-dri-drivers=$(subst $(space),$(comma),$(MESA3D_DRI_DRIVERS-y))
 endif
 
-- 
2.14.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] package/mesa3d: override dri path
  2019-01-12 19:07 [Buildroot] [PATCH] package/mesa3d: override dri path Romain Naour
@ 2019-01-13 13:11 ` Thomas Petazzoni
  2019-01-14 21:31 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2019-01-13 13:11 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 12 Jan 2019 20:07:43 +0100, Romain Naour wrote:
> Since the bump to 1.5.3, pkgconf prepends the sysroot to all absolute
> paths found in the .pc file.

No, this is not what pkgconf is doing. pkg-config is prepending the
sysroot only to:

 includedir
 libdir
 mapdir
 pkgdatadir
 sdkdir

However, since dridriverdir is defined in the .pc file as being equal
to ${libdir}/dri, it inherits from the sysroot-prefixed libdir path.

I'll fix this up in the commit log when applying.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] package/mesa3d: override dri path
  2019-01-12 19:07 [Buildroot] [PATCH] package/mesa3d: override dri path Romain Naour
  2019-01-13 13:11 ` Thomas Petazzoni
@ 2019-01-14 21:31 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2019-01-14 21:31 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 12 Jan 2019 20:07:43 +0100, Romain Naour wrote:
> Since the bump to 1.5.3, pkgconf prepends the sysroot to all absolute
> paths found in the .pc file. This is correct when the paths refer to
> something in STAGING_DIR (e.g. libdir, includedir), but not when it
> refers to something used for the target.
> 
> As reported by #11591, the xerver fail to load dri modules (r600_dri.so):
> 
> From Xorg.0.log:
> (EE) AIGLX error: dlopen of /full/path/to/sysroot/usr/lib/dri/r600_dri.so failed (/full/path/to/sysroot/usr/lib/dri/r600_dri.so: cannot open shared object file: No such file or directory)
> (II) GLX: no usable GL providers found for screen 0
> 
> That's because the xserver hardcode the dri divers directory path in
> DRI_DRIVER_PATH which come from
> dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri`
> 
> We can see in dri.pc that dridriverdir use libdir which is now prefixed
> by the sysroot by pkgconf 1.5.3:
> 
> prefix=/usr
> exec_prefix=/usr
> libdir=${exec_prefix}/lib
> includedir=${prefix}/include
> dridriverdir=${libdir}/dri
> 
> Since we can't rely on pkgconf anymore, use --with-dri-driverdir="/usr/lib/dri"
> to use explicitly "/usr/lib/dri" instead of relying on dri.pc.
> 
> Tested using TestGlxinfo test from:
> http://patchwork.ozlabs.org/patch/1021669/
> 
> Fixes:
> https://bugs.buildroot.org/show_bug.cgi?id=11591
> 
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> Cc: Bernd Kuhls <bernd.kuhls@t-online.de>

I've applied after fixing the commit log, as I explained in my previous
reply.

> +	--with-dri-driverdir="/usr/lib/dri" \

I also dropped the double quotes around /usr/lib/dri.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-14 21:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-12 19:07 [Buildroot] [PATCH] package/mesa3d: override dri path Romain Naour
2019-01-13 13:11 ` Thomas Petazzoni
2019-01-14 21:31 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.