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, 
-- 
JID:      h...@jabber.org
Website:  http://marcin.juszkiewicz.com.pl/
LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz
#!/usr/bin/make

VER_LINUX=2.6.35
VER_GCC=4.4.4
VER_GCC_BASE=4.4
VER_EGLIBC=2.12
VER_BINUTILS=2.20.51
CROSS_ARCH=armel
CROSS_GNU_TYPE = $(shell dpkg-architecture -a${CROSS_ARCH} -qDEB_HOST_GNU_TYPE)
HOST_GNU_TYPE  = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

# taken from gcc packaging
define unpack_tarball
	@case $1 in \
	*.bz2)  tar -x --bzip2 -f $1;; \
	*.gz)   tar -x --gzip  -f $1;; \
	*.lzma) lzcat $1 | tar -x -f -;; \
	*.xz)   xzcat $1 | tar -x -f -;; \
	*)     false; \
	esac
endef

info:
	echo ${VER_BINUTILS}
	echo ${VER_GCC}
	echo ${VER_GCC_BASE}
	echo ${VER_EGLIBC}
	echo ${CROSS_ARCH}
	echo ${CROSS_GNU_TYPE}
	echo ${HOST_GNU_TYPE}

init_dirs:
	mkdir build-rootfs -p

stamp-init-linux:
	$(call unpack_tarball, /usr/src/linux/linux-source-${VER_LINUX}.tar.bz2)
	cp -a /usr/src/linux/debian linux-source-${VER_LINUX}/debian
	cp -a /usr/src/linux/debian.master linux-source-${VER_LINUX}/debian.master
	cd linux-source-${VER_LINUX} && \
	cp debian.master/changelog debian/ && \
	cp debian.master/control debian/
	touch stamp-init-linux

stamp-build-linux: stamp-init-linux
	set -e; \
	cd linux-source-${VER_LINUX} ;\
	DEB_STAGE=stage1 dpkg-buildpackage -b -uc -us -a${CROSS_ARCH}
	touch stamp-build-linux

stamp-install-linux: stamp-build-linux init_dirs
	dpkg-deb -x linux-libc-dev_2.6.35-9.14_armel.deb build-rootfs
	touch stamp-install-linux

stamp-init-binutils:
	$(call unpack_tarball, /usr/src/binutils/binutils-${VER_BINUTILS}.tar.xz)
	cd binutils-${VER_BINUTILS}* ;\
	cp -a /usr/src/binutils/debian/ . ;\
	echo ${CROSS_ARCH} > debian/target
	touch stamp-init-binutils

stamp-build-binutils: stamp-init-binutils
	set -e ;\
	cd binutils-${VER_BINUTILS}* ;\
	dpkg-buildpackage -b -uc -us -nc
	touch stamp-build-binutils

stamp-install-binutils: stamp-build-binutils init_dirs
	dpkg-deb -x binutils-$(CROSS_GNU_TYPE)_2.20.51.20100710-1ubuntu2_amd64.deb build-rootfs
	touch stamp-install-binutils

stamp-init-gcc:
	mkdir gcc -p ; \
	cd gcc ; \
	ln -sf /usr/src/gcc-4.4/gcc-${VER_GCC}.tar.xz gcc-${VER_GCC}.tar.xz ;\
	cp -a /usr/src/gcc-4.4/debian/ . ; \
	cp -a /usr/src/gcc-4.4/patches debian/ ; \
	echo ${CROSS_ARCH} >debian/target
	touch stamp-init-gcc

stamp-build-gcc1: stamp-init-gcc stamp-install-binutils
	export PATH=${PWD}/build-rootfs/usr/bin/:${PATH} ;\
	export LD_LIBRARY_PATH=${PWD}/build-rootfs/usr/$(HOST_GNU_TYPE)/arm-linux-gnueabi/lib/ ;\
	cd gcc && DEB_STAGE=stage1 dpkg-buildpackage -b -uc -us -d
	touch stamp-build-gcc1

stamp-install-gcc1: stamp-build-gcc1
	dpkg-deb -x gcc-4.4-arm-linux-gnueabi_4.4.4-8_amd64.deb build-rootfs
	dpkg-deb -x cpp-4.4-arm-linux-gnueabi_4.4.4-8_amd64.deb build-rootfs
	cd build-rootfs/usr/bin/ ; \
	ln -sf arm-linux-gnueabi-gcc-${VER_GCC_BASE} arm-linux-gnueabi-gcc ; \
	ln -sf arm-linux-gnueabi-cpp-${VER_GCC_BASE} arm-linux-gnueabi-cpp ; \
	ln -sf arm-linux-gnueabi-gcov-${VER_GCC_BASE} arm-linux-gnueabi-gcov
	touch stamp-install-gcc1

stamp-build-gcc2: stamp-init-gcc stamp-install-eglibc1
	export PATH=${PWD}/build-rootfs/usr/bin/:${PATH} ;\
	export LD_LIBRARY_PATH=${PWD}/build-rootfs/usr/$(HOST_GNU_TYPE)/arm-linux-gnueabi/lib/ ;\
	cd gcc && WITH_BUILD_SYSROOT=${PWD}/build-rootfs DEB_STAGE=stage2 dpkg-buildpackage -b -uc -us -d
	touch stamp-build-gcc2

