Using buildroot with the Code Sourcery toolchain to produce a uClibc based file system for uclinux
Code Sourcery
uClibc
Uclinux for linux programmers
buildroot
Process
Take the following steps to produce a minimal, static linked, flat binary file system.
The process below was carried out using buildroot revision 20649
with the Code Sourcery toolchain
arm-uclinuxeabi-gcc (CodeSourcery Sourcery G++ Lite 2007q1-21) 4.2.0 20070413 (prerelease)
- svn co svn://uclibc.org/trunk/buildroot
- Unpack the Code Sourcery uclinuxeabi toolchain.
- Patch buildroot as per patch attached
Note that the patch contains a full busybox config file...
- Adjust for changes since my build....
- Setup the environment as in the attached script.
- Copy in the attached .config
- Adjust for your environment - at least
- Location of the CS toolset
- (?sudo?) make oldconfig
- (?sudo?) make PREFERRED_LIB_FLAGS="--enable-static --disable-shared" PMP_MY_REAL_CROSS_GCC=<The Code Sourcery cross compiler>
- Adjust for changes since my build....
You'll need to twiddle the startup scripts in the resulting file system for your platform.
Make, stderr and boot log attached
I've only booted - not checked every binary runs
Please report bugs to
mailto:peter.pearse@armNO-SPAM.com with Wiki [uClibc] in the subject
Retry with buildroot 20854
- package/fakeroot.mk and package/fakeroot-uclibc-LFS.patch are now patched in the buildroot tree.
- busybox has gone up to 1.9
- Move the patches up where necessary
transormer no longer required, others apply with offset.
- Kernel, GNU, Debian mirrors added - accepted defaults
Thumb-2
- Just add the gcc options as in the comment in the setup file.
TODO (not in order)
- Implement dynamic linking for flat binaries - I believe this needs both kernel and file system work....
- Add more packages
- Perfect the patch - still some generated files & binaries in it
- Actually run some of the binaries
Detailed explanation of (some of) the patches
- Stripping gave some problems so I turned it off throughout
- -Dfork=vfork worked in most packages, but I had to patch some headers to stop them failing e.g. busybox/libbb.h
- Some packages needed really hammering to build static libraries
- Maintainers - please don't use .so files as targets if your package can be built statically.....
- Of course, some package versions changed
- Some packages had to be apprised of the existence of uclinux (altho I haven't checked that they work with it!)
- ARM still hasn't caught up with syscall()
- Some packages initialize their flags
- I think it's nicer if the append to the environment values, rather than losing them.
--
PeterPearse - 13 Dec 2007