用buildroot打造自己的Linux Toolchain

For quite a long time, building a cross toolchain from the scratch seems like a nightmare to most embedded software engineers. This used to require hanlding a lot of interdependent source packages as well as their patches carefully.

With the assist of buildroot, which is made available along with well-known uclibc, things used to be a mess can be well handled by just a few simple commands.

Below is my attempt to build an arm toolchain:

1) Download the latest buildroot snapshot from uclibc.org. Like all other packages offered by uclibc, it has a fantastic DAILY snapshot.

2) Unpack the buildroot snapshot package like this:
# tar -jxvf buildroot-200xxxxxx.tar.bz2

3) Configure the buildroot. This looks quite alike with configuring linux kernel features. For me, I just need an arm toolchain integrated with the lightweight uclibc instead of the heavy glibc. So, I just made some simple changes within the toolchain menu. Probably, buildroot can be used to build other embedded components like linux kernel, busybox, even tinyx.

# make menuconfig  

4) Execute the build command. This supposes to take quite a long while to do a batch of traffic jobs like downloading different source packages, applying patches, compling the source code and etc. Please find youself a favorite computer game to kill the time..

# make


5) Finally, if everything is all right, you will have your toolchain in the build_arm sub-folder. To make the toolchain work, probably you have to add the path that contains the executable files like arm-linux-gcc, arm-linux-g++ into your $PATH environment.

Enjoy it.
發佈了36 篇原創文章 · 獲贊 0 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章