As you probably know I am working on bootstrapping cross compiler. Process is described on https://wiki.linaro.org/CrossCompilers page.
Current status is: nearly done.
Done: - Linux/stage1 - patch (LP:603087) waits approval from kernel team. - GCC 4.5/stage[12] - patch (LP:603497) created
In progress: - eglibc/stage1 builds but needs packaging work
Problems: - gcc/stage3 (normal full build) fails on shlibs because I do not have libc6-armel packages installed in system but dpkg-shlibdeps needs them
How to bootstrap cross compiler?
- apt-get source gcc-4.5 eglibc binutils linux-image-2.6.35-8-generic - copy gcc-4.5 dir to gcc-stage1 gcc-stage2 gcc-stage3 - copy eglibc dir to eglibc-stage1 eglibc-stage2 - fetch and apply my patches from LP:603087 LP:603497 LP:603498
- create directory "sysroot/" and point WITH_SYSROOT and WITH_BUILD_SYSROOT enviroment variables to it
- cd binutils* && TARGET=armel dpkg-buildpackage -b -uc -us - cd sysroot && dpkg-deb -x ../binutils-arm*deb . - export PATH=$PWD/sysroot/usr/bin:$PATH - export LD_LIBRARY_PATH=$PWD/sysroot/usr/x86_64-linux*/usr/arm*/lib
- cd linux* && DEB_STAGE=stage1 dpkg-buildpackage -b -uc -us -aarmel - cd sysroot && dpkg-deb -x ../linux-libc-dev*deb .
- cd gcc-stage1 && DEB_STAGE=stage1 dpkg-buildpackage -b -uc -us - cd sysroot && dpkg-deb -x ../cpp*deb ../gcc*deb .
- cd eglibc-stage1 && DEB_STAGE=stage1 dpkg-buildpackage -b -uc -us -aarmel
As packaging is not yet done for that step manual copying of debian/tmp-libc/ contents to sysroot dir is needed.
- cd gcc-stage2 && DEB_STAGE=stage2 dpkg-buildpackage -b -uc -us - cd sysroot && dpkg-deb -x ../cpp*deb ../gcc*deb .
- cd eglibc-stage2 && dpkg-buildpackage -b -uc -us -aarmel - cd sysroot && dpkg-deb -x ../libc*deb .
- cd gcc-stage3 && dpkg-buildpackage -b -uc -us
Here dpkg-shlibdeps will complain so for that step manual copying of debian/tmp/ contents to sysroot dir is needed.
sysroot dir will then contain working cross compiler - so far I used it to compile hello.c and kernel for beagleboard
I did not tested yet building stage3 compiler with sysroot=/ like it should be for installing it on other systems. But thats future.
Regards,
Dnia piątek, 16 lipca 2010 o 16:59:46 Marcin Juszkiewicz napisał(a):
As you probably know I am working on bootstrapping cross compiler. Process is described on https://wiki.linaro.org/CrossCompilers page.
Current status is: nearly done.
I have 12 bugs to be merged but hope to solve it in next week.
If someone wants to bootstrap compiler then I have a new procedure.
1. You need to fetch few branches (select one gcc version):
lp:~hrw/binutils/pkg-ubuntu lp:~hrw/eglibc/eglibc-2.12-pkg http://github.com/hrw/debian-pkg-gcc-4.5 http://github.com/hrw/debian-pkg-gcc-4.4
2. Need patches for linux source package:
http://patchwork.ozlabs.org/patch/60732/ http://launchpadlibrarian.net/52688720/0001-linux-add-support-for-building- selected-stages-of-k.patch
3. Fetch current Ubuntu versions (select gcc-4.4 or gcc-4.5):
apt-get source -o APT::Get::Only-Source=1 linux gcc-4.4 eglibc binutils
4. Apply changes (from branches or patches for linux). This can be more time consuming.
5. Build "binary-indep" for each component to get -source binary packages. 6. Eglibc requires hack to get unpatched sources in -source package. Apply attached "eglibc-hack.patch" - should help. 7. Install all -source packages in your system. This will give their debian/ directories which will be re-used during bootstrap.
8. "make all" with attached Makefile
No warranty that it will work for you as I could forget something. If everything will go fine "build-rootfs" directory will contain cross compiler.
Regards,
linaro-toolchain@lists.linaro.org