Fix building big-endian ARM EABI toolchains (build-tested only).
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun May 25 22:10:32 2008 +0000 (2008-05-25)
changeset 53381a582c81c13
parent 532 0faef1ae3f09
child 534 7eaad7396b66
Fix building big-endian ARM EABI toolchains (build-tested only).
Patch highly inspired by the one from OpenWRT (http://openwrt.org/)

/trunk/patches/gcc/4.2.3/930-eabi_fixes.patch | 13 13 0 0 +++++++++++++
/trunk/scripts/build/cc_gcc.sh | 6 4 2 0 ++++--
2 files changed, 17 insertions(+), 2 deletions(-)
patches/gcc/4.2.3/930-eabi_fixes.patch
scripts/build/cc_gcc.sh
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/gcc/4.2.3/930-eabi_fixes.patch	Sun May 25 22:10:32 2008 +0000
     1.3 @@ -0,0 +1,13 @@
     1.4 +diff -durN gcc-4.2.3.orig/gcc/config/arm/linux-eabi.h gcc-4.2.3/gcc/config/arm/linux-eabi.h
     1.5 +--- gcc-4.2.3.orig/gcc/config/arm/linux-eabi.h	2007-09-01 17:28:30.000000000 +0200
     1.6 ++++ gcc-4.2.3/gcc/config/arm/linux-eabi.h	2008-05-25 23:47:36.000000000 +0200
     1.7 +@@ -47,7 +47,8 @@
     1.8 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
     1.9 + 
    1.10 + #undef SUBTARGET_EXTRA_LINK_SPEC
    1.11 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
    1.12 ++#define SUBTARGET_EXTRA_LINK_SPEC	\
    1.13 ++	" %{mlittle-endian:-m armelf_linux_eabi} %{mbig-endian:-m armelfb_linux_eabi}"
    1.14 + 
    1.15 + /* Use ld-linux.so.3 so that it will be possible to run "classic"
    1.16 +    GNU/Linux binaries on an EABI system.  */
     2.1 --- a/scripts/build/cc_gcc.sh	Sat May 24 22:49:54 2008 +0000
     2.2 +++ b/scripts/build/cc_gcc.sh	Sun May 25 22:10:32 2008 +0000
     2.3 @@ -224,12 +224,12 @@
     2.4      extra_config="${extra_config} --disable-multilib"
     2.5      extra_config="${extra_config} ${CT_ARCH_WITH_ARCH} ${CT_ARCH_WITH_ABI} ${CT_ARCH_WITH_CPU} ${CT_ARCH_WITH_TUNE} ${CT_ARCH_WITH_FPU} ${CT_ARCH_WITH_FLOAT}"
     2.6      [ "${CT_SHARED_LIBS}" = "y" ] || extra_config="${extra_config} --disable-shared"
     2.7 +    [ "${CT_CC_GCC_GMP_MPFR}" = "y" ] && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
     2.8      if [ "${CT_CC_CXA_ATEXIT}" = "y" ]; then
     2.9          extra_config="${extra_config} --enable-__cxa_atexit"
    2.10      else
    2.11          extra_config="${extra_config} --disable-__cxa_atexit"
    2.12      fi
    2.13 -    [ "${CT_CC_GCC_GMP_MPFR}" = "y" ] && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
    2.14  
    2.15      CT_DoLog DEBUG "Extra config passed: '${extra_config}'"
    2.16  
    2.17 @@ -239,7 +239,9 @@
    2.18      # embedded systems don't really need message catalogs...
    2.19      CC_FOR_BUILD="${CT_CC_NATIVE}"              \
    2.20      CFLAGS="${CT_CFLAGS_FOR_HOST}"              \
    2.21 -    TARGET_CFLAGS="${CT_TARGET_CFLAGS}"         \
    2.22 +    CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}"     \
    2.23 +    CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}"   \
    2.24 +    LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}"   \
    2.25      "${CT_SRC_DIR}/${CT_CC_FILE}/configure"     \
    2.26          ${CT_CANADIAN_OPT}                      \
    2.27          --target=${CT_TARGET} --host=${CT_HOST} \