check for host locale utils
[buildroot.git] / toolchain / gcc / 3.4.3 / 800-arm-bigendian.patch
blob04e99841968844fc15c09689d1a6f0ff05922da2
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 --- gcc-3.4.1-dist/gcc/config/arm/linux-elf.h
7 +++ gcc-3.4.1/gcc/config/arm/linux-elf.h
8 @@ -30,17 +30,34 @@
9 /* Do not assume anything about header files. */
10 #define NO_IMPLICIT_EXTERN_C
12 +/*
13 + * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
14 + * (big endian) configurations.
15 + */
16 +#if TARGET_BIG_ENDIAN_DEFAULT
17 +#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
18 +#define TARGET_ENDIAN_OPTION "mbig-endian"
19 +#define TARGET_LINKER_EMULATION "armelfb_linux"
20 +#else
21 +#define TARGET_ENDIAN_DEFAULT 0
22 +#define TARGET_ENDIAN_OPTION "mlittle-endian"
23 +#define TARGET_LINKER_EMULATION "armelf_linux"
24 +#endif
26 /* Default is to use APCS-32 mode. */
27 #undef TARGET_DEFAULT
28 -#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
29 +#define TARGET_DEFAULT \
30 + ( ARM_FLAG_APCS_32 | \
31 + ARM_FLAG_MMU_TRAPS | \
32 + TARGET_ENDIAN_DEFAULT )
34 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
36 -#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
37 +#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
39 #undef MULTILIB_DEFAULTS
40 #define MULTILIB_DEFAULTS \
41 - { "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
42 + { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
44 #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
46 @@ -101,7 +118,7 @@
47 %{rdynamic:-export-dynamic} \
48 %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
49 -X \
50 - %{mbig-endian:-EB}" \
51 + %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
52 SUBTARGET_EXTRA_LINK_SPEC
53 #endif
55 --- gcc-3.4.1-dist/gcc/config.gcc
56 +++ gcc-3.4.1/gcc/config.gcc
57 @@ -672,6 +672,11 @@
59 arm*-*-linux*) # ARM GNU/Linux with ELF
60 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"
61 + case $target in
62 + arm*b-*)
63 + tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
64 + ;;
65 + esac
66 tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
67 extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
68 gnu_ld=yes