▷ O/S : CentOS 6.5 x86_64
▷ 타겟시스템 : ar71xx
▷ SDK 디렉토리 : /home/hasu0707/ar71xx/sdk
▷ 테스트 파일 : /home/hasu0707/test/hello.c
■ 필요한 라이브러리 설치
sudo yum -y install glibc.i686
sudo yum -y install libstdc++.i686
■ SDK를 다운로드
http://downloads.openwrt.org/
http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2
■ ~/.bash_profile 편집 (밑에 추가)
export STAGING_DIR=/home/hasu0707
export TOOLCHAIN_DIR=${STAGING_DIR}/toolchain
export PATH=$PATH:$HOME/bin:${TOOLCHAIN_DIR}/bin
export AR=${TOOLCHAIN_DIR}/bin/mipsel-openwrt-linux-uclibc-ar
export AS=${TOOLCHAIN_DIR}/bin/mipsel-openwrt-linux-uclibc-as
export LD=${TOOLCHAIN_DIR}/bin/mipsel-openwrt-linux-uclibc-ld
export NM=${TOOLCHAIN_DIR}/bin/mipsel-openwrt-linux-uclibc-nm
export CC=mipsel-openwrt-linux-uclibc-gcc
export CPP=mipsel-openwrt-linux-uclibc-cpp
export GCC=mipsel-openwrt-linux-uclibc-gcc
export CXX=mipsel-openwrt-linux-uclibc-g++
export RANLIB=mipsel-openwrt-linux-uclibc-ranlib
export LDFLAGS="-static"
export CFLAGS="-Os -s"
■ Makefile 편집
hello : hello.c
${CC} -o hello hello.c
■ 실행파일 확인
$ file hello
hello: ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked (uses shared libs), not stripped