patches/gcc/4.0.3/800-arm-bigendian.patch
changeset 747 d3e603e7c17c
parent 746 b150d6f590fc
child 748 61cd4eb6034d
     1.1 --- a/patches/gcc/4.0.3/800-arm-bigendian.patch	Mon Jul 28 21:08:01 2008 +0000
     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.0.3/gcc/config/arm/linux-elf.h
    1.10 -+++ gcc-4.0.3/gcc/config/arm/linux-elf.h
    1.11 -@@ -31,19 +31,33 @@
    1.12 - /* Do not assume anything about header files.  */
    1.13 - #define NO_IMPLICIT_EXTERN_C
    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 ARM_FLAG_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 - /* The GNU C++ standard library requires that these macros be defined.  */
    1.47 - #undef CPLUSPLUS_CPP_SPEC
    1.48 -@@ -90,7 +104,7 @@
    1.49 -    %{rdynamic:-export-dynamic} \
    1.50 -    %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
    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 - #define TARGET_OS_CPP_BUILTINS()		\
    1.57 ---- gcc-4.0.3/gcc/config.gcc
    1.58 -+++ gcc-4.0.3/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 arm/aout.h arm/arm.h"
    1.63 -+	case $target in
    1.64 -+	arm*b-*)
    1.65 -+		tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
    1.66 -+		;;
    1.67 -+	esac
    1.68 - 	tmake_file="${tmake_file} arm/t-arm arm/t-linux"
    1.69 - 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
    1.70 - 	gnu_ld=yes