stamp-install-gcc2: stamp-build-gcc2
	dpkg-deb -x gcc-4.4-arm-linux-gnueabi_4.4.4-8_amd64.deb build-rootfs
	dpkg-deb -x cpp-4.4-arm-linux-gnueabi_4.4.4-8_amd64.deb build-rootfs
	cd build-rootfs/usr/bin/ ; \
	ln -sf arm-linux-gnueabi-gcc-${VER_GCC_BASE} arm-linux-gnueabi-gcc ; \
	ln -sf arm-linux-gnueabi-cpp-${VER_GCC_BASE} arm-linux-gnueabi-cpp ; \
	ln -sf arm-linux-gnueabi-gcov-${VER_GCC_BASE} arm-linux-gnueabi-gcov
	touch stamp-install-gcc2

stamp-build-gcc3: stamp-init-gcc stamp-install-eglibc2
	export PATH=${PWD}/build-rootfs/usr/bin/:${PATH} ;\
	export LD_LIBRARY_PATH=${PWD}/build-rootfs/usr/$(HOST_GNU_TYPE)/arm-linux-gnueabi/lib/ ;\
	cd gcc && DEB_STAGE=stage3 WITH_BUILD_SYSROOT=${PWD}/build-rootfs dpkg-buildpackage -b -uc -us -d
	touch stamp-build-gcc3

stamp-install-gcc3: stamp-build-gcc3
	dpkg-deb -x gcc-4.4-arm-linux-gnueabi_4.4.4-8_amd64.deb build-rootfs
	dpkg-deb -x cpp-4.4-arm-linux-gnueabi_4.4.4-8_amd64.deb build-rootfs
	cd build-rootfs/usr/bin/ ; \
	ln -sf arm-linux-gnueabi-gcc-${VER_GCC_BASE} arm-linux-gnueabi-gcc ; \
	ln -sf arm-linux-gnueabi-cpp-${VER_GCC_BASE} arm-linux-gnueabi-cpp ; \
	ln -sf arm-linux-gnueabi-gcov-${VER_GCC_BASE} arm-linux-gnueabi-gcov
	touch stamp-install-gcc3

stamp-init-eglibc:
	$(call unpack_tarball, /usr/src/glibc/eglibc-${VER_EGLIBC}.tar.xz)
	cd eglibc-${VER_EGLIBC} ; \
	cp -a /usr/src/glibc/debian/ .
	touch stamp-init-eglibc

# eglibc-source needs whole debian/ dir
stamp-build-eglibc1: stamp-init-eglibc stamp-install-linux stamp-install-gcc1
	export PATH=${PWD}/build-rootfs/usr/bin/:${PATH} ;\
	export LD_LIBRARY_PATH=${PWD}/build-rootfs/usr/$(HOST_GNU_TYPE)/arm-linux-gnueabi/lib/ ;\
	cd eglibc-${VER_EGLIBC} ;\
	WITH_SYSROOT=${PWD}/build-rootfs DEB_STAGE=stage1 dpkg-buildpackage -b -uc -us -aarmel
	touch stamp-build-eglibc1

stamp-install-eglibc1: stamp-build-eglibc1
	dpkg-deb -x libc6-dev_2.12-0ubuntu5_armel.deb build-rootfs
	touch stamp-install-eglibc1

# eglibc-source needs whole debian/ dir
stamp-build-eglibc2: stamp-init-eglibc stamp-install-gcc2
	export PATH=${PWD}/build-rootfs/usr/bin/:${PATH} ;\
	export LD_LIBRARY_PATH=${PWD}/build-rootfs/usr/$(HOST_GNU_TYPE)/arm-linux-gnueabi/lib/ ;\
	export DEB_BUILD_OPTIONS="nocheck notest notests" ; \
	cd eglibc-${VER_EGLIBC} && WITH_SYSROOT=${PWD}/build-rootfs dpkg-buildpackage -b -uc -us -aarmel 
	touch stamp-build-eglibc2
	
stamp-install-eglibc2: stamp-build-eglibc2
	dpkg-deb -x libc6_2.12-0ubuntu5_armel.deb build-rootfs
	dpkg-deb -x libc6-dev_2.12-0ubuntu5_armel.deb build-rootfs
	dpkg-deb -x libc6-pic_2.12-0ubuntu5_armel.deb build-rootfs
	dpkg-deb -x libc6-prof_2.12-0ubuntu5_armel.deb build-rootfs
	# from eglibc1
	rm build-rootfs/lib/crt*.o
	rm build-rootfs/lib/libc.so
	touch stamp-install-eglibc2

all:	stamp-install-gcc3
=== modified file 'rules.d/build.mk'
--- rules.d/build.mk	2010-05-29 10:51:11 +0000
+++ rules.d/build.mk	2010-08-02 16:13:28 +0000
@@ -172,7 +172,7 @@
 	make -C $(CURDIR)/linuxthreads/man
 	touch $@
 
-$(stamp)source: $(stamp)patch
+$(stamp)source: unpatch
 	mkdir -p $(build-tree)
 	tar -c -J -C .. \
 		-f $(build-tree)/eglibc-$(EGLIBC_VERSION).tar.xz \

_______________________________________________
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-toolchain

Reply via email to