patches/gcc/4.2.4/241-arm-bigendian2.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 22:46:47 2011 +0200 (2011-07-17)
changeset 2892 aa934ec4b4ee
permissions -rw-r--r--
cc/gcc: add the backend/frontend infra for final gcc

Currently, we issue the bare-metal compiler from the pass_1 & pass_2
core compilers, because the final gcc breaks while doing so.

This implies we have to build some libces during the start_files step,
instead of the standard libc step. This is the case for newlib.

By adding a backend/frontend infra to the final gcc, we can abstract
what backend to call: the standard backend for non-bare-metal gcc,
and the core backend for bare-metal.

This patch is just an no-op, it just adds the final backend and
frontend without changing the way bare-metal is built, to come in a
subsequent patch.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@1128
     1
Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org> wrote:
yann@1128
     2
yann@1128
     3
I tried to use crosstool-ng to generate a toolchain for Linux on big
yann@1128
     4
endian arm with recent versions of gcc, glibc, etc... but had a few
yann@1128
     5
problems.
yann@1128
     6
yann@1128
     7
It appears that the gcc patch (for gcc 4.2.x)
yann@1128
     8
for big-endian arm (240-arm-bigendian.patch) lacks the change attached
yann@1128
     9
to this mail as 240-arm-bigendian2.patch.
yann@1128
    10
yann@1128
    11
--- gcc-4.2.4/gcc/config/arm/bpabi.h~	2007-09-01 17:28:30.000000000 +0200
yann@1128
    12
+++ gcc-4.2.4/gcc/config/arm/bpabi.h	2009-01-05 19:19:10.000000000 +0100
yann@1128
    13
@@ -32,9 +32,19 @@
yann@1128
    14
 #undef FPUTYPE_DEFAULT
yann@1128
    15
 #define FPUTYPE_DEFAULT FPUTYPE_VFP
yann@1128
    16
 
yann@1128
    17
+/*
yann@1128
    18
+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
yann@1128
    19
+ * (big endian) configurations.
yann@1128
    20
+ */
yann@1128
    21
+#if TARGET_BIG_ENDIAN_DEFAULT
yann@1128
    22
+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
yann@1128
    23
+#else
yann@1128
    24
+#define TARGET_ENDIAN_DEFAULT 0
yann@1128
    25
+#endif
yann@1128
    26
+
yann@1128
    27
 /* EABI targets should enable interworking by default.  */
yann@1128
    28
 #undef TARGET_DEFAULT
yann@1128
    29
-#define TARGET_DEFAULT MASK_INTERWORK
yann@1128
    30
+#define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT)
yann@1128
    31
 
yann@1128
    32
 /* The ARM BPABI functions return a boolean; they use no special
yann@1128
    33
    calling convention.  */