Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Cygwin arm-elf-gcc can’t generate working Linux executable
PostPosted: Thu Mar 13, 2008 5:57 am 
Offline

Joined: Thu Mar 13, 2008 4:44 am
Posts: 1
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


Top
 Profile  
 
 Post subject: Re: Cygwin arm-elf-gcc can’t generate working Linux executable
PostPosted: Sat Jun 19, 2010 11:24 am 
Offline

Joined: Sat Jun 19, 2010 11:05 am
Posts: 3
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:
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron