Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to build ARM Linux toolchain?

Status
Not open for further replies.
ARM Linux Toolchain

I just removed -thumb parameter and recompiled. it still does not work and gives "Segmentation Fault" message.

this is the code:
int main() {
int a;
for (a=0;a<5;a++) {
}
}

after compiling, executable file is 126KB

here, at the bottom of the page there is an example:
**broken link removed**

Code:
arm-elf-ld -Ttext 0 -e 0 -Map APPLICATION.MAP -o APPLICATION.ELF STARTUP.O PROGRAM.O


arm-elf-objcopy -O binary APPLICATION.ELF APPLICATION.BIN

do I need to use arm-elf-ld and arm-elf-objcopy ? what are they?
 

Re: ARM Linux Toolchain

You don't need them..gcc calls LD automatically..and objcopy is for extracting segments of your code for producing flat ROM images or Kernels...

Can you try my small compilation below?
Just chmod +x it and try (after unzipping ;o)...
 

Re: ARM Linux Toolchain

I am trying to understand what problems you are having, in linux if the binary (executable) is not in the bin/sbin directory then you will need to run as:

./hello_world rather than /hello_world.

I would be wary of file permissions using cygwin under FAT32, you would be much better using ntfs.

I never use the default startup or linker file, copy the defalt ones out of the gcc directory and modify to suit target board.
ld scripts: /arm-elf/lib/ldscripts

Regarding compiling I tend to just use gcc with a seperate compile/link stage, eg.

arm-elf-gcc -c PROGRAM.C -o PROGRAM.O
arm-elf-gcc -Wl,-Map APPLICATION.MAP -o APPLICATION.ELF STARTUP.O PROGRAM.O

using gcc to call ld will handle calling of the correct libs.

Regards
NTFreak
 

ARM Linux Toolchain

davorin,

your "Hello world..." code works man!

under Cygwin:
$ file main
main: ELF 32-bit LSB executable, ARM, version 1 (ARM), for GNU/Linux 2.0.0, dynamically linked (uses shared libs), not stripped


and I transferred it to target and it is working!

could you tell me how do you build this file?
probably my linker scripts or parameters wrong...

when I check my executable with file command, it says, it is statically linked....
 

Re: ARM Linux Toolchain

I just did on my Mac OSX machine:

Code:
arm-linux-gcc -o main main.c

My toolchain is compiled from scratch using "arm-linux" as target during "./configure"
 

ARM Linux Toolchain

I think there is something wrong with configuration of my tool chain.

I installed compiled toolchain from here:
https://www.gnuarm.com

I really need help to build/configure my correct toolchain.
 

Re: ARM Linux Toolchain

I'm gonna try same steps for configuring/compiling under cygwin/winxp and tell you later how it works there (o;

//added

Here's a description how to build the toolchain which makes sense for me (including Linux headers which you need anyway ;o):

**broken link removed**
 

Re: ARM Linux Toolchain

Hello,

I have ARM9 based ep9312. i am new to linux. I have windows2000 on my PC. I downloaded metrowerks code warrior studio ISA edition for developemt on ep9312 and i also intstalled it on PC. Now i don't have idea to start work. Can any one tell me how to start work using metrowerks code warrior studio ISA edition. The metrowerks codewarrior ide have the capability to run it on windows and make programms for embedded linux. Can any one tell me how to develope a link between EP9312 and my windows based PC while running metrowerks code warrior on my PC????

Regards

Bakhat
 

Re: ARM Linux Toolchain

GNU Toolchain for ARM Processors

CodeSourcery has been selected by ARM, Ltd. to develop improvements to the GNU Toolchain for ARM processors. CodeSourcery's releases of the GNU Toolchain support both ARM and Thumb mode compilation, and support all versions of the ARM Architecture in active use, including Version 6.

http://www.codesourcery.com/gnu_toolchains/arm.html
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top