patches/gcc/3.4.4/800-arm-bigendian.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 diff -dur gcc-3.4.4.orig/gcc/config/arm/linux-elf.h gcc-3.4.4/gcc/config/arm/linux-elf.h
     2 --- gcc-3.4.4.orig/gcc/config/arm/linux-elf.h	2007-02-14 17:44:27.000000000 +0100
     3 +++ gcc-3.4.4/gcc/config/arm/linux-elf.h	2007-02-14 17:47:32.000000000 +0100
     4 @@ -30,17 +30,34 @@
     5  /* Do not assume anything about header files.  */
     6  #define NO_IMPLICIT_EXTERN_C
     7  
     8 +/*
     9 + * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
    10 + * (big endian) configurations.
    11 + */
    12 +#if TARGET_BIG_ENDIAN_DEFAULT
    13 +#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
    14 +#define TARGET_ENDIAN_OPTION "mbig-endian"
    15 +#define TARGET_LINKER_EMULATION "armelfb_linux"
    16 +#else
    17 +#define TARGET_ENDIAN_DEFAULT 0
    18 +#define TARGET_ENDIAN_OPTION "mlittle-endian"
    19 +#define TARGET_LINKER_EMULATION "armelf_linux"
    20 +#endif
    21 +
    22  /* Default is to use APCS-32 mode.  */
    23  #undef  TARGET_DEFAULT
    24 -#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
    25 +#define TARGET_DEFAULT \
    26 +		( ARM_FLAG_APCS_32 | \
    27 +		  ARM_FLAG_MMU_TRAPS | \
    28 +		  TARGET_ENDIAN_DEFAULT )
    29  
    30  #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
    31  
    32 -#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
    33 +#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
    34  
    35  #undef  MULTILIB_DEFAULTS
    36  #define MULTILIB_DEFAULTS \
    37 -	{ "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
    38 +	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
    39  
    40  #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
    41  
    42 @@ -94,7 +111,7 @@
    43     %{rdynamic:-export-dynamic} \
    44     %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "} \
    45     -X \
    46 -   %{mbig-endian:-EB}" \
    47 +   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
    48     SUBTARGET_EXTRA_LINK_SPEC
    49  
    50  #define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
    51 Only in gcc-3.4.4/gcc/config/arm: linux-elf.h.orig
    52 diff -dur gcc-3.4.4.orig/gcc/config.gcc gcc-3.4.4/gcc/config.gcc
    53 --- gcc-3.4.4.orig/gcc/config.gcc	2007-02-14 17:44:27.000000000 +0100
    54 +++ gcc-3.4.4/gcc/config.gcc	2007-02-14 17:47:32.000000000 +0100
    55 @@ -672,6 +672,11 @@
    56  	;;
    57  arm*-*-linux*)			# ARM GNU/Linux with ELF
    58  	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"
    59 +	case $target in
    60 +	arm*b-*)
    61 +		tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
    62 +		;;
    63 +	esac
    64  	tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
    65  	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
    66  	gnu_ld=yes