리눅스

Arm Cross Compiler(arm toolchain)

불량껌 2009. 1. 30. 11:48

Arm Cross Compiler

 

arm Crosscomlile을 설치하기 위해 www.gnuarm.org에서

binutils-2.17 - 바이너리유틸, 어셈블러, 링커 그리고 라이브러리 관련 실행 파일들 모음

gcc-4.1.1 - 컴파일러

newlib-1.14 - glibc의 크기가 크기 때문에 꼭 필요한 것들만 추려놓은 것이다.

gdb-6.5 - 디버거

다운받음.

 

arm-tools폴더

arm-tools폴더 생성

#mkdir arm-tools

다운받은 파일들 이동

#mv *.tar.bz2 /arm-tools/

#mv *.tar.gz /arm-tools/

tar명령으로 압축해제

binutils-2.17 설치

#cd binutils-2.17

#./configure --target=arm-elf --prefix=/usr/local/arm-toolchain\

--enable-interwork --enable-multilib --with-float=soft

target은 arm-elf이고 실제 만들어지는 폴더는 /usr/local/arm-toolchain이다.

#make all install

#export PATH="$PATH:/usr/local/arm-toolchain/bin

 

 

gcc-4.1.1설치(1)

#cd gcc-4.1.1

#./configure --target=arm-elf --prefix=/usr/local/arm-toolchain \

--enable-interwork --enable-multilib --with-float=soft \

--enable-languages="c,c++" --with-newlib \

--with-headers=../newlib-1.14/newlib/libc/include

#make all-gcc install-gcc

마찬가지로 target은 arm-elf, 실제경로는 /usr/local/arm-toolchain, 사용할 언어는 c, c++, header경로설정은 ../newlib-1.14/newlib/libc/include

newlib-1.14설치

#cd newlib-1.14

#./configure --target=arm-elf --prefix=/usr/local/arm-toolchain \

--enable-interwork --enable-multilib --with-float=soft

#make all install

gcc-4.1.1설치(2)

#cd gcc-4.1.1

#make all install

gdb-6.5설치

#cd gdb-6.5

#./configure --target=arm-elf --prefix=/usr/local/arm-toolchain \

--enable-interwork --enable-multilib --with-float=soft

#make all install

 

 

 

 

 

 

 

 

설치후 경로추가

root폴더의 .bash_profile 폴더에 경로를 추가

#vi .bash_profile

PATH=/usr/local/arm-toolchain/bin:$PATH

TEST

root폴더에 test.c파일 생성

#touch test.c

#vi test.c

#arm-elf-gcc -o test test.c

#file test