From fd56a09bf4912416c425289c57e8dfdc587236b7 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 12 Oct 2011 09:16:00 +0000 Subject: [PATCH] Initial commit. Added hardfp support for armv7 with fpu vfpv3-d16 extension. --- Makefile | 26 ++--- work/gcc-4.6-gnueabihf.patch | 166 ++++++++++++++++++++++++++++++++ work/glibc-2.13-gnueabihf.patch | 22 +++++ work/glibc-2.13-prelink.patch | 26 +++++ 4 files changed, 229 insertions(+), 11 deletions(-) create mode 100644 work/gcc-4.6-gnueabihf.patch create mode 100644 work/glibc-2.13-gnueabihf.patch create mode 100644 work/glibc-2.13-prelink.patch diff --git a/Makefile b/Makefile index 1a17dd5..612f232 100644 --- a/Makefile +++ b/Makefile @@ -132,7 +132,8 @@ $(WORK)/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 + cd $(WORK)/binutils-$(BINUTILS_VERSION) && \ + patch -p1 -i $(WORK)/binutils-$(BINUTILS_VERSION)-gnueabihf.patch touch $(WORK)/binutils-$(BINUTILS_VERSION) $(WORK)/build-binutils: $(WORK)/binutils-$(BINUTILS_VERSION) @@ -145,7 +146,7 @@ $(CLFS)/usr/include/libiberty.h: $(WORK)/build-binutils 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 && \ + --disable-nls --enable-shared --disable-multilib --enable-interwork && \ 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 @@ -165,6 +166,8 @@ $(WORK)/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 + cd $(WORK)/gcc-$(GCC_VERSION) && \ + patch -p1 -i $(WORK)/gcc-$(GCC_VERSION)-gnueabihf.patch touch $(WORK)/gcc-$(GCC_VERSION) $(WORK)/build-gcc-static: $(WORK)/gcc-$(GCC_VERSION) @@ -178,12 +181,12 @@ $(CROSSTOOLS)/lib/gcc: $(WORK)/build-gcc-static $(WORK)/gcc-$(GCC_VERSION) $(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 \ + --without-headers --disable-decimal-float \ --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 + --disable-shared --disable-threads --enable-languages=c \ + --with-abi=aapcs-linux --with-arch=armv7-a --with-mode=thumb --with-float=hard --with-fpu=vfpv3-d16 && \ + make all-gcc all-target-libgcc && make install-gcc install-target-libgcc || exit 1 touch $(CROSSTOOLS)/lib/gcc gcc-static: linux-headers libgmp libmpfr binutils $(CROSSTOOLS)/lib/gcc @@ -206,8 +209,9 @@ $(WORK)/glibc-$(GLIBC_VERSION): $(WORK)/glibc-$(GLIBC_VERSION).tar.bz2 $(WORK)/g 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 && \ + patch -p1 -i $(WORK)/glibc-$(GLIBC_VERSION)-gnueabihf.patch && \ + patch -p1 -i $(WORK)/glibc-$(GLIBC_VERSION)-prelink.patch && \ sed -e 's/-lgcc_eh//g' -i Makeconfig touch $(WORK)/glibc-$(GLIBC_VERSION) @@ -228,7 +232,7 @@ $(CLFS)/usr/lib/libc.so: $(WORK)/build-glibc $(WORK)/glibc-$(GLIBC_VERSION) $(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-__thread --with-binutils=$(CROSSTOOLS)/bin --with-fp=yes \ --with-headers=$(CLFS)/usr/include --cache-file=config.cache && \ make && make install || exit 1 touch $(CLFS)/usr/lib/libc.so @@ -254,11 +258,11 @@ $(CLFS)/lib/gcc: $(WORK)/build-gcc-final $(WORK)/gcc-$(GCC_VERSION) 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 \ + --with-headers=$(CLFS)/usr/include --enable-shared \ --disable-multilib --with-sysroot=$(CLFS) --disable-nls \ - --enable-languages=c,c++ --enable-__cxa_atexit \ + --enable-languages=c,c++ --enable-c99 --enable-long-long --enable-threads=posix \ --with-mpfr=$(CROSSTOOLS) --with-gmp=$(CROSSTOOLS) --with-mpc=$(CROSSTOOLS) \ - --enable-c99 --enable-long-long --enable-threads=posix && \ + --with-abi=aapcs-linux --with-arch=armv7-a --with-mode=thumb --with-float=hard --with-fpu=vfpv3-d16 && \ make AS_FOR_TARGET="$(TARGET)-as" LD_FOR_TARGET="$(TARGET)-ld" && \ make install || exit 1 touch $(CLFS)/lib/gcc diff --git a/work/gcc-4.6-gnueabihf.patch b/work/gcc-4.6-gnueabihf.patch new file mode 100644 index 0000000..49059d3 --- /dev/null +++ b/work/gcc-4.6-gnueabihf.patch @@ -0,0 +1,166 @@ +http://gcc.gnu.org/ml/gcc/2011-02/msg00390.html + +Triplet for ARM Linux HardFP ABI, again + + * From: Guillem Jover + * To: gcc at gcc dot gnu dot org + * Date: Mon, 21 Feb 2011 11:12:09 +0100 + * Subject: Triplet for ARM Linux HardFP ABI, again + + +diff --git a/configure b/configure +index 501c6ff..43ff04f 100755 +--- a/configure ++++ b/configure +diff --git a/configure b/configure +index 501c6ff..43ff04f 100755 +--- a/configure ++++ b/configure +@@ -3236,7 +3236,7 @@ case "${target}" in + noconfigdirs="$noconfigdirs target-libffi target-qthreads" + libgloss_dir=arm + ;; +- arm*-*-linux-gnueabi) ++ arm*-*-linux-*eabi*) + noconfigdirs="$noconfigdirs target-qthreads" + case ${with_newlib} in + no) noconfigdirs="$noconfigdirs target-newlib target-libgloss" +diff --git a/configure.ac b/configure.ac +index 9121d65..e1a42e0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -682,7 +682,7 @@ case "${target}" in + noconfigdirs="$noconfigdirs target-libffi target-qthreads" + libgloss_dir=arm + ;; +- arm*-*-linux-gnueabi) ++ arm*-*-linux-*eabi*) + noconfigdirs="$noconfigdirs target-qthreads" + case ${with_newlib} in + no) noconfigdirs="$noconfigdirs target-newlib target-libgloss" +diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in +index b64ba55..cbe6b70 100644 +--- a/gcc/ada/gcc-interface/Makefile.in ++++ b/gcc/ada/gcc-interface/Makefile.in +@@ -1841,7 +1841,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(arch) $(osys))),) + LIBRARY_VERSION := $(LIB_VERSION) + endif + +-ifeq ($(strip $(filter-out arm% linux-gnueabi,$(arch) $(osys)-$(word 4,$(targ)))),) ++ifeq ($(strip $(filter-out arm% linux%,$(arch) $(osys))),) + LIBGNAT_TARGET_PAIRS = \ + a-intnam.ads + // +diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc +index d71c012..1086a18 100644 +--- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc ++++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc +@@ -1,5 +1,5 @@ + // { dg-options "-std=gnu++0x -funsigned-char -fshort-enums" } +-// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } } ++// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux-*eabi* } } + + // 2007-05-03 Benjamin Kosnik + // + diff --git a/work/glibc-2.13-gnueabihf.patch b/work/glibc-2.13-gnueabihf.patch new file mode 100644 index 0000000..64e3199 --- /dev/null +++ b/work/glibc-2.13-gnueabihf.patch @@ -0,0 +1,22 @@ +--- glibc-2.13/ports/sysdeps/arm/preconfigure 2010-12-06 20:43:02.000000000 +0000 ++++ glibc-2.13.armhf//ports/sysdeps/arm/preconfigure 2011-05-06 15:57:15.087298361 +0000 +@@ -2,7 +2,7 @@ + arm*) + base_machine=arm + case $config_os in +- linux-gnueabi) ++ linux-gnueabi*) + machine=arm/eabi/$machine + if [ "${CFLAGS+set}" != "set" ]; then + CFLAGS="-g -O2" +diff -ruN eglibc-2.13/ports/sysdeps/arm/shlib-versions eglibc-2.13.armhf//ports/sysdeps/arm/shlib-versions +--- eglibc-2.13/ports/sysdeps/arm/shlib-versions 2006-08-17 01:23:58.000000000 +0000 ++++ eglibc-2.13.armhf//ports/sysdeps/arm/shlib-versions 2011-05-06 15:57:27.067299108 +0000 +@@ -1,4 +1,4 @@ +-arm.*-.*-linux-gnueabi DEFAULT GLIBC_2.4 ++arm.*-.*-linux-gnueabi* DEFAULT GLIBC_2.4 + +-arm.*-.*-linux-gnueabi ld=ld-linux.so.3 ++arm.*-.*-linux-gnueabi* ld=ld-linux.so.3 + arm.*-.*-linux.* ld=ld-linux.so.2 + diff --git a/work/glibc-2.13-prelink.patch b/work/glibc-2.13-prelink.patch new file mode 100644 index 0000000..bef7998 --- /dev/null +++ b/work/glibc-2.13-prelink.patch @@ -0,0 +1,26 @@ +diff --git a/elf/rtld.c b/elf/rtld.c +index 9a560b3..201c9cf 100644 +--- a/elf/rtld.c ++++ b/elf/rtld.c +@@ -2168,6 +2168,10 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n", + we need it in the memory handling later. */ + GLRO(dl_initial_searchlist) = *GL(dl_ns)[LM_ID_BASE]._ns_main_searchlist; + ++ /* Remember the last search directory added at startup, now that ++ malloc will no longer be the one from dl-minimal.c. */ ++ GLRO(dl_init_all_dirs) = GL(dl_all_dirs); ++ + if (prelinked) + { + if (main_map->l_info [ADDRIDX (DT_GNU_CONFLICT)] != NULL) +@@ -2288,10 +2292,6 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n", + lossage); + } + +- /* Remember the last search directory added at startup, now that +- malloc will no longer be the one from dl-minimal.c. */ +- GLRO(dl_init_all_dirs) = GL(dl_all_dirs); +- + if (! prelinked && rtld_multiple_ref) + { + /* There was an explicit ref to the dynamic linker as a shared lib. -- 2.26.2