Build a cross compiler for nommu architecture and the cross compiler should be able to generate excutables with ELF or bFLT file format.

OS: Ubuntu 7.10
Linux Kernel: 2.6.22-14-generic
buildroot version: latest svn version
Directory of cross toolchain: /usr/local/cross_compiler/arm/buildroot

1. Retrive the buildroot package

svn co svn://uclibc.org/trunk/buildroot  /* make sure that subversion is installed */

    Or, get the daily snapshot from http://buildroot.uclibc.org/downloads/snapshosts directly

2. Make buildroot Copy the configuration file 1_buildroot.config from this web site to the root directory of buildroot and rename the file to .config.

make menuconfig  /* verify/change the settings and save the configuration file */
make

    Notice: please modify the setting of "Build options -> Download dir" to the directory where to place the downloaded files, please modiry the setting of "Build options ->Toolchain and header file location" to the directory where cross compiler should be installed, here the "/tmp/buildroot" is the default setting.

3. Make uClibc and buildroot
    Copy the configuration file 2.1_uclibc.config from this web site to /buildroot/toolchain_build_arm_nofpu/uClibc-0.9.29 and rename the file to .config

cd /buildroot/toolchain_build_arm_nofpu/uClibc-0.9.29
make menuconfig /* verify/change the settings and save the configuration file */
copy ./.config ../../toolchain/uClibc/uClibc.config
cd ../.. /* move to the root directory of buildroot */

   Copy the configuration file 2.2_buildroot.config from this web site to the root directory of buildroot and rename the file to .config

make menuconfig  /* verify/change the settings and save the configuration file */
make

4. Set PATH environment to include the path of cross compiler

vi ~/.profile
PATH=/tmp/buildroot/bin:"${PATH}" /* add this line at the bottom of the file */

5. Verify cross compiler Use arm-linux-uclibc-elfhdr to confirm if the file format of built file is bFLT

arm-linux-uclibc-gcc -static -Wl,-elf2flt hello.c -ohello.flt
arm-linux-uclibc-flthdr hello.flt /* or */
file hello.flt

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 nix 的頭像
    nix

    nix

    nix 發表在 痞客邦 留言(0) 人氣()