patches/gcc/4.0.4/190-arm-bigendian.patch
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Thu Dec 27 12:45:22 2012 +0100 (2012-12-27)
changeset 3152 b286c7993be5
parent 1 eeea35fbf182
permissions -rw-r--r--
scripts/addToolsVersion: properly handle .in vs. .in.2

While most components have their version in the .in file, some
have it in the .in.2 (eg. elf2flt).

Currently, to handle this case, we indiscriminately munge both files,
but this is wrong: in the elf2flt case, if we add a binutils version,
we do not want it to be added to elf2flt, and conversely.

So, for each tool, we need to explicitly know what file to munge.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
     1 diff -dur gcc-4.0.4.orig/gcc/config/arm/linux-elf.h gcc-4.0.4/gcc/config/arm/linux-elf.h
     2 --- gcc-4.0.4.orig/gcc/config/arm/linux-elf.h	2007-02-02 19:24:50.000000000 +0100
     3 +++ gcc-4.0.4/gcc/config/arm/linux-elf.h	2007-02-02 19:26:12.000000000 +0100
     4 @@ -31,19 +31,33 @@
     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  #undef  TARGET_DEFAULT_FLOAT_ABI
    23  #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
    24  
    25  #undef  TARGET_DEFAULT
    26 -#define TARGET_DEFAULT (0)
    27 +#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
    28  
    29  #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
    30  
    31 -#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
    32 +#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
    33  
    34  #undef  MULTILIB_DEFAULTS
    35  #define MULTILIB_DEFAULTS \
    36 -	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
    37 +	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
    38  
    39  /* The GNU C++ standard library requires that these macros be defined.  */
    40  #undef CPLUSPLUS_CPP_SPEC
    41 @@ -95,7 +109,7 @@
    42     %{rdynamic:-export-dynamic} \
    43     %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "} \
    44     -X \
    45 -   %{mbig-endian:-EB}" \
    46 +   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
    47     SUBTARGET_EXTRA_LINK_SPEC
    48  
    49  #define TARGET_OS_CPP_BUILTINS()		\
    50 Only in gcc-4.0.4/gcc/config/arm: linux-elf.h.orig
    51 diff -dur gcc-4.0.4.orig/gcc/config.gcc gcc-4.0.4/gcc/config.gcc
    52 --- gcc-4.0.4.orig/gcc/config.gcc	2007-02-02 19:24:50.000000000 +0100
    53 +++ gcc-4.0.4/gcc/config.gcc	2007-02-02 19:26:12.000000000 +0100
    54 @@ -672,6 +672,11 @@
    55  	;;
    56  arm*-*-linux*)			# ARM GNU/Linux with ELF
    57  	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"
    58 +	case $target in
    59 +	arm*b-*)
    60 +		tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
    61 +		;;
    62 +	esac
    63  	tmake_file="${tmake_file} arm/t-arm arm/t-linux"
    64  	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
    65  	gnu_ld=yes