On 02/26/13 06:06, Mihai Moldovan wrote:
* On 26.02.2013 05:55 AM, Thomas D. Dean wrote:
[...]
arm-linux-gnueabihf-gcc-4.6 -mcpu=arm1176jzf-s hello.c -o helloc -lm
hello.c: In function 'main':
hello.c:9:1: sorry, unimplemented: Thumb-1 hard-float VFP ABI
So, the ubuntu compiler does not like -mcpu=arm1176jzf-s.
My point was to add -mfpu=vfp -mfloat-abi=hard.
Also, according to http://www.raspberrypi.org/phpBB3/viewtopic.php?f=33&t=8758
(simple Google Search with the "unimplemented" message...) suggests to also try
-marm, so that GCC is not trying to generate Thumb code.
Best regards,
Mihai
I tried all combinations of the 3 args you suggested. Adding -marm
allowed the compile to finish without error. I missed that in the
phpBB3 post.
The executable built on unbuntu gives a segment fault when started on
RaspberryPi. I tried -static, same result.
I have the ubuntu work directory mounted on RaspberryPi, as p9x79
On ubuntu:
> arm-linux-gnueabihf-gcc-4.6 -mcpu=arm1176jzf-s -mfpu=vfp
-mfloat-abi=hard -marm -Wl,-t hello.c -o helloc -lm
/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux-gnueabihf/bin/ld:
mode armelf_linux_eabi
/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux-gnueabihf/lib/../lib/crt1.o
/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux-gnueabihf/lib/../lib/crti.o
/usr/lib/gcc/arm-linux-gnueabihf/4.6/crtbegin.o
/tmp//ccTx9oBt.o
-lm
(/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux-gnueabihf/lib/../lib/libm.so)
libgcc_s.so.1 (/usr/lib/gcc/arm-linux-gnueabihf/4.6/libgcc_s.so.1)
/usr/arm-linux-gnueabihf/lib/libc.so.6
(/usr/arm-linux-gnueabihf/lib/libc_nonshared.a)elf-init.oS
/usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3
libgcc_s.so.1 (/usr/lib/gcc/arm-linux-gnueabihf/4.6/libgcc_s.so.1)
/usr/lib/gcc/arm-linux-gnueabihf/4.6/crtend.o
/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux-gnueabihf/lib/../lib/crtn.o
On RaspberryPI,
tomdean@raspberrypi:/arm-linux-gnueabihf-gcc-4.6 -mcpu=arm1176jzf-s
-mfpu=vfp -mfloat-abi=hard -marm -Wl,-t ../p9x79/work/hello.c -o helloc -lm
usr/bin/ld: mode armelf_linux_eabi
/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crt1.o
/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crti.o
/usr/lib/gcc/arm-linux-gnueabihf/4.6/crtbegin.o
/tmp/ccjF50gc.o
-lm
(/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/libm.so)
libgcc_s.so.1 (/usr/lib/gcc/arm-linux-gnueabihf/4.6/libgcc_s.so.1)
/lib/arm-linux-gnueabihf/libc.so.6
(/usr/lib/arm-linux-gnueabihf/libc_nonshared.a)elf-init.oS
/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3
libgcc_s.so.1 (/usr/lib/gcc/arm-linux-gnueabihf/4.6/libgcc_s.so.1)
/usr/lib/gcc/arm-linux-gnueabihf/4.6/crtend.o
/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crtn.o
All the lib versions are the same.
tomdean@raspberrypi:~/work$ ldd -v helloc
/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0x4019f000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x400ef000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x401a9000)
/lib/ld-linux-armhf.so.3 (0x4004b000)
Version information:
./helloc:
libm.so.6 (GLIBC_2.4) => /lib/arm-linux-gnueabihf/libm.so.6
libc.so.6 (GLIBC_2.4) => /lib/arm-linux-gnueabihf/libc.so.6
/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so:
libc.so.6 (GLIBC_2.4) => /lib/arm-linux-gnueabihf/libc.so.6
/lib/arm-linux-gnueabihf/libm.so.6:
ld-linux-armhf.so.3 (GLIBC_PRIVATE) => /lib/ld-linux-armhf.so.3
libc.so.6 (GLIBC_2.4) => /lib/arm-linux-gnueabihf/libc.so.6
/lib/arm-linux-gnueabihf/libc.so.6:
ld-linux-armhf.so.3 (GLIBC_2.4) => /lib/ld-linux-armhf.so.3
ld-linux-armhf.so.3 (GLIBC_PRIVATE) => /lib/ld-linux-armhf.so.3
tomdean@raspberrypi:~/work$ ldd -v ../p9x79/work/helloc
/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0x40226000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x401af000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x40230000)
/lib/ld-linux-armhf.so.3 (0x400ac000)
Version information:
../p9x79/work/helloc:
libm.so.6 (GLIBC_2.4) => /lib/arm-linux-gnueabihf/libm.so.6
libc.so.6 (GLIBC_2.4) => /lib/arm-linux-gnueabihf/libc.so.6
/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so:
libc.so.6 (GLIBC_2.4) => /lib/arm-linux-gnueabihf/libc.so.6
/lib/arm-linux-gnueabihf/libm.so.6:
ld-linux-armhf.so.3 (GLIBC_PRIVATE) => /lib/ld-linux-armhf.so.3
libc.so.6 (GLIBC_2.4) => /lib/arm-linux-gnueabihf/libc.so.6
/lib/arm-linux-gnueabihf/libc.so.6:
ld-linux-armhf.so.3 (GLIBC_2.4) => /lib/ld-linux-armhf.so.3
ld-linux-armhf.so.3 (GLIBC_PRIVATE) => /lib/ld-linux-armhf.so.3
Using gdb (I recompiled with -g)
tomdean@raspberrypi:~/work$ gdb ../p9x79/work/helloc
...
(gdb) b main
Breakpoint 1 at 0x8480: file hello.c, line 11.
(gdb) r
Starting program: /home/tomdean/p9x79/work/helloc
Program received signal SIGSEGV, Segmentation fault.
0x000574ba in ?? ()
(gdb) bt
#0 0x000574ba in ?? ()
#1 0x00008402 in _start ()
Maybe I need the crtxxx files from RaspberryPi on ubuntu?
Tom Dean