LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Troubles running and compiling helloworld.c on AT91SAM9260 EVAL (https://www.linuxquestions.org/questions/programming-9/troubles-running-and-compiling-helloworld-c-on-at91sam9260-eval-740364/)

j.p.s 07-15-2009 05:31 PM

Troubles running and compiling helloworld.c on AT91SAM9260 EVAL
 
Can anyone that has successfully compiled and ran a helloworld.c for the mentioned target provide the correct compile options or anyone having some insight of suggestions on this.

I used several variations but settled on the following without errors but it did not run.
Quote:

“./arm-toolchain/bin/arm-elf-gcc -mthumb -mcpu=arm926ej-s -mfpu=fpa -g -o hello-arm test.c”
After putting onto the target I got:
Quote:

GESBC:/home# ./hello-arm

Illegal instruction

GESBC:/home#
My tool chain, that I built returns the following configuration:
Quote:

john@DEB1:~$ ./arm-toolchain/bin/arm-elf-gcc -v

Using built-in specs.

Target: arm-elf

Configured with: ../gcc-4.3.3/configure --target=arm-elf --prefix=/tmp/arm-toolchain --enable-interwork --enable-multilib --enable-languages=c,c++ --with-newlib --disable-shared --with-gnu-as --with-gnu-ld

Thread model: single

gcc version 4.3.3 (GCC)
Here are some other sundry info:
Quote:

john@DEB1:~$ uname -a

Linux DEB1 2.6.26-2-686 #1 SMP Sun Jun 21 04:57:38 UTC 2009 i686 GNU/Linux.

Tinkster 07-18-2009 08:12 PM

Moved: This thread is more suitable in <Programming> and has been moved accordingly to help your thread/question get the exposure it deserves.

j.p.s 07-29-2009 02:39 PM

dynamic vs Static Linking
 
Ok so here is an update. My target uses a debian file system and it has gcc. I can compile and run hello world. Checking the file type us
I get the following:
a.out: ELF 32-bit LSB executable, ARM, version 1 (ARM), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), for GNU/Linux 2.4.1, not st
ripped
Showing that it is dynamically linked. I used numerous scripts that creates a cross compiler on my desktop but after compiling all results are static and will not run on my target.

I have reviewed, read and tried various compile switches but no good results. In fact my impression is that it should be by default producing a dynamic linked file.

So now my question is does anyone have any suggestions or advice?

Additionally, there are several books that may help a gnu novice like myself. Would anyone care to recommend one? I am considering:
a) The Definitive Guide to GCC.
b) Using the Gnu Compiler Collection
c) any other that may be helpful


All times are GMT -5. The time now is 11:24 AM.