From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org)
	by nuthatch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-embedded+bounces-1043-garchives=archives.gentoo.org@gentoo.org>)
	id 1G1UBA-0000Xz-MV
	for garchives@archives.gentoo.org; Fri, 14 Jul 2006 20:22:29 +0000
Received: from robin.gentoo.org (localhost [127.0.0.1])
	by robin.gentoo.org (8.13.7/8.13.6) with SMTP id k6EKLQA2022503;
	Fri, 14 Jul 2006 20:21:26 GMT
Received: from april.chuckr.org (april.chuckr.org [66.92.151.30])
	by robin.gentoo.org (8.13.7/8.13.6) with ESMTP id k6EKLOLZ009629
	for <gentoo-embedded@lists.gentoo.org>; Fri, 14 Jul 2006 20:21:25 GMT
Received: from [66.92.151.44] (may.chuckr.org [66.92.151.44])
	by april.chuckr.org (8.13.6/8.13.6) with ESMTP id k6EK2suo037311
	for <gentoo-embedded@lists.gentoo.org>; Fri, 14 Jul 2006 16:02:55 -0400 (EDT)
	(envelope-from chuckr@chuckr.org)
Message-ID: <44B7FCC2.2040206@chuckr.org>
Date: Fri, 14 Jul 2006 16:21:22 -0400
From: Chuck Robey <chuckr@chuckr.org>
User-Agent: Mozilla/5.0 (X11; U; Darwin Power Macintosh; en-US; rv:1.7.5) Gecko/20060312
X-Accept-Language: en-us, en
Precedence: bulk
List-Post: <mailto:gentoo-embedded@lists.gentoo.org>
List-Help: <mailto:gentoo-embedded+help@gentoo.org>
List-Unsubscribe: <mailto:gentoo-embedded+unsubscribe@gentoo.org>
List-Subscribe: <mailto:gentoo-embedded+subscribe@gentoo.org>
List-Id: Gentoo Linux mail <gentoo-embedded.gentoo.org>
X-BeenThere: gentoo-embedded@gentoo.org
Reply-to: gentoo-embedded@lists.gentoo.org
MIME-Version: 1.0
To: gentoo-embedded@lists.gentoo.org
Subject: Re: [gentoo-embedded] Problem cross compiling modular X
References: <000101c6a0ec$0ca2f510$1a06a8c0@LXP0004>
In-Reply-To: <000101c6a0ec$0ca2f510$1a06a8c0@LXP0004>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by robin.gentoo.org id k6EKLQAn022503
X-Archives-Salt: 0668f9d5-b347-4e67-b336-fe8288f66e64
X-Archives-Hash: 90f6b27e38937102c48f199fee0e5407

Ryan Baldwin wrote:

