Applications compiled with EABI gcc receive SIGILL [was: Building a ARM EABI toolchain fails in ld-uClibc-0.9.28.so]
Nicolas Bellido
ml at acolin.be
Mon Feb 20 14:55:54 UTC 2006
On Friday 17 February 2006 23:16, Joseph S. Myers wrote:
> On Fri, 17 Feb 2006, Nicolas Bellido wrote:
> > I'm trying to make a uclibc toolchain for an ARM, with the EABI
> > interface. As such, I'm using a svn co of the csl-3_4_3-linux-branch
> > (from CodeSourcery) of gcc, the binutil-2.17pre comming from the
> > arm-2005q3-2 toolchain from CodeSourcery.
>
> That GCC branch rather presumes use within the CodeSourcery build system,
> and only actually supports uClibc for the arm-wrs-linux-gnueabi target
> (three -muclibc multilibs, three glibc multilibs). It doesn't have the
> arm-*-linux-uclibceabi target; only the latest trunk GCC and binutils, and
> GCC's branches/csl/sourcerygxx-4_1, do. (When building with trunk GCC I
> found that trunk GCC didn't build a working uClibc, but
> branches/csl/sourcerygxx-4_1 did; I didn't investigate further.)
>
I (finally) managed to build a toolchain with:
. binutils-20060218
. GCC, csl/sourcerygxx-4_1 branch, checked out on 20060218
. uClibc-20060218
. kernel 2.6.16-rc4
. target arm-linux-uclibceabi
I will post the script and the uClibc configuration I used as a reply to this
mail, if people are interested.
Next step was to try to run a statically linked helloworld.
Unfortunately, with no luck:
~ # ./hello
Illegal instruction
This is on a Versatile VPB, running linux 2.6.16-rc4, root fs based on glibc
2.3.4, built with csl gcc 2005q2.
A gdb session gave:
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu
--target=arm-none-linux-gnueabi".
(gdb) cd /opt/nfs/versatile/root/hello/
Working directory /opt/nfs/versatile/root/hello.
(gdb) file hello
Reading symbols from /opt/nfs/versatile/root/hello/hello...done.
(gdb) target remote 192.168.0.100:1234
Remote debugging using 192.168.0.100:1234
0x000080a0 in _start ()
(gdb) list
1 #include <stdio.h>
2
3 int main(int argc, char **argv) {
4 printf("Hello World....\n\n");
5
6 return 0;
7 }
8
(gdb) cont
Continuing.
Program received signal SIGILL, Illegal instruction.
0x00008fd8 in ioctl ()
(gdb) disassemble
Dump of assembler code for function ioctl:
0x00008fb4 <ioctl+0>: stmdb sp!, {r1, r2, r3}
0x00008fb8 <ioctl+4>: stmdb sp!, {r7, lr}
0x00008fbc <ioctl+8>: sub sp, sp, #12 ; 0xc
0x00008fc0 <ioctl+12>: add r3, sp, #28 ; 0x1c
0x00008fc4 <ioctl+16>: str r3, [sp, #4]
0x00008fc8 <ioctl+20>: ldr r2, [sp, #24]
0x00008fcc <ioctl+24>: ldr r1, [sp, #20]
0x00008fd0 <ioctl+28>: mov r7, #54 ; 0x36
0x00008fd4 <ioctl+32>: swi 0x00000000
0x00008fd8 <ioctl+36>: cmn r0, #4096 ; 0x1000
0x00008fdc <ioctl+40>: mov r7, r0
0x00008fe0 <ioctl+44>: bls 0x8ff4 <ioctl+64>
0x00008fe4 <ioctl+48>: bl 0x94e8 <__errno_location>
0x00008fe8 <ioctl+52>: rsb r3, r7, #0 ; 0x0
0x00008fec <ioctl+56>: str r3, [r0]
0x00008ff0 <ioctl+60>: mvn r7, #0 ; 0x0
0x00008ff4 <ioctl+64>: mov r0, r7
0x00008ff8 <ioctl+68>: add sp, sp, #12 ; 0xc
0x00008ffc <ioctl+72>: ldmia sp!, {r7, lr}
0x00009000 <ioctl+76>: add sp, sp, #12 ; 0xc
0x00009004 <ioctl+80>: bx lr
End of assembler dump.
(gdb)
So, apparently, uClibc generates correctly the new syscall ops, but then it
fails upon return of the swi.
Any ideas ?
Many thanks,
Nicolas.
More information about the uClibc
mailing list