diff options
Diffstat (limited to 'meta/packages/gcc/gcc-4.0.2/800-arm-bigendian.patch')
| -rw-r--r-- | meta/packages/gcc/gcc-4.0.2/800-arm-bigendian.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/meta/packages/gcc/gcc-4.0.2/800-arm-bigendian.patch b/meta/packages/gcc/gcc-4.0.2/800-arm-bigendian.patch new file mode 100644 index 0000000000..e5fc413485 --- /dev/null +++ b/meta/packages/gcc/gcc-4.0.2/800-arm-bigendian.patch | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | From: | ||
| 2 | http://buildroot.uclibc.org/cgi-bin/viewcvs.cgi/trunk/buildroot/toolchain/gcc/4.0.2/800-arm-bigendian.patch?rev=14828&view=markup | ||
| 3 | |||
| 4 | By Lennert Buytenhek <buytenh@wantstofly.org> | ||
| 5 | Adds support for arm*b-linux* big-endian ARM targets | ||
| 6 | |||
| 7 | See http://gcc.gnu.org/PR16350 | ||
| 8 | |||
| 9 | --- gcc-4.0.3/gcc/config/arm/linux-elf.h | ||
| 10 | +++ gcc-4.0.3/gcc/config/arm/linux-elf.h | ||
| 11 | @@ -31,19 +31,33 @@ | ||
| 12 | /* Do not assume anything about header files. */ | ||
| 13 | #define NO_IMPLICIT_EXTERN_C | ||
| 14 | |||
| 15 | +/* | ||
| 16 | + * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-* | ||
| 17 | + * (big endian) configurations. | ||
| 18 | + */ | ||
| 19 | +#if TARGET_BIG_ENDIAN_DEFAULT | ||
| 20 | +#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END | ||
| 21 | +#define TARGET_ENDIAN_OPTION "mbig-endian" | ||
| 22 | +#define TARGET_LINKER_EMULATION "armelfb_linux" | ||
| 23 | +#else | ||
| 24 | +#define TARGET_ENDIAN_DEFAULT 0 | ||
| 25 | +#define TARGET_ENDIAN_OPTION "mlittle-endian" | ||
| 26 | +#define TARGET_LINKER_EMULATION "armelf_linux" | ||
| 27 | +#endif | ||
| 28 | + | ||
| 29 | #undef TARGET_DEFAULT_FLOAT_ABI | ||
| 30 | #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD | ||
| 31 | |||
| 32 | #undef TARGET_DEFAULT | ||
| 33 | -#define TARGET_DEFAULT (0) | ||
| 34 | +#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT) | ||
| 35 | |||
| 36 | #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 | ||
| 37 | |||
| 38 | -#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p" | ||
| 39 | +#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p" | ||
| 40 | |||
| 41 | #undef MULTILIB_DEFAULTS | ||
| 42 | #define MULTILIB_DEFAULTS \ | ||
| 43 | - { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" } | ||
| 44 | + { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" } | ||
| 45 | |||
| 46 | /* The GNU C++ standard library requires that these macros be defined. */ | ||
| 47 | #undef CPLUSPLUS_CPP_SPEC | ||
| 48 | @@ -90,7 +104,7 @@ | ||
| 49 | %{rdynamic:-export-dynamic} \ | ||
| 50 | %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ | ||
| 51 | -X \ | ||
| 52 | - %{mbig-endian:-EB}" \ | ||
| 53 | + %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ | ||
| 54 | SUBTARGET_EXTRA_LINK_SPEC | ||
| 55 | |||
| 56 | #define TARGET_OS_CPP_BUILTINS() \ | ||
| 57 | --- gcc-4.0.3/gcc/config.gcc | ||
| 58 | +++ gcc-4.0.3/gcc/config.gcc | ||
| 59 | @@ -672,6 +672,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="${tmake_file} arm/t-arm arm/t-linux" | ||
| 69 | extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" | ||
| 70 | gnu_ld=yes | ||
