1.1 --- a/patches/gcc/4.1.1/190-arm-bigendian.patch Wed Oct 28 12:03:38 2009 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,67 +0,0 @@
1.4 -By Lennert Buytenhek <buytenh@wantstofly.org>
1.5 -Adds support for arm*b-linux* big-endian ARM targets
1.6 -
1.7 -See http://gcc.gnu.org/PR16350
1.8 -
1.9 ---- gcc-4.1.0/gcc/config/arm/linux-elf.h
1.10 -+++ gcc-4.1.0/gcc/config/arm/linux-elf.h
1.11 -@@ -28,19 +28,33 @@
1.12 - #undef TARGET_VERSION
1.13 - #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
1.14 -
1.15 -+/*
1.16 -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
1.17 -+ * (big endian) configurations.
1.18 -+ */
1.19 -+#if TARGET_BIG_ENDIAN_DEFAULT
1.20 -+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
1.21 -+#define TARGET_ENDIAN_OPTION "mbig-endian"
1.22 -+#define TARGET_LINKER_EMULATION "armelfb_linux"
1.23 -+#else
1.24 -+#define TARGET_ENDIAN_DEFAULT 0
1.25 -+#define TARGET_ENDIAN_OPTION "mlittle-endian"
1.26 -+#define TARGET_LINKER_EMULATION "armelf_linux"
1.27 -+#endif
1.28 -+
1.29 - #undef TARGET_DEFAULT_FLOAT_ABI
1.30 - #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
1.31 -
1.32 - #undef TARGET_DEFAULT
1.33 --#define TARGET_DEFAULT (0)
1.34 -+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
1.35 -
1.36 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
1.37 -
1.38 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
1.39 -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
1.40 -
1.41 - #undef MULTILIB_DEFAULTS
1.42 - #define MULTILIB_DEFAULTS \
1.43 -- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
1.44 -+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
1.45 -
1.46 - /* Now we define the strings used to build the spec file. */
1.47 - #undef LIB_SPEC
1.48 -@@ -61,7 +75,7 @@
1.49 - %{rdynamic:-export-dynamic} \
1.50 - %{!dynamic-linker:-dynamic-linker " LINUX_TARGET_INTERPRETER "} \
1.51 - -X \
1.52 -- %{mbig-endian:-EB}" \
1.53 -+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
1.54 - SUBTARGET_EXTRA_LINK_SPEC
1.55 -
1.56 - #undef LINK_SPEC
1.57 ---- gcc-4.1.0/gcc/config.gcc
1.58 -+++ gcc-4.1.0/gcc/config.gcc
1.59 -@@ -672,6 +672,11 @@
1.60 - ;;
1.61 - arm*-*-linux*) # ARM GNU/Linux with ELF
1.62 - tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
1.63 -+ case $target in
1.64 -+ arm*b-*)
1.65 -+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1.66 -+ ;;
1.67 -+ esac
1.68 - tmake_file="${tmake_file} t-linux arm/t-arm"
1.69 - case ${target} in
1.70 - arm*-*-linux-gnueabi)