CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Initial commit. Added hardfp support for armv7 with fpu vfpv3-d16 extension.
authorVictor Martinez <pitillo@ono.com>
Wed, 12 Oct 2011 09:16:00 +0000 (09:16 +0000)
committerVictor Martinez <pitillo@ono.com>
Wed, 12 Oct 2011 09:16:00 +0000 (09:16 +0000)
Makefile
work/gcc-4.6-gnueabihf.patch [new file with mode: 0644]
work/glibc-2.13-gnueabihf.patch [new file with mode: 0644]
work/glibc-2.13-prelink.patch [new file with mode: 0644]

index 1a17dd5317cd5d8a9e2534ee4be27dd4fb403e31..612f23238836421a65ffbbed0a07a4949184b14b 100644 (file)
--- 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 (file)
index 0000000..49059d3
--- /dev/null
@@ -0,0 +1,166 @@
+http://gcc.gnu.org/ml/gcc/2011-02/msg00390.html
+
+Triplet for ARM Linux HardFP ABI, again
+
+    * From: Guillem Jover <guillem at debian dot org>
+    * 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<a-intnam-linux.ads \
+   s-inmaop.adb<s-inmaop-posix.adb \
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index 54b822e..1a47343 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -820,13 +820,13 @@ arm*-*-linux*)                   # ARM GNU/Linux with ELF
+       esac
+       tmake_file="${tmake_file} t-linux arm/t-arm"
+       case ${target} in
+-      arm*-*-linux-*eabi)
++      arm*-*-linux-*eabi*)
+           tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
+           tm_file="$tm_file ../../libgcc/config/arm/bpabi-lib.h"
+           tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"
+           # Define multilib configuration for arm-linux-androideabi.
+           case ${target} in
+-          *-androideabi)
++          *-androideabi*)
+               tmake_file="$tmake_file arm/t-linux-androideabi"
+               ;;
+           esac
+@@ -848,7 +848,7 @@ arm*-*-uclinux*)           # ARM ucLinux
+       tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h glibc-stdint.h"
+       tmake_file="arm/t-arm arm/t-arm-elf"
+       case ${target} in
+-      arm*-*-uclinux*eabi)
++      arm*-*-uclinux*eabi*)
+           tm_file="$tm_file arm/bpabi.h arm/uclinux-eabi.h"
+           tm_file="$tm_file ../../libgcc/config/arm/bpabi-lib.h"
+           tmake_file="$tmake_file arm/t-bpabi"
+diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
+index 02cb7ac..885c0e0 100644
+--- a/gcc/testsuite/lib/target-supports.exp
++++ b/gcc/testsuite/lib/target-supports.exp
+@@ -3219,7 +3219,7 @@ proc check_effective_target_sync_int_long { } {
+            || [istarget i?86-*-*]
+            || [istarget x86_64-*-*]
+            || [istarget alpha*-*-*] 
+-           || [istarget arm*-*-linux-gnueabi] 
++           || [istarget arm*-*-linux-*eabi*]
+            || [istarget bfin*-*linux*]
+            || [istarget hppa*-*linux*]
+            || [istarget s390*-*-*] 
+@@ -3250,7 +3250,7 @@ proc check_effective_target_sync_char_short { } {
+            || [istarget i?86-*-*]
+            || [istarget x86_64-*-*]
+            || [istarget alpha*-*-*] 
+-           || [istarget arm*-*-linux-gnueabi] 
++           || [istarget arm*-*-linux-*eabi*]
+            || [istarget hppa*-*linux*]
+            || [istarget s390*-*-*] 
+            || [istarget powerpc*-*-*]
+diff --git a/libjava/configure b/libjava/configure
+index f79e53b..47e3f23 100755
+--- a/libjava/configure
++++ b/libjava/configure
+@@ -20527,7 +20527,7 @@ case "${host}" in
+     # on Darwin -single_module speeds up loading of the dynamic libraries.
+     extra_ldflags_libjava=-Wl,-single_module
+     ;;
+-arm*linux*eabi)
++arm*-*-linux-*eabi*)
+     # Some of the ARM unwinder code is actually in libstdc++.  We
+     # could in principle replicate it in libgcj, but it's better to
+     # have a dependency on libstdc++.
+diff --git a/libjava/configure.ac b/libjava/configure.ac
+index 8187eec..b59abb3 100644
+--- a/libjava/configure.ac
++++ b/libjava/configure.ac
+@@ -919,7 +919,7 @@ case "${host}" in
+     # on Darwin -single_module speeds up loading of the dynamic libraries.
+     extra_ldflags_libjava=-Wl,-single_module
+     ;;
+-arm*linux*eabi)
++arm*-*-linux-*eabi*)
+     # Some of the ARM unwinder code is actually in libstdc++.  We
+     # could in principle replicate it in libgcj, but it's better to
+     # have a dependency on libstdc++.
+diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
+index e29404c..a2e58a9 100644
+--- a/libstdc++-v3/configure.host
++++ b/libstdc++-v3/configure.host
+@@ -322,7 +322,7 @@ case "${host}" in
+         fi
+     esac
+     case "${host}" in
+-      arm*-*-linux-*eabi)
++      arm*-*-linux-*eabi*)
+       port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
+       ;;
+     esac
+diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
+index cb40b7b..6147d66 100644
+--- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
++++ b/libstdc++-v3/testsuite/20_util/make_signed/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  <bkoz@redhat.com>
+ //
+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  <bkoz@redhat.com>
+ //
+
diff --git a/work/glibc-2.13-gnueabihf.patch b/work/glibc-2.13-gnueabihf.patch
new file mode 100644 (file)
index 0000000..64e3199
--- /dev/null
@@ -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 (file)
index 0000000..bef7998
--- /dev/null
@@ -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.