X-Hyper255A

Toolchain Test

고을 2006. 8. 9. 11:09
Toolchain을 이용하여 compile 해보자. hyper 디렉토리 밑에 test 디렉토리를 만들어 테스트 하였다.
#mkdir /home/embed/xhyper/test
#cd /home/embed/xhyper/test
#vi hellow.c
#include <stdio.h>

int main()
{
   printf("hellow world");
   return 0;
}
#gcc -o hellow hellow.c
#arm-linux-gcc -o hellow-arm hellow.c
#file hellow
hellow: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped
#file hellow-arm
hellow-arm: ELF 32-bit LSB executable, ARM, version 1 (ARM), for GNU/Linux 2.0.0, dynamically linked (uses shared libs), not stripped
#./hellow-arm
bash: ./hellow-arm: cannot execute binary file
#./hellow
hellow world

만들어진 binary file을 확인하여 보면 서로 다른 것을 알 수 있다. 또한 파일을 실행시켜 보면 hellow-arm file은 실행이 안된다. 보드에 커널 부팅후 다운로드하여 실행하면 hellow world가 출력 될 것이다.
embeded board에 다운 로딩 하는 과정은 나중에 배우겠다.