[617118d] | 1 | By Lennert Buytenhek <buytenh@wantstofly.org>
|
---|
| 2 | Adds support for arm*b-linux* big-endian ARM targets
|
---|
| 3 |
|
---|
| 4 | See http://gcc.gnu.org/PR16350
|
---|
| 5 |
|
---|
| 6 | diff -urN gcc-3.4.0.orig/gcc/config/arm/linux-elf.h gcc-3.4.0/gcc/config/arm/linux-elf.h
|
---|
| 7 | --- gcc-3.4.0.orig/gcc/config/arm/linux-elf.h 2004-01-31 07:18:11.000000000 +0100
|
---|
| 8 | +++ gcc-3.4.0/gcc/config/arm/linux-elf.h 2004-07-02 14:46:29.225443757 +0200
|
---|
| 9 | @@ -30,17 +30,34 @@
|
---|
| 10 | /* Do not assume anything about header files. */
|
---|
| 11 | #define NO_IMPLICIT_EXTERN_C
|
---|
| 12 |
|
---|
| 13 | +/*
|
---|
| 14 | + * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
|
---|
| 15 | + * (big endian) configurations.
|
---|
| 16 | + */
|
---|
| 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"
|
---|
| 21 | +#else
|
---|
| 22 | +#define TARGET_ENDIAN_DEFAULT 0
|
---|
| 23 | +#define TARGET_ENDIAN_OPTION "mlittle-endian"
|
---|
| 24 | +#define TARGET_LINKER_EMULATION "armelf_linux"
|
---|
| 25 | +#endif
|
---|
| 26 | +
|
---|
| 27 | /* Default is to use APCS-32 mode. */
|
---|
| 28 | #undef TARGET_DEFAULT
|
---|
| 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 )
|
---|
| 34 |
|
---|
| 35 | #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
|
---|
| 36 |
|
---|
| 37 | -#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
|
---|
| 38 | +#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
|
---|
| 39 |
|
---|
| 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" }
|
---|
| 44 |
|
---|
| 45 | #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
|
---|
| 46 |
|
---|
| 47 | @@ -89,7 +106,7 @@
|
---|
| 48 | %{rdynamic:-export-dynamic} \
|
---|
| 49 | %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
|
---|
| 50 | -X \
|
---|
| 51 | - %{mbig-endian:-EB}" \
|
---|
| 52 | + %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
|
---|
| 53 | SUBTARGET_EXTRA_LINK_SPEC
|
---|
| 54 |
|
---|
| 55 | #define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
|
---|
| 56 | diff -urN gcc-3.4.0.orig/gcc/config.gcc gcc-3.4.0/gcc/config.gcc
|
---|
| 57 | --- gcc-3.4.0.orig/gcc/config.gcc 2004-04-17 04:28:24.000000000 +0200
|
---|
| 58 | +++ gcc-3.4.0/gcc/config.gcc 2004-07-02 14:44:40.045822542 +0200
|
---|
| 59 | @@ -666,6 +666,11 @@
|
---|
| 60 | ;;
|
---|
| 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"
|
---|
| 63 | + case $target in
|
---|
| 64 | + arm*b-*)
|
---|
| 65 | + tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
|
---|
| 66 | + ;;
|
---|
| 67 | + esac
|
---|
| 68 | tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
|
---|
| 69 | extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
|
---|
| 70 | gnu_ld=yes
|
---|