Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 299654

Summary: x11-libs/libX11 fails to cross compile (Cannot find keysymdef.h)
Product: Gentoo Linux Reporter: Yuri Vasilevski (RETIRED) <yvasilev>
Component: Current packagesAssignee: Gentoo X packagers <x11>
Status: RESOLVED FIXED    
Severity: normal CC: agaffney, alexander, bjorn.ottervik
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: stable build fail log
testing build fail log

Description Yuri Vasilevski (RETIRED) gentoo-dev 2010-01-04 18:16:55 UTC
When libX11's configure script calls `pkg-config --variable=includedir xproto` in a sysrooted environment pkg-config returns "'/usr/armv4tl-softfloat-linux-gnueabi/usr'/include" which is unusable for the configure script as it then double quotes the result, putting the pkg-config single quotes as part of the path.

The relevant part from configure.ac is:

#
# Find keysymdef.h
#
AC_MSG_CHECKING([keysymdef.h])
dir=`pkg-config --variable=includedir xproto`
KEYSYMDEF="$dir/X11/keysymdef.h"
if test -f "$KEYSYMDEF"; then
        AC_MSG_RESULT([$KEYSYMDEF])
else
        AC_MSG_ERROR([Cannot find keysymdef.h])
fi
AC_SUBST(KEYSYMDEF)

When I do the commands by hand:

# export PKG_CONFIG_PATH="/usr/armv4tl-softfloat-linux-gnueabi/usr/lib/pkgconfig/"

# pkg-config --variable=includedir xproto
'/usr/armv4tl-softfloat-linux-gnueabi/usr'/include

# export dir=`pkg-config --variable=includedir xproto`

# export KEYSYMDEF="$dir/X11/keysymdef.h"

# echo "$KEYSYMDEF"
'/usr/armv4tl-softfloat-linux-gnueabi/usr'/include/X11/keysymdef.h

# test -f "$KEYSYMDEF" && echo ok || echo missing
missing

#test -f '/usr/armv4tl-softfloat-linux-gnueabi/usr'/include/X11/keysymdef.h && echo ok || echo missing
ok


Reproducible: Always

Steps to Reproduce:




# armv4tl-softfloat-linux-gnueabi-emerge --info
Portage 2.1.7.16 (!/usr/local/portage/openmoko-target/profiles/openmoko, gcc-4.4.2, glibc-2.11-r1, 2.6.30-2-amd64 x86_64)
=================================================================
System uname: Linux-2.6.30-2-amd64-x86_64-Intel-R-_Core-TM-2_Duo_CPU_L7700_@_1.80GHz-with-gentoo-2.0.1
Timestamp of tree: Mon, 04 Jan 2010 15:00:01 +0000
app-shells/bash:     4.0_p35
dev-lang/python:     2.6.4, 3.1.1-r1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.0
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.65
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="arm ~arm"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-Os -pipe -march=armv4t -mtune=arm920t -fomit-frame-pointer -I/usr/armv4tl-softfloat-linux-gnueabi/usr/include/ -I/usr/armv4tl-softfloat-linux-gnueabi/include/"
CHOST="armv4tl-softfloat-linux-gnueabi"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CTARGET="armv4tl-softfloat-linux-gnueabi"
CXXFLAGS="-Os -pipe -march=armv4t -mtune=arm920t -fomit-frame-pointer -I/usr/armv4tl-softfloat-linux-gnueabi/usr/include/ -I/usr/armv4tl-softfloat-linux-gnueabi/include/"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests buildpkg distlocks fixpackages news nodoc noinfo noman parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS=" 	http://gentoo.osuosl.org/ 	http://distfiles.gentoo.org 	http://distro.ibiblio.org/pub/linux/distributions/gentoo "
LANG="en_US.UTF-8"
LDFLAGS="-L/usr/armv4tl-softfloat-linux-gnueabi/lib -L/usr/armv4tl-softfloat-linux-gnueabi/usr/lib -Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
MAKEOPTS="-j1"
PKGDIR="/var/tmp/portage/packages/openmoko-target"
PORTAGE_CONFIGROOT="/usr/armv4tl-softfloat-linux-gnueabi/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp/portage/build/openmoko-target"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/openmoko-target /usr/armv4tl-softfloat-linux-gnueabi/usr/local/portage/hacks"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="arm bash-completion bindist cracklib hal iconv make-symlinks midi minimal multicall ncurses nls nptl pic python readline sqlite ssl unicode zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse tslib" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="fbdev glamo dummy" 
Unset:  CPPFLAGS, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2010-01-04 18:30:08 UTC
(In reply to comment #0)
> dir=`pkg-config --variable=includedir xproto`

I think this should be:

dir=`$PKG_CONFIG --variable=includedir xproto`

I don't have a system to test.
Comment 2 Yuri Vasilevski (RETIRED) gentoo-dev 2010-01-04 18:42:17 UTC
Fails with the same error:
checking keysymdef.h... configure: error: Cannot find keysymdef.h
Comment 3 Yuri Vasilevski (RETIRED) gentoo-dev 2010-01-04 18:59:01 UTC
The only way I'am able to circumvent this is with:
-KEYSYMDEF="$dir/X11/keysymdef.h"
+eval KEYSYMDEF="$dir/X11/keysymdef.h"

But I'm not sure how portable this eval thing will be among all the platforms that libX11 is supposed to compile on.
Comment 4 RĂ©mi Cardona (RETIRED) gentoo-dev 2010-01-05 08:08:20 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > dir=`pkg-config --variable=includedir xproto`
> 
> I think this should be:
> 
> dir=`$PKG_CONFIG --variable=includedir xproto`
> 
> I don't have a system to test.

That's been fixed in all upstream Xorg modules, which should help for cross-compiling.

Thanks
Comment 5 Andrew Gaffney (RETIRED) gentoo-dev 2010-01-06 13:19:49 UTC
In the mean time, I was able to manually remove the single quotes around $prefix in the SYSROOT's xproto.pc and the ./configure succeeded.
Comment 6 Luca Barbato gentoo-dev 2011-06-16 04:45:23 UTC
Upstream actually made the situation worse at least in the 1.4.3
Comment 7 Emery Hemingway 2012-03-06 22:21:09 UTC
So how does one get around this?
Comment 8 Matt Turner gentoo-dev 2017-03-05 03:46:55 UTC
Is this still a problem with current stable?
Comment 9 Bjoern Ottervik 2017-03-05 20:22:14 UTC
Created attachment 466086 [details]
stable build fail log
Comment 10 Bjoern Ottervik 2017-03-05 20:22:42 UTC
Created attachment 466088 [details]
testing build fail log
Comment 11 Bjoern Ottervik 2017-03-05 20:23:05 UTC
(In reply to Matt Turner from comment #8)
> Is this still a problem with current stable?

Yes, both stable and testing.
Comment 12 tt_1 2019-03-10 12:23:24 UTC
I couldn't reproduce with latest 1.6.7, but it seems the host has to have all kind of headers installed. So basically, emerge libX11 + deps first on the host, and then for the cross-compile chroot.
Comment 14 Larry the Git Cow gentoo-dev 2019-06-17 15:25:52 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e63e33be6eb1f152b27c00a81494e85b3152709

commit 6e63e33be6eb1f152b27c00a81494e85b3152709
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2019-06-17 14:54:52 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2019-06-17 15:18:51 +0000

    x11-libs/libX11: Version bump to 1.6.8
    
    Closes: https://bugs.gentoo.org/299654
    Closes: https://bugs.gentoo.org/550502
    Closes: https://bugs.gentoo.org/616140
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 x11-libs/libX11/Manifest            |  1 +
 x11-libs/libX11/libX11-1.6.8.ebuild | 28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)