fixup ARM EABI on GCC 4.1.2
authorImre Kaloz <kaloz@openwrt.org>
Sun, 17 Feb 2008 15:37:58 +0000 (15:37 +0000)
committerImre Kaloz <kaloz@openwrt.org>
Sun, 17 Feb 2008 15:37:58 +0000 (15:37 +0000)
SVN-Revision: 10480

toolchain/gcc/patches/4.1.2/800-arm-bigendian.patch
toolchain/gcc/patches/4.1.2/930-eabi_fixes.patch [deleted file]

index 1fa5ae1cd27b4565303ac9587067bfad655f74e3..0a9417419ebf941c0f4f9eba55b61291e4c04502 100644 (file)
@@ -3,8 +3,10 @@ Adds support for arm*b-linux* big-endian ARM targets
 
 See http://gcc.gnu.org/PR16350
 
 
 See http://gcc.gnu.org/PR16350
 
---- gcc-4.1.0/gcc/config/arm/linux-elf.h
-+++ gcc-4.1.0/gcc/config/arm/linux-elf.h
+Index: gcc-4.1.1/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.1.1.orig/gcc/config/arm/linux-elf.h
++++ gcc-4.1.1/gcc/config/arm/linux-elf.h
 @@ -28,19 +28,33 @@
  #undef  TARGET_VERSION
  #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
 @@ -28,19 +28,33 @@
  #undef  TARGET_VERSION
  #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
@@ -51,9 +53,11 @@ See http://gcc.gnu.org/PR16350
     SUBTARGET_EXTRA_LINK_SPEC
  
  #undef  LINK_SPEC
     SUBTARGET_EXTRA_LINK_SPEC
  
  #undef  LINK_SPEC
---- gcc-4.1.0/gcc/config.gcc
-+++ gcc-4.1.0/gcc/config.gcc
-@@ -672,6 +672,11 @@
+Index: gcc-4.1.1/gcc/config.gcc
+===================================================================
+--- gcc-4.1.1.orig/gcc/config.gcc
++++ gcc-4.1.1/gcc/config.gcc
+@@ -672,6 +672,11 @@ arm*-*-netbsd*)
        ;;
  arm*-*-linux*)                        # ARM GNU/Linux with ELF
        tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" 
        ;;
  arm*-*-linux*)                        # ARM GNU/Linux with ELF
        tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" 
@@ -65,3 +69,59 @@ See http://gcc.gnu.org/PR16350
        tmake_file="${tmake_file} t-linux arm/t-arm"
        case ${target} in
        arm*-*-linux-gnueabi)
        tmake_file="${tmake_file} t-linux arm/t-arm"
        case ${target} in
        arm*-*-linux-gnueabi)
+Index: gcc-4.1.1/gcc/config/arm/linux-eabi.h
+===================================================================
+--- gcc-4.1.1.orig/gcc/config/arm/linux-eabi.h
++++ gcc-4.1.1/gcc/config/arm/linux-eabi.h
+@@ -20,6 +20,17 @@
+    the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.  */
++/*
++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
++ * (big endian) configurations.
++ */
++#undef TARGET_LINKER_EMULATION
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_LINKER_EMULATION "armelfb_linux_eabi"
++#else
++#define TARGET_LINKER_EMULATION "armelf_linux_eabi"
++#endif
++
+ /* On EABI GNU/Linux, we want both the BPABI builtins and the
+    GNU/Linux builtins.  */
+ #undef TARGET_OS_CPP_BUILTINS
+@@ -48,7 +59,7 @@
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
+ #undef SUBTARGET_EXTRA_LINK_SPEC
+-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION
+ /* Use ld-linux.so.3 so that it will be possible to run "classic"
+    GNU/Linux binaries on an EABI system.  */
+Index: gcc-4.1.1/gcc/config/arm/bpabi.h
+===================================================================
+--- gcc-4.1.1.orig/gcc/config/arm/bpabi.h
++++ gcc-4.1.1/gcc/config/arm/bpabi.h
+@@ -33,9 +33,19 @@
+ #undef FPUTYPE_DEFAULT
+ #define FPUTYPE_DEFAULT FPUTYPE_VFP
++/*
++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
++ * (big endian) configurations.
++ */
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
++#else
++#define TARGET_ENDIAN_DEFAULT 0
++#endif
++
+ /* EABI targets should enable interworking by default.  */
+ #undef TARGET_DEFAULT
+-#define TARGET_DEFAULT MASK_INTERWORK
++#define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT)
+ /* The ARM BPABI functions return a boolean; they use no special
+    calling convention.  */
diff --git a/toolchain/gcc/patches/4.1.2/930-eabi_fixes.patch b/toolchain/gcc/patches/4.1.2/930-eabi_fixes.patch
deleted file mode 100644 (file)
index 03814b9..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-Index: gcc-4.1.2/gcc/config.gcc
-===================================================================
---- gcc-4.1.2.orig/gcc/config.gcc      2008-02-12 23:29:31.037442374 +0100
-+++ gcc-4.1.2/gcc/config.gcc   2008-02-12 23:30:11.051722656 +0100
-@@ -670,7 +670,7 @@
-       extra_parts=""
-       use_collect2=yes
-       ;;
--arm*-*-linux*)                        # ARM GNU/Linux with ELF
-+arm*-linux*)                  # ARM GNU/Linux with ELF
-       tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" 
-       case $target in
-       arm*b-*)
-@@ -679,7 +679,7 @@
-       esac
-       tmake_file="${tmake_file} t-linux arm/t-arm"
-       case ${target} in
--      arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
-+      arm*-*eabi)
-           tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
-           tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
-           # The BPABI long long divmod functions return a 128-bit value in 
-Index: gcc-4.1.2/gcc/config/arm/linux-eabi.h
-===================================================================
---- gcc-4.1.2.orig/gcc/config/arm/linux-eabi.h 2008-02-12 23:51:04.655161444 +0100
-+++ gcc-4.1.2/gcc/config/arm/linux-eabi.h      2008-02-12 23:51:10.619501332 +0100
-@@ -48,7 +48,8 @@
- #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
- #undef SUBTARGET_EXTRA_LINK_SPEC
--#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
-+#define SUBTARGET_EXTRA_LINK_SPEC \
-+      " %{mbig-endian:-m armelfb_linux_eabi} %{mlittle-endian:-m armelf_linux_eabi} "
- /* Use ld-linux.so.3 so that it will be possible to run "classic"
-    GNU/Linux binaries on an EABI system.  */