I have been trying to build a native toolchain for the Wiz (not intended to run on the device, but rather in qemu). I'm currently trying to match version 10.02 of the GPH SDK, using the following components:
I started out by building a cross-compiling toolchain using crosstool. This required finding/modifying some patches, but I eventually got it to work.
I then used that toolchain to build a native toolchain (--build=i686-linux-gnu --host=arm-softfloat-linux-gnu --target=arm-softfloat-linux-gnu).
I then set up a Debian/Arm system in qemu and created a chroot environment in it, containing busybox and the toolchain I built.
Now when I try to link a trivial C program, I get the following error message:
If I follow the advice given in the error message, it works:
Some googling revealed that this could mean that the toolchain I've built does not know it is a native toolchain,
therefore making no assumptions on library locations... I have not found a way to fix this yet. One hint I found was to change the "specs" file, but my toolchain
has not installed any such file. Also "gcc -dumpspecs" says:
Any ideas on how to proceed?
- binutils-2.16.1
- glibc-2.3.6
- gcc-4.0.2
I started out by building a cross-compiling toolchain using crosstool. This required finding/modifying some patches, but I eventually got it to work.
I then used that toolchain to build a native toolchain (--build=i686-linux-gnu --host=arm-softfloat-linux-gnu --target=arm-softfloat-linux-gnu).
I then set up a Debian/Arm system in qemu and created a chroot environment in it, containing busybox and the toolchain I built.
Now when I try to link a trivial C program, I get the following error message:
Code:
debian-arm:~/wiz-native# chroot . /bin/ash
debian-arm:/# cd root/
debian-arm:/root# gcc -o foo foo.c
/usr/lib/gcc/arm-softfloat-linux-gnu/4.0.2/../../../../arm-softfloat-linux-gnu/bin/ld: warning: ld-linux.so.2, needed by /lib/libc.so.6, not found (try using -rpath or -rpath-link)
/lib/libc.so.6: undefined reference to `__libc_stack_end@GLIBC_2.1'
/lib/libc.so.6: undefined reference to `_r_debug@GLIBC_2.0'
/lib/libc.so.6: undefined reference to `_dl_argv@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_rtld_global_ro@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_out_of_memory@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_rtld_global@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `__libc_enable_secure@GLIBC_PRIVATE'
collect2: ld returned 1 exit status
If I follow the advice given in the error message, it works:
Code:
debian-arm:/root# gcc -o foo foo.c -Wl,-rpath=/lib
Some googling revealed that this could mean that the toolchain I've built does not know it is a native toolchain,
therefore making no assumptions on library locations... I have not found a way to fix this yet. One hint I found was to change the "specs" file, but my toolchain
has not installed any such file. Also "gcc -dumpspecs" says:
Code:
[...]
*cross_compile:
0
[...]
Any ideas on how to proceed?