[Wayland-bugs] [Bug 97828] wayland-scanner.pc.in: wayland_scanner variable does not prepend ${pc_sysrootdir}, potentially breaking cross-compilation

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Sep 15 21:29:36 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=97828

            Bug ID: 97828
           Summary: wayland-scanner.pc.in: wayland_scanner variable does
                    not prepend ${pc_sysrootdir}, potentially breaking
                    cross-compilation
           Product: Wayland
           Version: 1.2.0
          Hardware: All
                OS: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: wayland
          Assignee: wayland-bugs at lists.freedesktop.org
          Reporter: joe.konno at linux.intel.com

I was attempting to cross-compile mesa with wayland-egl (with sysroots defined
and such) and it was failing to find wayland-scanner, breaking the build. I am
cross-compiling mesa in Yocto-based fashion on an Intel-based linux host, with
an Intel-based target.

This wayland-scanner.pc.in bug is one of two bugs that are blocking me from
building latest mesa master (the second bug unveiled lies in a Yocto bitbake
package recipe that I'll be fixing separately).

pkg-config will automagically prepend the sysrootdir path whenever pkg-config
is passed -I or -L (include paths, ld paths respectively). However, in cases
where arbitrary pkg-config variables are set-- as in the wayland_scanner case--
the sysrootdir _is not_ automatically prepended. This is what nipped me and
started me down this debug path.

Put visually, when mesa master (as of commit mentioned above) is configured,
'bitbake mesa' config.log is populated like this:

config.log (before filthy hack to prove the bug, ):
 
WAYLAND_LIBS='-L/home/jbkonno/snip/poky/build/tmp/sysroots/intel-snip-corei7-64/usr/lib64
-lwayland-client -lwayland-server'
  WAYLAND_SCANNER='/usr/bin/wayland-scanner'

After hacking the wayland-scanner.pc file in the _target_ sysroot, running
'bitbake mesa' again produced a config.log populated this way:
 
WAYLAND_LIBS='-L/home/jbkonno/snip/poky/build/tmp/sysroots/intel-snip-corei7-64/usr/lib64
-lwayland-client -lwayland-server'
 
WAYLAND_SCANNER='/home/jbkonno/snip/poky/build/tmp/sysroots/intel-snip-corei7-64/usr/bin/wayland-scanner'

Note the diff in the WAYLAND_SCANNER values.

I'll be posting the patch on the mailing list soon, but for those who like
spoilers, I had to prepend ${pc_sysrootdir} to the wayland_scanner variable in
the .pc file.

Quick shout out to the following sites for helping me narrow down the
possibles:
  * https://autotools.io/pkgconfig/cross-compiling.html
  * http://dev.gentoo.org/~mgorny/pkg-config-spec.html

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-bugs/attachments/20160915/7813af9f/attachment.html>


More information about the wayland-bugs mailing list