hi people,
i have problems compiling the toolchain. here is what i do and what problems i encounter
my setup
* distro MiniMe2008 (a minimal PcLinuxOs)
* make (GNU Make 3.81)
* gcc (gcc (GCC) 4.1.1 20060724 (prerelease) (4.1.1-4pclos2007))
* ld 4.1.1 ( GNU ld version 2.16.91.0.7 20060317 )
* bash (GNU bash, version 3.1.17(1)-release (i586-mandriva-linux-gnu))
this is reported during the build
Code:
Checking build system dependencies:
CC clean: Ok
CXX clean: Ok
CPP clean: Ok
CFLAGS clean: Ok
CXXFLAGS clean: Ok
sed works: Ok
which installed: Ok
GNU make version '3.81': Ok
C compiler '/usr/bin/gcc'
C compiler version '4.1.1': Ok
bison installed: Ok
flex installed: Ok
gettext installed: Ok
Build system dependencies: Ok
I try to cross-compile the toolchain for OPTWARE_TARGET=oleg
Code:
mkdir -p /opt/slug
cd /opt/slug
svn co http://svn.nslu2-linux.org/svnroot/optware/trunk optware
cd optware
make oleg-target
cd oleg
make directories
make ipkg-utils
make toolchain
when making oleg-target i see the following message printed to standard out
Code:
make: /opt/slug/optware/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/bin/armv5b-softfloat-linux-gcc: Command not found
this may not be a problem as everything else goes well and i can proceed with making directories and ipkg-utils without problems. when I make this two targets i get a similar warning from make, but this time for the mipsel gcc version
Code:
make: /opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-gcc: Command not found
the printed path is constructed in the root Makefile
Code:
TARGET_CC=$(TARGET_CROSS)gcc
TARGET_CROSS is defined in make/toolchain-oleg.mk
Code:
TARGET_CROSS = $(TOOL_BUILD_DIR)/$(TARGET_ARCH)-$(TARGET_OS)/$(CROSS_CONFIGURATION)/bin/$(TARGET_ARCH)-$(TARGET_OS)-
when building a target, all makefiles in the make directory are included in the root Makefile and one of them seems to use TARGET_CC variable even it is not used to build the corresponding package and complains about the non-existence of the directory and binary.
ok, this is not a problem now but just polutes the log output a bit. the first serious problem occurs when making the toolchain. while building, the kernel headers for the oleg-kernel are downloaded from the wrong location http://www.uclibc.org/downloads/toolchain/
Code:
wget --passive-ftp -nd -P /opt/slug/optware/oleg/toolchain/buildroot/dl http://www.uclibc.org/downloads/toolchain/linux-libc-headers-oleg.tar.bz2
--2008-06-02 17:37:49-- http://www.uclibc.org/downloads/toolchain/linux-libc-headers-oleg.tar.bz2
Resolving www.uclibc.org... 140.211.166.42
Connecting to www.uclibc.org|140.211.166.42|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
i temporary work around this by inserting the following line in the kernel-headers.mk file which is located in oleg/toolchain/buildroot/toolchain/kernel-headers/
Code:
include toolchain/kernel-headers/kernel-headers-new.makefile
include toolchain/kernel-headers/kernel-headers-old.makefile
# the correct download location
LINUX_HEADERS_SITE=http://www.wlan-sat.com/boleo/optware
i specified the server where the oleg-headers can be found . now i can proceed with right(?) headers
Code:
...
wget --passive-ftp -nd -P /opt/slug/optware/oleg/toolchain/buildroot/dl http://www.wlan-sat.com/boleo/optware/linux-libc-headers-oleg.tar.bz2
--2008-06-02 17:47:51-- http://www.wlan-sat.com/boleo/optware/linux-libc-headers-oleg.tar.bz2
Resolving www.wlan-sat.com... 212.18.63.81
Connecting to www.wlan-sat.com|212.18.63.81|:80... connected.
...
but in the next step, the patching of uclibc fails
Code:
...
wget --passive-ftp -nd -P /opt/slug/optware/oleg/toolchain/buildroot/dl http://www.uclibc.org/downloads/snapshots/uClibc-snapshot.tar.bz2
--2008-06-02 17:48:21-- http://www.uclibc.org/downloads/snapshots/uClibc-snapshot.tar.bz2
Resolving www.uclibc.org... 140.211.166.42
Connecting to www.uclibc.org|140.211.166.42|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3534786 (3.4M) [application/x-tar]
Saving to: `/opt/slug/optware/oleg/toolchain/buildroot/dl/uClibc-snapshot.tar.bz2'
100%[=======================================================================================================================================>] 3,534,786 11.0K/s in 6m 20s
2008-06-02 17:54:42 (9.09 KB/s) - `/opt/slug/optware/oleg/toolchain/buildroot/dl/uClibc-snapshot.tar.bz2' saved [3534786/3534786]
mkdir -p /opt/slug/optware/oleg/toolchain/buildroot/toolchain_build_mipsel
bzcat /opt/slug/optware/oleg/toolchain/buildroot/dl/uClibc-snapshot.tar.bz2 | tar -C /opt/slug/optware/oleg/toolchain/buildroot/toolchain_build_mipsel -xf -
toolchain/patch-kernel.sh /opt/slug/optware/oleg/toolchain/buildroot/toolchain_build_mipsel/uClibc toolchain/uClibc/ uClibc-0.9.29\*.patch
cat ../../sources/buildroot/uClibc-patches/*.patch | patch -d /opt/slug/optware/oleg/toolchain/buildroot/toolchain_build_mipsel/uClibc -p1
patching file Makefile
Hunk #1 FAILED at 163.
1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej
patching file libc/sysdeps/linux/mips/sigaction.c
Hunk #1 FAILED at 49.
1 out of 1 hunk FAILED -- saving rejects to file libc/sysdeps/linux/mips/sigaction.c.rej
patching file libc/sysdeps/linux/mips/pipe.S
Hunk #1 FAILED at 10.
...
this comes due to the fact that the latest snapshot version of uclibc gets downloded. the snapshot seems to be version 0.9.29(?) but the patches are for version 0.9.28. while configuring the kernel, there was no possibility to select another uclibc version as the snapshot was pre-selected.
Code:
uClibc C library Version
1. uClibc 0.9.28 (BR2_UCLIBC_VERSION_0_9_28)
> 2. daily snapshot (BR2_UCLIBC_VERSION_SNAPSHOT)
choice[1-2?]: 2
Date (yyyymmdd) of snapshot or 'snapshot' for latest (BR2_USE_UCLIBC_SNAPSHOT) [snapshot] (NEW)
i also worked around that problem by inserting the following line in buildroot.mk which is located in oleg/make/
Code:
247 ...
247 # change uclibc version from snapshot to 0.9.28
248 sed -i -e 's|^# BR2_UCLIBC_VERSION_0_9_28 is not set|BR2_UCLIBC_VERSION_0_9_28=y|' $(BUILDROOT_BUILD_DIR)/.config
249 sed -i -e 's|^BR2_UCLIBC_VERSION_SNAPSHOT=.*|# BR2_UCLIBC_VERSION_SNAPSHOT is not set|' $(BUILDROOT_BUILD_DIR)/.config
250 #endif
251 # change toolchain staging dir
now uclibc 0.9.28 is used and the build comes pretty far until uclibc++ has to be build. this fails with the following errors
Code:
...
make -C abi/libgcc_eh all
make[3]: /opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-gcc: Command not found
make[3]: Entering directory `/opt/slug/optware/oleg/builds/libuclibc++/src/abi/libgcc_eh'
/bin/sh: /opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-gcc: No such file or directory
/bin/sh: /opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-ld: No such file or directory
/bin/sh: /opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-gcc: No such file or directory
../../../scripts/find_libgcc_eh.sh: line 8: /opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-gcc: No such file or directory
/opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-ar x
make[3]: /opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-ar: Command not found
make[3]: *** [unwind-c.o] Error 127
make[3]: Leaving directory `/opt/slug/optware/oleg/builds/libuclibc++/src/abi/libgcc_eh'
make[2]: *** [libgcc_eh] Error 2
make[2]: Leaving directory `/opt/slug/optware/oleg/builds/libuclibc++/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/opt/slug/optware/oleg/builds/libuclibc++'
now one can see that the non existence of the path defined in TARGET_CC causes serious build failures. all the binaries like gcc, ld and ar were build along uclibc but just exist in the staging dir of uclibc
Code:
$ cd /opt/slug/optware/oleg/toolchain/buildroot/build_mipsel/staging_dir/mipsel-linux-uclibc/bin
$ la
> ./ ../ ar* as* cc@ gcc* ld* nm* objdump* ranlib* strip*
now i give up at this point as i have no idea why all this errors occur. maybe some of u people can help me further in getting the toolchain to compile as i would like to add some packages for the asus wl550g router.
txs in advance and sorry for the long post.
peace olo