Cygwin arm-elf-gcc can’t generate working Linux executable

All design tool related questions: compiler, assembler, linker. Embedded programming questions: assembler, C code.

Moderator: nferre

vapo
Posts: 1
Joined: Thu Mar 13, 2008 4:44 am

Cygwin arm-elf-gcc can’t generate working Linux executable

Thu Mar 13, 2008 5:57 am

I am running Linux 2.6.20.11 on AT91SAM9260-EK evaluation kit and I am trying to build “Hello world” program with armgcc pre-built compiler version 4.1.1.

arm-elf-gcc -mcpu=arm9 -o hello hello.c

When I run the executable on the evaluation board I get this error:

# ./hello
Illegal instruction

If I build the same program with the same arm-elf-gcc version compiler under Linux, all works fine.

Does anyone have an explanation why the Cygwin cross compiler can’t generate good executable? I tried various compiler options and cpu targets but I always get the same error.

Thanks and regards,
Vlad
Mamonetti
Posts: 3
Joined: Sat Jun 19, 2010 11:05 am

Re: Cygwin arm-elf-gcc can’t generate working Linux executable

Sat Jun 19, 2010 11:24 am

I'm having a similar but a bit different problem:

I'm testing an AT91SAM9G45-EKES board.
On my x86_64 machine i've compiled the gnu toolchain for cross compiling, and seems to work fine, because i've created working kernel modules, running fine in the board.

Now i'm trying to compile a simple program for reading data from a device, which basically uses fopen/fread/fclose functions.

Code: Select all

make read-device
/home/mamonetti/proyectos/atmelArm9/gnutoolchain/gnu-arm-installer/install/bin/arm-elf-gcc -mcpu=arm926ej-s -mfloat-abi=soft -o readDevice readDevice.o
/home/mamonetti/proyectos/atmelArm9/gnutoolchain/gnu-arm-installer/install/lib/gcc/arm-elf/4.3.2/arm-elf/bin/ld: ERROR: readDevice.o uses VFP instructions, whereas readDevice does not
/home/mamonetti/proyectos/atmelArm9/gnutoolchain/gnu-arm-installer/install/lib/gcc/arm-elf/4.3.2/arm-elf/bin/ld: failed to merge target specific data of file readDevice.o
collect2: ld devolvió el estado de salida 1
make: *** [read-device] Error 1
There is some problem related to fpu, which is really strange, considering i'm forcing it to use the soft one for both compiling and linking. If i try with -mfpu=fpa it compiles, but i get an "Illegal instruction" at runtime.

Any idea?

Regards

Return to “Development Tools”

Who is online

Users browsing this forum: No registered users and 2 guests