> Hi,
>
> I have been trying to develop an embedded system using gentoo that can=20
> be cross compiled. I have succeeded in building a busybox/uclibc based=20
> system and PXE booting. I am now trying to emerge xorg-server but get=20
> the following error:
>
> ./include/X11/Xauth.h:48:31: X11/Xfuncproto.h: No such file or director=
y
>
> ./include/X11/Xauth.h:49:27: X11/Xfuncs.h: No such file or directory
>
> In file included from AuDispose.c:33:
>
> ./include/X11/Xauth.h:62: error: syntax error before "char"
>
> ./include/X11/Xauth.h:69: error: syntax error before "char"
>
> ./include/X11/Xauth.h:73: warning: function declaration isn't a prototy=
pe
>
> ./include/X11/Xauth.h:76: error: syntax error before "char"
>
> ./include/X11/Xauth.h:77: warning: function declaration isn't a prototy=
pe
>
> ./include/X11/Xauth.h:85: error: syntax error before "char"
>
> ./include/X11/Xauth.h:86: warning: function declaration isn't a prototy=
pe
>
> ./include/X11/Xauth.h:96: error: syntax error before "_Xconst"
>
> ./include/X11/Xauth.h:109: warning: function declaration isn't a protot=
ype
>
> ./include/X11/Xauth.h:119: error: syntax error before "_Xconst"
>
> ./include/X11/Xauth.h:129: warning: function declaration isn't a protot=
ype
>
> In file included from AuDispose.c:34:
>
> /usr/i686-pc-linux-uclibc/usr/include/stdlib.h:97: error: syntax error=20
> before "typedef"
>
> AuDispose.c: In function `XauDisposeAuth':
>
> AuDispose.c:45: warning: implicit declaration of function `bzero'
>
> AuDispose.c:45: warning: nested extern declaration of `bzero'
>
> make[1]: *** [AuDispose.lo] Error 1
>
> make[1]: Leaving directory=20
> `/var/tmp/portage/libXau-1.0.1/work/libXau-1.0.1'
>
> make: *** [all] Error 2
>
> !!! ERROR: x11-libs/libXau-1.0.1 failed.
>
> Call stack:
>
> ebuild.sh, line 1539: Called dyn_compile
>
> ebuild.sh, line 939: Called src_compile
>
> ebuild.sh, line 1248: Called x-modular_src_compile
>
> x-modular.eclass, line 327: Called x-modular_src_make
>
> x-modular.eclass, line 322: Called die
>
>
>
> Prior to this it has just successfully emerged xproto which has=20
> installed the header file that this package is not picking up. Also I=20
> can emerge xorg-server in the host environment with problems.
>
> During its configure it spits out
>
>
>
> ./configure --prefix=3D/usr --host=3Di686-pc-linux-uclibc=20
> --mandir=3D/usr/share/man --infodir=3D/usr/share/info --datadir=3D/usr/=
share=20
> --sysconfdir=3D/etc --localstatedir=3D/var/lib --prefix=3D/usr=20
> --datadir=3D/usr/share --build=3Di686-pc-linux-gnu
>
> checking for a BSD-compatible install... /bin/install -c
>
> checking whether build environment is sane... yes
>
> checking for gawk... gawk
>
> checking whether make sets $(MAKE)... yes
>
> checking for i686-pc-linux-uclibc-strip... i686-pc-linux-uclibc-strip
>
> checking whether to enable maintainer-specific portions of Makefiles...=
 no
