From 851a4f23e142cad97bd94f0f8e80ce6c35607445 Mon Sep 17 00:00:00 2001 From: Jose V Beneyto Date: Tue, 11 Oct 2011 14:38:41 +0200 Subject: [PATCH] Imported files from default toolchain (no hardfp) before commiting hardfp patches and stuff --- Makefile | 298 ++++++++++++++++++++++++++++++++++++ README | 5 + vars.mk | 21 +++ work/glibc-2.12.1-pot.patch | 15 ++ work/test.c | 12 ++ 5 files changed, 351 insertions(+) create mode 100644 Makefile create mode 100644 vars.mk create mode 100644 work/glibc-2.12.1-pot.patch create mode 100644 work/test.c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1a17dd5 --- /dev/null +++ b/Makefile @@ -0,0 +1,298 @@ +# +# Makefile +# + +include vars.mk + +.PHONY: all clean distclean + +all: linux-headers libgmp libmpfr libmpc binutils gcc-static glibc gcc-final setup test + +clean: linux-headers-clean libgmp-clean libmpfr-clean libmpc-clean binutils-clean gcc-static-clean glibc-clean gcc-final-clean test-clean + +distclean: clean linux-headers-distclean libgmp-distclean libmpfr-distclean libmpc-distclean binutils-distclean gcc-static-distclean glibc-distclean gcc-final-distclean test-distclean + + +# LINUX HEADERS +$(WORK)/linux-$(KERNEL_HEADERS_VERSION).tar.bz2: + wget -P $(WORK) -c ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$(KERNEL_HEADERS_VERSION).tar.bz2 + +$(WORK)/linux-$(KERNEL_HEADERS_VERSION): $(WORK)/linux-$(KERNEL_HEADERS_VERSION).tar.bz2 + tar -C $(WORK) -xvjf $(WORK)/linux-$(KERNEL_HEADERS_VERSION).tar.bz2 + touch $(WORK)/linux-$(KERNEL_HEADERS_VERSION) + +$(CLFS)/usr/include/asm: $(WORK)/linux-$(KERNEL_HEADERS_VERSION) + mkdir -p $(CLFS)/usr/include + cd $(WORK)/linux-$(KERNEL_HEADERS_VERSION) && \ + make mrproper && \ + make ARCH=arm headers_check && \ + make ARCH=arm INSTALL_HDR_PATH=$(CLFS)/usr headers_install + touch $(CLFS)/usr/include/asm + +linux-headers: $(CLFS)/usr/include/asm + +linux-headers-clean: + rm -vrf $(WORK)/linux-$(KERNEL_HEADERS_VERSION) + +linux-headers-distclean: linux-headers-clean + rm -vf $(WORK)/linux-$(KERNEL_HEADERS_VERSION).tar.bz2 + + +# LIBGMP +$(WORK)/gmp-$(LIBGMP_VERSION).tar.bz2: + wget -P $(WORK) -c ftp://ftp.gnu.org/gnu/gmp/gmp-$(LIBGMP_VERSION).tar.bz2 + +$(WORK)/gmp-$(LIBGMP_VERSION): $(WORK)/gmp-$(LIBGMP_VERSION).tar.bz2 + tar -C $(WORK) -xvjf $(WORK)/gmp-$(LIBGMP_VERSION).tar.bz2 + touch $(WORK)/gmp-$(LIBGMP_VERSION) + +$(WORK)/build-libgmp: $(WORK)/gmp-$(LIBGMP_VERSION) + mkdir -p $(WORK)/build-libgmp + touch $(WORK)/build-libgmp + +$(CROSSTOOLS)/lib/libgmp.so: $(WORK)/build-libgmp + cd $(WORK)/build-libgmp && \ + unset CFLAGS && unset CXXFLAGS && \ + CPPFLAGS=-fexceptions \ + $(WORK)/gmp-$(LIBGMP_VERSION)/configure --prefix=$(CROSSTOOLS) --enable-cxx && \ + make && make install || exit 1 + touch $(CROSSTOOLS)/lib/libgmp.so + +libgmp: $(CROSSTOOLS)/lib/libgmp.so + +libgmp-clean: + rm -vrf $(WORK)/build-libgmp $(WORK)/gmp-$(LIBGMP_VERSION) + +libgmp-distclean: libgmp-clean + rm -vrf $(WORK)/gmp-$(LIBGMP_VERSION).tar.bz2 + + +# LIBMPFR +$(WORK)/mpfr-$(LIBMPFR_VERSION).tar.bz2: + wget -P $(WORK) -c http://ftp.gnu.org/gnu/mpfr/mpfr-$(LIBMPFR_VERSION).tar.bz2 + +$(WORK)/mpfr-$(LIBMPFR_VERSION): $(WORK)/mpfr-$(LIBMPFR_VERSION).tar.bz2 + tar -C $(WORK) -xvjf $(WORK)/mpfr-$(LIBMPFR_VERSION).tar.bz2 + touch $(WORK)/mpfr-$(LIBMPFR_VERSION) + +$(WORK)/build-libmpfr: $(WORK)/mpfr-$(LIBMPFR_VERSION) + mkdir -p $(WORK)/build-libmpfr + touch $(WORK)/build-libmpfr + +$(CROSSTOOLS)/lib/libmpfr.so: $(WORK)/build-libmpfr + cd $(WORK)/build-libmpfr && \ + unset CFLAGS && unset CXXFLAGS && \ + LDFLAGS="-Wl,-rpath,$(CROSSTOOLS)/lib" && \ + $(WORK)/mpfr-$(LIBMPFR_VERSION)/configure --prefix=$(CROSSTOOLS) --enable-shared --with-gmp=$(CROSSTOOLS) && \ + make && make install || exit 1 + touch $(CROSSTOOLS)/lib/libmpfr.so + +libmpfr: $(CROSSTOOLS)/lib/libmpfr.so + +libmpfr-clean: + rm -vrf $(WORK)/build-libmpfr $(WORK)/mpfr-$(LIBMPFR_VERSION) + +libmpfr-distclean: libmpfr-clean + rm -vrf $(WORK)/mpfr-$(LIBMPFR_VERSION).tar.bz2 + + +# LIBMPC +$(WORK)/mpc-$(LIBMPC_VERSION).tar.gz: + wget -P $(WORK) -c http://www.multiprecision.org/mpc/download/mpc-$(LIBMPC_VERSION).tar.gz + +$(WORK)/mpc-$(LIBMPC_VERSION): $(WORK)/mpc-$(LIBMPC_VERSION).tar.gz + tar -C $(WORK) -xvzf $(WORK)/mpc-$(LIBMPC_VERSION).tar.gz + touch $(WORK)/mpc-$(LIBMPC_VERSION) + +$(WORK)/build-libmpc: $(WORK)/mpc-$(LIBMPC_VERSION) + mkdir -p $(WORK)/build-libmpc + touch $(WORK)/build-libmpc + +$(CROSSTOOLS)/lib/libmpc.so: $(WORK)/build-libmpc + cd $(WORK)/build-libmpc && \ + unset CFLAGS && unset CXXFLAGS && \ + LDFLAGS="-Wl,-rpath,$(CROSSTOOLS)/lib" && \ + $(WORK)/mpc-$(LIBMPC_VERSION)/configure --prefix=$(CROSSTOOLS) \ + --enable-shared --with-gmp=$(CROSSTOOLS) --with-mpfr=$(CROSSTOOLS) && \ + make && make install || exit 1 + touch $(CROSSTOOLS)/lib/libmpc.so + +libmpc: $(CROSSTOOLS)/lib/libmpc.so + +libmpc-clean: + rm -vrf $(WORK)/build-libmpc $(WORK)/mpc-$(LIBMPC_VERSION) + +libmpc-distclean: libmpc-clean + rm -vrf $(WORK)/mpc-$(LIBMPC_VERSION).tar.bz2 + + +# BINUTILS +$(WORK)/binutils-$(BINUTILS_VERSION).tar.bz2: + wget -P $(WORK) -c ftp://ftp.gnu.org/gnu/binutils/binutils-$(BINUTILS_VERSION).tar.bz2 + +$(WORK)/binutils-$(BINUTILS_VERSION): $(WORK)/binutils-$(BINUTILS_VERSION).tar.bz2 + tar -C $(WORK) -xvjf $(WORK)/binutils-$(BINUTILS_VERSION).tar.bz2 + sed -i '/^SUBDIRS/s/doc//' $(WORK)/binutils-$(BINUTILS_VERSION)/*/Makefile.in + touch $(WORK)/binutils-$(BINUTILS_VERSION) + +$(WORK)/build-binutils: $(WORK)/binutils-$(BINUTILS_VERSION) + mkdir -p $(WORK)/build-binutils + touch $(WORK)/build-binutils-build + +$(CLFS)/usr/include/libiberty.h: $(WORK)/build-binutils + cd $(WORK)/build-binutils && \ + unset CFLAGS && unset CXXFLAGS && \ + AR=ar AS=as \ + $(WORK)/binutils-$(BINUTILS_VERSION)/configure --prefix=$(CROSSTOOLS) \ + --host=$(HOST) --target=$(TARGET) --with-sysroot=$(CLFS) \ + --disable-nls --enable-shared --disable-multilib --nfp && \ + make configure-host && make && make install || exit 1 + cp -va $(WORK)/binutils-$(BINUTILS_VERSION)/include/libiberty.h $(CLFS)/usr/include + touch $(CLFS)/usr/include/libiberty.h + +binutils: linux-headers $(CLFS)/usr/include/libiberty.h + +binutils-clean: + rm -vrf $(WORK)/build-binutils $(WORK)/binutils-$(BINUTILS_VERSION) + +binutils-distclean: binutils-clean + rm -f $(WORK)/binutils-$(BINUTILS_VERSION).tar.bz2 + + +# GCC-STATIC +$(WORK)/gcc-$(GCC_VERSION).tar.bz2: + wget -P $(WORK) -c ftp://sources.redhat.com/pub/gcc/releases/gcc-$(GCC_VERSION)/gcc-$(GCC_VERSION).tar.bz2 + +$(WORK)/gcc-$(GCC_VERSION): $(WORK)/gcc-$(GCC_VERSION).tar.bz2 + tar -C $(WORK) -xvjf $(WORK)/gcc-$(GCC_VERSION).tar.bz2 + touch $(WORK)/gcc-$(GCC_VERSION) + +$(WORK)/build-gcc-static: $(WORK)/gcc-$(GCC_VERSION) + mkdir -p $(WORK)/build-gcc-static + touch $(WORK)/build-gcc-static + +$(CROSSTOOLS)/lib/gcc: $(WORK)/build-gcc-static $(WORK)/gcc-$(GCC_VERSION) + cd $(WORK)/build-gcc-static && \ + unset CFLAGS && unset CXXFLAGS && \ + AR=ar LDFLAGS="-Wl,-rpath,$(CROSSTOOLS)/lib" \ + $(WORK)/gcc-$(GCC_VERSION)/configure --prefix=$(CROSSTOOLS) \ + --build=$(HOST) --host=$(HOST) --target=$(TARGET) \ + --disable-multilib --disable-nls \ + --without-headers --enable-__cxa_atexit --enable-symvers=gnu --disable-decimal-float \ + --nfp --without-fp --with-softfloat-support=internal \ + --disable-libgomp --disable-libmudflap --disable-libssp \ + --with-mpfr=$(CROSSTOOLS) --with-gmp=$(CROSSTOOLS) --with-mpc=$(CROSSTOOLS) \ + --disable-shared --disable-threads --enable-languages=c && \ + make && make install || exit 1 + touch $(CROSSTOOLS)/lib/gcc + +gcc-static: linux-headers libgmp libmpfr binutils $(CROSSTOOLS)/lib/gcc + +gcc-static-clean: + rm -vrf $(WORK)/build-gcc-static $(WORK)/gcc-$(GCC_VERSION) + +gcc-static-distclean: gcc-static-clean + rm -vf $(WORK)/gcc-$(GCC_VERSION).tar.bz2 + + +# GLIBC +$(WORK)/glibc-$(GLIBC_VERSION).tar.bz2: + wget -P $(WORK) -c ftp://ftp.gnu.org/gnu/glibc/glibc-$(GLIBC_VERSION).tar.bz2 + +$(WORK)/glibc-ports-$(GLIBC_VERSION).tar.bz2: + wget -P $(WORK) -c ftp://ftp.gnu.org/gnu/glibc/glibc-ports-$(GLIBC_VERSION).tar.bz2 + +$(WORK)/glibc-$(GLIBC_VERSION): $(WORK)/glibc-$(GLIBC_VERSION).tar.bz2 $(WORK)/glibc-ports-$(GLIBC_VERSION).tar.bz2 $(WORK)/glibc-$(GLIBC_VERSION)-pot.patch + tar -C $(WORK) -xvjf $(WORK)/glibc-$(GLIBC_VERSION).tar.bz2 + cd $(WORK)/glibc-$(GLIBC_VERSION) && \ + tar xvjf $(WORK)/glibc-ports-$(GLIBC_VERSION).tar.bz2 && \ + patch -p1 -i $(WORK)/glibc-$(GLIBC_VERSION)-pot.patch && \ + mv glibc-ports-$(GLIBC_VERSION) ports && \ + sed -e 's/-lgcc_eh//g' -i Makeconfig + touch $(WORK)/glibc-$(GLIBC_VERSION) + +$(WORK)/build-glibc: $(WORK)/glibc-$(GLIBC_VERSION) + mkdir -p $(WORK)/build-glibc + touch $(WORK)/build-glibc + +$(CLFS)/usr/lib/libc.so: $(WORK)/build-glibc $(WORK)/glibc-$(GLIBC_VERSION) + cd $(WORK)/build-glibc && \ + export PATH=$(CROSSTOOLS)/bin:$$PATH && \ + echo "libc_cv_forced_unwind=yes" > config.cache && \ + echo "libc_cv_c_cleanup=yes" >> config.cache && \ + echo "libc_cv_gnu89_inline=yes" >> config.cache && \ + echo "install_root=$(CLFS)" > configparms && \ + unset CFLAGS && unset CXXFLAGS && \ + BUILD_CC="gcc" CC="$(TARGET)-gcc" AR="$(TARGET)-ar" \ + RANLIB="$(TARGET)-ranlib" \ + $(WORK)/glibc-$(GLIBC_VERSION)/configure --prefix=/usr \ + --libexecdir=/usr/lib/glibc --host=$(TARGET) --build=$(HOST) \ + --disable-profile --enable-add-ons --with-tls --enable-kernel=2.6.0 \ + --with-__thread --with-binutils=$(CROSSTOOLS)/bin --with-fp=no \ + --with-headers=$(CLFS)/usr/include --cache-file=config.cache && \ + make && make install || exit 1 + touch $(CLFS)/usr/lib/libc.so + +glibc: binutils gcc-static $(CLFS)/usr/lib/libc.so + +glibc-clean: + rm -vrf $(WORK)/build-glibc $(WORK)/glibc-$(GLIBC_VERSION) + +glibc-distclean: glibc-clean + rm -vf $(WORK)/glibc-$(GLIBC_VERSION).tar.bz2 $(WORK)/glibc-ports-$(GLIBC_VERSION).tar.bz2 + + +# GCC-FINAL +$(WORK)/build-gcc-final: $(WORK)/gcc-$(GCC_VERSION) + mkdir -p $(WORK)/build-gcc-final + touch $(WORK)/build-gcc-final + +$(CLFS)/lib/gcc: $(WORK)/build-gcc-final $(WORK)/gcc-$(GCC_VERSION) + cd $(WORK)/build-gcc-final && \ + export PATH=$$PATH:$(CROSSTOOLS)/bin && \ + unset CFLAGS && unset CXXFLAGS && unset CC && \ + AR=ar LDFLAGS="-Wl,-rpath,$(CROSSTOOLS)/lib" \ + $(WORK)/gcc-$(GCC_VERSION)/configure --prefix=$(CROSSTOOLS) \ + --build=$(HOST) --host=$(HOST) --target=$(TARGET) \ + --with-fp=no --with-headers=$(CLFS)/usr/include \ + --disable-multilib --with-sysroot=$(CLFS) --disable-nls \ + --enable-languages=c,c++ --enable-__cxa_atexit \ + --with-mpfr=$(CROSSTOOLS) --with-gmp=$(CROSSTOOLS) --with-mpc=$(CROSSTOOLS) \ + --enable-c99 --enable-long-long --enable-threads=posix && \ + make AS_FOR_TARGET="$(TARGET)-as" LD_FOR_TARGET="$(TARGET)-ld" && \ + make install || exit 1 + touch $(CLFS)/lib/gcc + +gcc-final: libgmp libmpfr glibc $(CLFS)/lib/gcc + +gcc-final-clean: + rm -vrf $(WORK)/build-gcc-final $(WORK)/gcc-$(GCC_VERSION) + +gcc-final-distclean: gcc-final-clean + rm -vf $(WORK)/gcc-$(GCC_VERSION).tar.bz2 + + +# SETUP FOR PKGUTILS +$(CLFS)/var/lib/pkg/db: + install -d -m 0755 $(CLFS)/var/lib/pkg + touch $(CLFS)/var/lib/pkg/db + +setup: $(CLFS)/var/lib/pkg/db + +# TEST THE TOOLCHAIN +$(WORK)/test: $(WORK)/test.c + export PATH=$$PATH:$(CROSSTOOLS)/bin && \ + unset CFLAGS && unset CXXFLAGS && unset CC && \ + AR=ar LDFLAGS="-Wl,-rpath,$(CROSSTOOLS)/lib" \ + $(TARGET)-gcc -Wall -o $(WORK)/test $(WORK)/test.c + [ "`file -b $(WORK)/test | cut -d',' -f2 | sed 's| ||g'`" = "ARM" ] || exit 1 + touch $(WORK)/test + +test: gcc-final $(WORK)/test + +test-clean: + rm -vrf $(WORK)/test + +test-distclean: test-clean + +# End of file diff --git a/README b/README index e69de29..9232596 100644 --- a/README +++ b/README @@ -0,0 +1,5 @@ +To compile the last toolchain just do: + +$ git branch 2.7 origin/2.7 +$ git checkout 2.7 +$ make diff --git a/vars.mk b/vars.mk new file mode 100644 index 0000000..8453672 --- /dev/null +++ b/vars.mk @@ -0,0 +1,21 @@ +# +# vars.mk +# + +HOST = $(shell echo $$MACHTYPE | sed "s/$$(echo $$MACHTYPE | cut -d- -f2)/cross/") +TARGET = arm-crux-linux-gnueabi + +PWD = $(shell pwd) +CLFS = $(PWD)/clfs +CROSSTOOLS = $(PWD)/crosstools +WORK = $(PWD)/work + +KERNEL_HEADERS_VERSION = 2.6.35.6 +LIBGMP_VERSION = 5.0.1 +LIBMPFR_VERSION = 3.0.0 +LIBMPC_VERSION = 0.8.2 +BINUTILS_VERSION = 2.20.1 +GCC_VERSION = 4.5.2 +GLIBC_VERSION = 2.12.1 + +# End of file diff --git a/work/glibc-2.12.1-pot.patch b/work/glibc-2.12.1-pot.patch new file mode 100644 index 0000000..dacb3c7 --- /dev/null +++ b/work/glibc-2.12.1-pot.patch @@ -0,0 +1,15 @@ +diff -ruN glibc-2.12.1.orig//manual/Makefile glibc-2.12.1//manual/Makefile +--- glibc-2.12.1.orig//manual/Makefile 2010-07-27 11:34:39.000000000 +0000 ++++ glibc-2.12.1//manual/Makefile 2011-04-05 12:48:47.000000000 +0000 +@@ -232,7 +232,10 @@ + .PHONY: stubs + stubs: $(objpfx)stubs + endif +-$(objpfx)stubs ../po/manual.pot $(objpfx)stamp%: ++$(objpfx)stubs ../po/manual.pot: ++ $(make-target-directory) ++ touch $@ ++$(objpfx)stamp%: + $(make-target-directory) + touch $@ + diff --git a/work/test.c b/work/test.c new file mode 100644 index 0000000..8e343df --- /dev/null +++ b/work/test.c @@ -0,0 +1,12 @@ +/* + * test.c + */ + +#include + +int main(int argc, char ** argv) { + printf("CRUX ARM Toolchain Test\n"); + return 0; +} + +/* End of file */ -- 2.26.2