Re: Cross Compiler Build x86_64 Host arm1176jzf-s SOLVED script attached

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

This seems to work.

On Ubuntu:

1.  mount the RaspberryPi SD card image partition 2 on /mnt
    decide a better directory later
2.  Run the script
#!/bin/sh
##
## build the object file
arm-linux-gnueabihf-gcc-4.6 -c \
    -nostdlib -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -marm -Wl,-t  \
    hello.c -o helloc.o
##
## link
arm-linux-gnueabihf-gcc-4.6 -o helloc helloc.o \
    -nostdlib -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -marm -Wl,-t  \
    /mnt/usr/lib/arm-linux-gnueabihf/crt1.o \
    /mnt/usr/lib/arm-linux-gnueabihf/crti.o \
    /mnt/usr/lib/gcc/arm-linux-gnueabihf/4.6/crtbegin.o \
    /mnt/lib/arm-linux-gnueabihf/libgcc_s.so.1 \
    /mnt/lib/arm-linux-gnueabihf/libc.so.6 \
    /mnt/usr/lib/arm-linux-gnueabihf/libc_nonshared.a \
    /mnt/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 \
    /mnt/usr/lib/gcc/arm-linux-gnueabihf/4.6/crtend.o \
    /mnt/usr/lib/arm-linux-gnueabihf/crtn.o \
    /mnt/lib/arm-linux-gnueabihf/libm.so.6

This produces an image that will execute on the Raspberry Pi.

Tom Dean


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux