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 diff -urN gcc-3.4.1-dist/gcc/config/arm/linux-elf.h gcc-3.4.1/gcc/config/arm/linux-elf.h
7 --- gcc-3.4.1-dist/gcc/config/arm/linux-elf.h 2004-08-16 16:01:50.000000000 -0500
8 +++ gcc-3.4.1/gcc/config/arm/linux-elf.h 2004-08-16 15:43:40.000000000 -0500
10 /* Do not assume anything about header files. */
11 #define NO_IMPLICIT_EXTERN_C
14 + * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
15 + * (big endian) configurations.
17 +#if TARGET_BIG_ENDIAN_DEFAULT
18 +#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
19 +#define TARGET_ENDIAN_OPTION "mbig-endian"
20 +#define TARGET_LINKER_EMULATION "armelfb_linux"
22 +#define TARGET_ENDIAN_DEFAULT 0
23 +#define TARGET_ENDIAN_OPTION "mlittle-endian"
24 +#define TARGET_LINKER_EMULATION "armelf_linux"
27 /* Default is to use APCS-32 mode. */
29 -#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
30 +#define TARGET_DEFAULT \
31 + ( ARM_FLAG_APCS_32 | \
32 + ARM_FLAG_MMU_TRAPS | \
33 + 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", "mapcs-32", "mno-thumb-interwork" }
43 + { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
45 #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
48 %{rdynamic:-export-dynamic} \
49 %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
51 - %{mbig-endian:-EB}" \
52 + %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
53 SUBTARGET_EXTRA_LINK_SPEC
56 diff -urN gcc-3.4.1-dist/gcc/config.gcc gcc-3.4.1/gcc/config.gcc
57 --- gcc-3.4.1-dist/gcc/config.gcc 2004-08-16 16:01:50.000000000 -0500
58 +++ gcc-3.4.1/gcc/config.gcc 2004-08-16 16:01:25.000000000 -0500
61 arm*-*-linux*) # ARM GNU/Linux with ELF
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"
65 + tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
68 tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
69 extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"