1 By Lennert Buytenhek <buytenh@wantstofly.org>
2 Adds support for arm*b-linux* big-endian ARM targets
4 See http://gcc.gnu.org/PR16350
6 Index: gcc-4.2.3/gcc/config/arm/linux-elf.h
7 ===================================================================
8 --- gcc-4.2.3.orig/gcc/config/arm/linux-elf.h 2007-09-01 17:28:30.000000000 +0200
9 +++ gcc-4.2.3/gcc/config/arm/linux-elf.h 2008-05-21 13:45:53.349289241 +0200
12 #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
15 + * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
16 + * (big endian) configurations.
18 +#if TARGET_BIG_ENDIAN_DEFAULT
19 +#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
20 +#define TARGET_ENDIAN_OPTION "mbig-endian"
21 +#define TARGET_LINKER_EMULATION "armelfb_linux"
23 +#define TARGET_ENDIAN_DEFAULT 0
24 +#define TARGET_ENDIAN_OPTION "mlittle-endian"
25 +#define TARGET_LINKER_EMULATION "armelf_linux"
28 #undef TARGET_DEFAULT_FLOAT_ABI
29 #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
32 -#define TARGET_DEFAULT (0)
33 +#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
35 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
37 -#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
38 +#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
40 #undef MULTILIB_DEFAULTS
41 #define MULTILIB_DEFAULTS \
42 - { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
43 + { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
45 /* Now we define the strings used to build the spec file. */
48 %{rdynamic:-export-dynamic} \
49 %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
51 - %{mbig-endian:-EB}" \
52 + %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
53 SUBTARGET_EXTRA_LINK_SPEC
56 Index: gcc-4.2.3/gcc/config.gcc
57 ===================================================================
58 --- gcc-4.2.3.orig/gcc/config.gcc 2008-05-21 13:45:43.333288320 +0200
59 +++ gcc-4.2.3/gcc/config.gcc 2008-05-21 13:45:53.353287795 +0200
61 tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
62 tmake_file="${tmake_file} t-linux arm/t-arm"
65 + tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
70 tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
71 tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"