Ryan Baldwin wrote:
Hi,
I have been trying to develop an embedded system using gentoo that can
be cross compiled. I have succeeded in building a busybox/uclibc based
system and PXE booting. I am now trying to emerge xorg-server but get
the following error:
./include/X11/Xauth.h:48:31: X11/Xfuncproto.h: No such file or directory
./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 prototype
./include/X11/Xauth.h:76: error: syntax error before "char"
./include/X11/Xauth.h:77: warning: function declaration isn't a prototype
./include/X11/Xauth.h:85: error: syntax error before "char"
./include/X11/Xauth.h:86: warning: function declaration isn't a prototype
./include/X11/Xauth.h:96: error: syntax error before "_Xconst"
./include/X11/Xauth.h:109: warning: function declaration isn't a prototype
./include/X11/Xauth.h:119: error: syntax error before "_Xconst"
./include/X11/Xauth.h:129: warning: function declaration isn't a prototype
In file included from AuDispose.c:34:
/usr/i686-pc-linux-uclibc/usr/include/stdlib.h:97: error: syntax error
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
`/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
installed the header file that this package is not picking up. Also I
can emerge xorg-server in the host environment with problems.
During its configure it spits out
./configure --prefix=/usr --host=i686-pc-linux-uclibc
--mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share
--sysconfdir=/etc --localstatedir=/var/lib --prefix=/usr
--datadir=/usr/share --build=i686-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
i686-pc-linux-uclibc. Is this right – from my understanding(not the
best) should have --host=i686-pc-linux-glibs –target= target
i686-pc-linux-uclibc. Anyhow to continue.
My procedure for building this system involves first setting up a
chroot env with a fresh portage and then using crossdev to build a
toolchain and then emerge to build. This is the script I use to build
the chroot environment:
RBCONFDIR=${RBTHEROOT}/conf/${1}
RBMEDIADIR=${RBTHEROOT}/media
RBBUILDROOT=${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=x86
MY_TARGET_KERNEL_ARCH=i386
MY_TARGET_CHOST=i686-pc-linux-uclibc
MY_TARGET_CFLAGS="-Os -march=pentium4 -pipe -fomit-frame-pointer"
MY_TARGET_USE="-* x86 mmx ssl theora threads tiff doc usb vcd vorbis
wifi win32codecs wmf xml2 xpm xv xvid bzlib ncurses pam zlib avi crypt
divx4linux ftp gd gif gmp gphoto2 gtk gtk2 imlib avi live matroska
mpeg oggvorbis real theora xanim jpeg libwww mpeg msn opengl pdflib
png quicktime dri firebird flac gstreamer java kdeenablefinal libedit
mikmod mmap mng mp3 ogg sdl pdflib bash-completion bitmap-font
truetype-fonts spell tiff truetype usb xmms X a52 aac qt kde dvd dvdr
dlloader alsa cdr nvidia nptl nptlonly pic"
MY_TARGET_INPUT_DEVICES="keyboard mouse"
MY_TARGET_VIDEO_CARDS="nvidia"
This all works OK. The last line enters the chroot env and executes
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=\"/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
2.6.17 -t $MY_TARGET_CHOST
mkdir -p /tmp/target
echo "sys-apps/baselayout-lite -*" >> /etc/portage/package.keywords
PRET=
echo "Creating kernel"
mkdir /tmp/kernel
echo "sys-kernel/vanilla-sources ~x86" >> /etc/portage/package.keywords
ROOT="/tmp/kernel" \
ARCH="$MY_TARGET_ARCH" \
CHOST="$MY_TARGET_CHOST" \
CBUILD="i686-pc-linux-gnu" \
CFLAGS="$MY_TARGET_CFLAGS" \
CXXFLAGS="$MY_TARGET_CFLAGS" \
INPUT_DEVICES="$MY_TARGET_INPUT_DEVICES" \
VIDEO_CARDS="$MY_TARGET_VIDEO_CARDS" \
USE="${MY_TARGET_USE}" \
CONFIG_PROTECT="-* ${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="/tmp/kernel" \
CROSS_COMPILE="${MY_TARGET_CHOST}-" \
ARCH="$MY_TARGET_KERNEL_ARCH" \
CHOST="$MY_TARGET_CHOST" \
CBUILD="i686-pc-linux-gnu" \
CFLAGS="$MY_TARGET_CFLAGS" \
CXXFLAGS="$MY_TARGET_CFLAGS" \
INPUT_DEVICES="$MY_TARGET_INPUT_DEVICES" \
VIDEO_CARDS="$MY_TARGET_VIDEO_CARDS" \
USE="${MY_TARGET_USE}" \
CONFIG_PROTECT="-* ${ROOT}/etc" \
make bzImage
cd /
echo "Creating rootfs"
ROOT="/tmp/target" \
ARCH="$MY_TARGET_ARCH" \
CHOST="$MY_TARGET_CHOST" \
CBUILD="i686-pc-linux-gnu" \
CFLAGS="$MY_TARGET_CFLAGS" \
CXXFLAGS="$MY_TARGET_CFLAGS" \
INPUT_DEVICES="$MY_TARGET_INPUT_DEVICES" \
VIDEO_CARDS="$MY_TARGET_VIDEO_CARDS" \
USE="${MY_TARGET_USE} make-symlinks" \
CONFIG_PROTECT="-* ${ROOT}/etc" \
emerge $PRET -v busybox
ROOT="/tmp/target" \
ARCH="$MY_TARGET_ARCH" \
CHOST="$MY_TARGET_CHOST" \
CBUILD="i686-pc-linux-gnu" \
CFLAGS="$MY_TARGET_CFLAGS" \
CXXFLAGS="$MY_TARGET_CFLAGS" \
INPUT_DEVICES="$MY_TARGET_INPUT_DEVICES" \
VIDEO_CARDS="$MY_TARGET_VIDEO_CARDS" \
USE="${MY_TARGET_USE}" \
CONFIG_PROTECT="-* ${ROOT}/etc" \
emerge $PRET -v baselayout-lite
ROOT="/tmp/target" \
ARCH="$MY_TARGET_ARCH" \
CHOST="$MY_TARGET_CHOST" \
CBUILD="i686-pc-linux-gnu" \
CFLAGS="$MY_TARGET_CFLAGS" \
CXXFLAGS="$MY_TARGET_CFLAGS" \
INPUT_DEVICES="$MY_TARGET_INPUT_DEVICES" \
VIDEO_CARDS="$MY_TARGET_VIDEO_CARDS" \
USE="${MY_TARGET_USE}" \
CONFIG_PROTECT="-* ${ROOT}/etc" \
emerge $PRET -v cross-${MY_TARGET_CHOST}/uclibc
cp /tmp/target/bin/busybox /bin/busybox
ROOT="/tmp/target" \
ARCH="$MY_TARGET_ARCH" \
CHOST="$MY_TARGET_CHOST" \
CBUILD="i686-pc-linux-gnu" \
CFLAGS="$MY_TARGET_CFLAGS" \
CXXFLAGS="$MY_TARGET_CFLAGS" \
INPUT_DEVICES="$MY_TARGET_INPUT_DEVICES" \
VIDEO_CARDS="$MY_TARGET_VIDEO_CARDS" \
USE="${MY_TARGET_USE} make-symlinks" \
CONFIG_PROTECT="-* ${ROOT}/etc" \
emerge $PRET -v busybox
ROOT="/tmp/target" \
ARCH="$MY_TARGET_ARCH" \
CHOST="$MY_TARGET_CHOST" \
CBUILD="i686-pc-linux-gnu" \
CFLAGS="$MY_TARGET_CFLAGS" \
CXXFLAGS="$MY_TARGET_CFLAGS" \
INPUT_DEVICES="$MY_TARGET_INPUT_DEVICES" \
VIDEO_CARDS="$MY_TARGET_VIDEO_CARDS" \
USE="${MY_TARGET_USE} make-symlinks" \
CONFIG_PROTECT="-* ${ROOT}/etc" \
emerge $PRET -v busybox
And this all works ok too. I can then use the built kernel and rootfs
and PXE boot it. The problem then comes when trying to emerge
xorg-server. I do the following:
ROOT="/tmp/target" \
ARCH="$MY_TARGET_ARCH" \
CHOST="$MY_TARGET_CHOST" \
CBUILD="i686-pc-linux-gnu" \
CFLAGS="$MY_TARGET_CFLAGS" \
CXXFLAGS="$MY_TARGET_CFLAGS" \
INPUT_DEVICES="$MY_TARGET_INPUT_DEVICES" \
VIDEO_CARDS="$MY_TARGET_VIDEO_CARDS" \
USE="${MY_TARGET_USE} cross -doc" \
CONFIG_PROTECT="-* ${ROOT}/etc" \
emerge $PRET -v xorg-server
and after emerging a few packages I get the error. Any help would be
greatly appreciates.
Thanks
Ryan
Wow, this is fantastic! Can I take alook?
--
[email protected] mailing list