|
RM 프로세서 용 툴체인은 rpm 버전으로 나와 있어서 MIPS에 비해 설치하기가 매우 쉽다.
rpm 파일은 HyBus 사이트(http://www.hybus.net/)나 emdebian 사이트(http://www.emdebian.org/)에서 구할 수 있다. 다음 설치 방법은 HyBus의 툴체인 설치 문서를 그대로 옮긴 것이다. ----------------------------------------------------------------------------- Cross Compiler Compiler 설명 Toolchain에 대한 각각의 설명입니다. * binutils-arm-2.9.5.0.37-1e3.i386.rpm The programs in this package are used to manipulate binary and object files that may have been created on the ARM architecturea. * gcc-arm-2.95.2-12e4.i386.rpm GNU C compiler, a fairly portable optimizing compiler which supports multiple languages. This package includes support for C, C++, and Objective C. * cpp-arm-2.95.2-12e4.i386.rpm The GNU C preprocessor is required by some utilities that use it for macro substitutions. This package has been separated from gcc for the benefit of those who require the preprocessor but not the compiler. * g++-arm-2.95.2-12e4.i386.rpm GNU C++ compiler, a fairly portable optimizing compiler for C++. * libc6-dev-arm-2.1.3-8e4.noarch.rpm Contains the symlinks, headers, and object files needed to compile and link programs which use the standard C library. * libstdc++2.10-arm-2.95.2-12e4.i386.rpm an additional runtime library for C++ programsbuilt with the GNU compiler. * libstdc++2.10-dev-arm-2.95.2-12e4.i386.rpm headers and static library files necessary for building C++ programs which use libstdc++ Compiler 설치 Hyper104는 Wow Linux에서만 Test 됨을 미리 말씀드립니다. (댑쏭 주 : 한컴 리눅스에서도 해봤는데 되더라) 다른 배포판을 사용할시 발생되는 문제는 회사로 연락을 주시면 해결해 드리도록 하겠습니다. 설치는 여러가지 방법이 있지만, 여기서는 rpm으로 제공된 것을 이용합니다. 아래와 같이 설치하면 됩니다. - 제공된 CD의 toolchain 디렉토리로 이동합니다. - 7개의 rpm을 설치합니다. [root$ hybus ]# rpm -i binutils-arm-2.9.5.0.37-1e3.i386.rpm [root$ hybus ]# rpm -i gcc-arm-2.95.2-12e4.i386.rpm [root$ hybus ]# rpm -i cpp-arm-2.95.2-12e4.i386.rpm [root$ hybus ]# rpm -i g++-arm-2.95.2-12e4.i386.rpm [root$ hybus ]# rpm -i libc6-dev-arm-2.1.3-8e4.noarch.rpm [root$ hybus ]# rpm -i libstdc++2.10-arm-2.95.2-12e4.i386.rpm [root$ hybus ]# rpm -i libstdc++2.10-dev-arm-2.95.2-12e4 위의 작업을 한번으로 설치를 하려면 아래와 같이 합니다. [root$ hybus ]# rpm --nodeps -i *.rpm 올바르게 설치 되었는지 아래와 같이 설치 된 위치를 확인 합니다. gcc, binutil binary /usr/bin/에 위치합니다. arm-linux- 로 시작하는 것들이 위에 해당하는 gcc, binutil 들입니다. standard C library /usr/arm-linux/include, /usr/arm-linux/lib에 위치합니다. gcc lib /usr/lib/gcc-lib/arm-linux/2.95.2에 위치합니다. 위 폴더에 해당 파일이 있으면 올바르게 설치 된 것입니다. Compile X86 계열에서 사용하는 리눅스의 gcc와 다른 점은 생성되는 코드가 ARM용으로 생성이 된다는 점입니다. 그렇기에 compile을 하는 과정이나, 옵션은 다른 문서를 참고하기 바랍니다. 여기서는 간단한 프로그램을 테스트를 합니다. 아래와 같이 간단한 프로그램을 작성하여 gcc와 arm-linux-gcc로 컴파일합니다. #include <stdio.h> int main() { printf(“Hello World”); } [root$ hybus]# gcc -o hello hello.c [root$ hybus]# arm-linux-gcc -o hello-arm hello.c file이란 명령어로 생성된 바이너리를 확인합니다. [root$ hybus]# file hello hello: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically linked (uses shared libs), not stripped [root$ hybus]# file hello-arm hello-arm: ELF 32-bit LSB executable, Advanced RISC Machines ARM, version 1, dynamically linked (uses shared libs), not stripped 생성된 바이너리(hello-arm)를 hyper 104로 다운로드 하여 실행하면 Hello World가 출력되는 것을 볼 수 있습니다. ----------------------------------------------------------------------------- 여기서 hyper 104는 HyBus의 제품인 embedded linux kit를 말한다. 이렇게 툴체인이 설치되면 일반 linux에서 프로그램을 개발할 때와 크게 다를 것이 없다. 다만 컴파일된 실행 파일을 embedded kit에 ftp 같은 파일 전송 프로그램을 사용하여 전송한 후 실행시킨다는 것이 다른데, 만일 라이브러리를 사용한다면 라이브러리도 툴체인을 사용하여 생성한 후 실행 파일 컴파일 중에 이 라이브러리를 사용하여 컴파일 해야 하며, 실행 시킬때도 실행 파일과 라이브러리 모두 kit로 옮겨 실행해야 한다. 그럼 이만. bye~ [출처] Embedded Linux(3) - 툴체인 설치 방법(ARM)|작성자 넘쿨
|
||||