>
> checking for i686-pc-linux-uclibc-gcc... i686-pc-linux-uclibc-gcc
>
> checking for C compiler default output file name... a.out
>
> checking whether the C compiler works... yes
>
> checking whether we are cross compiling... yes
>
>
>
>
> Here I am trying to compile on a host i686-pc-linux-gnu for a target=20
> i686-pc-linux-uclibc. Is this right =96 from my understanding(not the=20
> best) should have --host=3Di686-pc-linux-glibs =96target=3D target=20
> i686-pc-linux-uclibc. Anyhow to continue.
>
> My procedure for building this system involves first setting up a=20
> chroot env with a fresh portage and then using crossdev to build a=20
> toolchain and then emerge to build. This is the script I use to build=20
> the chroot environment:
>
>
>
>
>
> RBCONFDIR=3D${RBTHEROOT}/conf/${1}
>
> RBMEDIADIR=3D${RBTHEROOT}/media
>
> RBBUILDROOT=3D${RBTHEROOT}/${1}_chroot
>
> . ${RBCONFDIR}/conf
>
> echo "Config Dir: ${RBCONFDIR}"
>
> echo "Making build root: ${RBBUILDROOT}"
>
> mkdir ${RBBUILDROOT}
>
> cd ${RBBUILDROOT}
>
> echo "Extracting files to build root."
>
> tar xjpf ${RBMEDIADIR}/stage3-i686-2006.0.tar.bz2
>
> tar xjf ${RBMEDIADIR}/portage-20060703.tar.bz2 -C ${RBBUILDROOT}/usr
>
> echo "Copying distfiles"
>
> cp ${RBMEDIADIR}/distfiles/* ${RBBUILDROOT}/usr/portage/distfiles/
>
> echo "Putting in place host make.conf"
>
> cp ${RBTHEROOT}/conf/make.conf ${RBBUILDROOT}/etc/
>
> echo "Copying DNS info"
>
> cp -L /etc/resolv.conf ${RBBUILDROOT}/etc/resolv.conf
>
> echo "Mounting proc filesystem"
>
> mount -t proc none ${RBBUILDROOT}/proc
>
> echo "Mounting dev filesystem"
>
> mount -o bind /dev ${RBBUILDROOT}/dev
>
> echo "Copying phase 2 build files"
>
> mkdir ${RBBUILDROOT}/p2build
>
> cp -r ${RBCONFDIR} ${RBBUILDROOT}/p2build/conf
>
> cp -r ${RBTHEROOT}/build_target/* ${RBBUILDROOT}/p2build/
>
> echo "Entering chroot"
>
> chroot ${RBBUILDROOT} bash /p2build/build-target
>
>
>
> The preeceeding script source this . ${RBCONFDIR}/conf:
>
>
>
> MY_TARGET_ARCH=3Dx86
>
> MY_TARGET_KERNEL_ARCH=3Di386
>
> MY_TARGET_CHOST=3Di686-pc-linux-uclibc
>
> MY_TARGET_CFLAGS=3D"-Os -march=3Dpentium4 -pipe -fomit-frame-pointer"
>
> MY_TARGET_USE=3D"-* x86 mmx ssl theora threads tiff doc usb vcd vorbis=20
> wifi win32codecs wmf xml2 xpm xv xvid bzlib ncurses pam zlib avi crypt=20
> divx4linux ftp gd gif gmp gphoto2 gtk gtk2 imlib avi live matroska=20
> mpeg oggvorbis real theora xanim jpeg libwww mpeg msn opengl pdflib=20
> png quicktime dri firebird flac gstreamer java kdeenablefinal libedit=20
> mikmod mmap mng mp3 ogg sdl pdflib bash-completion bitmap-font=20
> truetype-fonts spell tiff truetype usb xmms X a52 aac qt kde dvd dvdr=20
> dlloader alsa cdr nvidia nptl nptlonly pic"
>
> MY_TARGET_INPUT_DEVICES=3D"keyboard mouse"
>
> MY_TARGET_VIDEO_CARDS=3D"nvidia"
>
>
>
>
> This all works OK. The last line enters the chroot env and executes=20
> the following script:
>
>
>
>
> echo "Syncing source tree"
>
> #emerge --sync
>
> emerge xorg-server # This works so it builds ok in the host.
>
>
> echo "Merging cross dev"
>
> emerge -v crossdev
>
> echo "Fixing overlay"
>
> echo "PORTDIR_OVERLAY=3D\"/usr/local/portage\"" >> /etc/make.conf
>
> mkdir /usr/local/portage
>
> . /p2build/conf/conf
>
> echo "Creating cross toolchain: ${MY_TARGET_CHOST}"
>
> crossdev --binutils 2.16.1-r2 --gcc 3.4.5-r1 --libc 0.9.29 --kernel=20
> 2.6.17 -t $MY_TARGET_CHOST
>
> mkdir -p /tmp/target
>
> echo "sys-apps/baselayout-lite -*" >> /etc/portage/package.keywords
>
> PRET=3D
>
> echo "Creating kernel"
>
> mkdir /tmp/kernel
>
> echo "sys-kernel/vanilla-sources ~x86" >> /etc/portage/package.keywords
>
> ROOT=3D"/tmp/kernel" \
>
> ARCH=3D"$MY_TARGET_ARCH" \
>
> CHOST=3D"$MY_TARGET_CHOST" \
>
> CBUILD=3D"i686-pc-linux-gnu" \
>
> CFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> CXXFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> INPUT_DEVICES=3D"$MY_TARGET_INPUT_DEVICES" \
>
> VIDEO_CARDS=3D"$MY_TARGET_VIDEO_CARDS" \
>
> USE=3D"${MY_TARGET_USE}" \
>
> CONFIG_PROTECT=3D"-* ${ROOT}/etc" \
>
> emerge $PRET -v --nodeps vanilla-sources
>
> cp -f /p2build/conf/.config /tmp/kernel/usr/src/linux/
>
> cd /tmp/kernel/usr/src/linux/
>
> ROOT=3D"/tmp/kernel" \
>
> CROSS_COMPILE=3D"${MY_TARGET_CHOST}-" \
>
> ARCH=3D"$MY_TARGET_KERNEL_ARCH" \
>
> CHOST=3D"$MY_TARGET_CHOST" \
>
> CBUILD=3D"i686-pc-linux-gnu" \
>
> CFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> CXXFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> INPUT_DEVICES=3D"$MY_TARGET_INPUT_DEVICES" \
>
> VIDEO_CARDS=3D"$MY_TARGET_VIDEO_CARDS" \
>
> USE=3D"${MY_TARGET_USE}" \
>
> CONFIG_PROTECT=3D"-* ${ROOT}/etc" \
>
> make bzImage
>
> cd /
>
> echo "Creating rootfs"
>
> ROOT=3D"/tmp/target" \
>
> ARCH=3D"$MY_TARGET_ARCH" \
>
> CHOST=3D"$MY_TARGET_CHOST" \
>
> CBUILD=3D"i686-pc-linux-gnu" \
>
> CFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> CXXFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> INPUT_DEVICES=3D"$MY_TARGET_INPUT_DEVICES" \
>
> VIDEO_CARDS=3D"$MY_TARGET_VIDEO_CARDS" \
>
> USE=3D"${MY_TARGET_USE} make-symlinks" \
>
> CONFIG_PROTECT=3D"-* ${ROOT}/etc" \
>
> emerge $PRET -v busybox
>
> ROOT=3D"/tmp/target" \
>
> ARCH=3D"$MY_TARGET_ARCH" \
>
> CHOST=3D"$MY_TARGET_CHOST" \
>
> CBUILD=3D"i686-pc-linux-gnu" \
>
> CFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> CXXFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> INPUT_DEVICES=3D"$MY_TARGET_INPUT_DEVICES" \
>
> VIDEO_CARDS=3D"$MY_TARGET_VIDEO_CARDS" \
>
> USE=3D"${MY_TARGET_USE}" \
>
> CONFIG_PROTECT=3D"-* ${ROOT}/etc" \
>
> emerge $PRET -v baselayout-lite
>
> ROOT=3D"/tmp/target" \
>
> ARCH=3D"$MY_TARGET_ARCH" \
>
> CHOST=3D"$MY_TARGET_CHOST" \
>
> CBUILD=3D"i686-pc-linux-gnu" \
>
> CFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> CXXFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> INPUT_DEVICES=3D"$MY_TARGET_INPUT_DEVICES" \
>
> VIDEO_CARDS=3D"$MY_TARGET_VIDEO_CARDS" \
>
> USE=3D"${MY_TARGET_USE}" \
>
> CONFIG_PROTECT=3D"-* ${ROOT}/etc" \
>
> emerge $PRET -v cross-${MY_TARGET_CHOST}/uclibc
>
> cp /tmp/target/bin/busybox /bin/busybox
>
> ROOT=3D"/tmp/target" \
>
> ARCH=3D"$MY_TARGET_ARCH" \
>
> CHOST=3D"$MY_TARGET_CHOST" \
>
> CBUILD=3D"i686-pc-linux-gnu" \
>
> CFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> CXXFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> INPUT_DEVICES=3D"$MY_TARGET_INPUT_DEVICES" \
>
> VIDEO_CARDS=3D"$MY_TARGET_VIDEO_CARDS" \
>
> USE=3D"${MY_TARGET_USE} make-symlinks" \
>
> CONFIG_PROTECT=3D"-* ${ROOT}/etc" \
>
> emerge $PRET -v busybox
>
> ROOT=3D"/tmp/target" \
>
> ARCH=3D"$MY_TARGET_ARCH" \
>
> CHOST=3D"$MY_TARGET_CHOST" \
>
> CBUILD=3D"i686-pc-linux-gnu" \
>
> CFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> CXXFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> INPUT_DEVICES=3D"$MY_TARGET_INPUT_DEVICES" \
>
> VIDEO_CARDS=3D"$MY_TARGET_VIDEO_CARDS" \
>
> USE=3D"${MY_TARGET_USE} make-symlinks" \
>
> CONFIG_PROTECT=3D"-* ${ROOT}/etc" \
>
> emerge $PRET -v busybox
>
>
>
> And this all works ok too. I can then use the built kernel and rootfs=20
> and PXE boot it. The problem then comes when trying to emerge=20
> xorg-server. I do the following:
>
>
>
> ROOT=3D"/tmp/target" \
>
> ARCH=3D"$MY_TARGET_ARCH" \
>
> CHOST=3D"$MY_TARGET_CHOST" \
>
> CBUILD=3D"i686-pc-linux-gnu" \
>
> CFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> CXXFLAGS=3D"$MY_TARGET_CFLAGS" \
>
> INPUT_DEVICES=3D"$MY_TARGET_INPUT_DEVICES" \
>
> VIDEO_CARDS=3D"$MY_TARGET_VIDEO_CARDS" \
>
> USE=3D"${MY_TARGET_USE} cross -doc" \
>
> CONFIG_PROTECT=3D"-* ${ROOT}/etc" \
>
> emerge $PRET -v xorg-server
>
> and after emerging a few packages I get the error. Any help would be=20
> greatly appreciates.
>
> Thanks
>
> Ryan
>
>
>
Wow, this is fantastic! Can I take alook?
--=20
gentoo-embedded@gentoo.org mailing list