patches/gcc/4.0.4/800-arm-bigendian.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Apr 26 21:31:05 2008 +0000 (2008-04-26)
changeset 454 372b2f397baa
permissions -rw-r--r--
Configure tsocks with a simple heuristic.

Consider the proxy has to be in a 'local' network. It means it is directly
reachable by the local machine, even if the local machine has to hop through
one or more gates to reach the proxy (often the case in enterprise networks
where class A 10.0.0.0/8 is in fact sub-divided into smaller networks, each
one of them in a different location, eg. 10.1.0.0/16 in a place, while
10.2.0.0/16 would be on the other side of the world). Not being in the same
subnet does not mean the proxy is not available.

So we will build a mask with at most high bits set, which defines a network
that has both the local machine and the proxy. Because a machine may have
more than one interface, build a mask for each of them, removing 127.0.0.1
which is added automagically by tsocks, and removing duplicate masks.

If all of this does not work, then it means the local machine can NOT in fact
reach the proxy, which in turn means the user mis-configured something (most
probably a typo...).

/trunk/scripts/crosstool.sh | 61 52 9 0 +++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 52 insertions(+), 9 deletions(-)
yann@1
     1
diff -dur gcc-4.0.4.orig/gcc/config/arm/linux-elf.h gcc-4.0.4/gcc/config/arm/linux-elf.h
yann@1
     2
--- gcc-4.0.4.orig/gcc/config/arm/linux-elf.h	2007-02-02 19:24:50.000000000 +0100
yann@1
     3
+++ gcc-4.0.4/gcc/config/arm/linux-elf.h	2007-02-02 19:26:12.000000000 +0100
yann@1
     4
@@ -31,19 +31,33 @@
yann@1
     5
 /* Do not assume anything about header files.  */
yann@1
     6
 #define NO_IMPLICIT_EXTERN_C
yann@1
     7
 
yann@1
     8
+/*
yann@1
     9
+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
yann@1
    10
+ * (big endian) configurations.
yann@1
    11
+ */
yann@1
    12
+#if TARGET_BIG_ENDIAN_DEFAULT
yann@1
    13
+#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
yann@1
    14
+#define TARGET_ENDIAN_OPTION "mbig-endian"
yann@1
    15
+#define TARGET_LINKER_EMULATION "armelfb_linux"
yann@1
    16
+#else
yann@1
    17
+#define TARGET_ENDIAN_DEFAULT 0
yann@1
    18
+#define TARGET_ENDIAN_OPTION "mlittle-endian"
yann@1
    19
+#define TARGET_LINKER_EMULATION "armelf_linux"
yann@1
    20
+#endif
yann@1
    21
+
yann@1
    22
 #undef  TARGET_DEFAULT_FLOAT_ABI
yann@1
    23
 #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
yann@1
    24
 
yann@1
    25
 #undef  TARGET_DEFAULT
yann@1
    26
-#define TARGET_DEFAULT (0)
yann@1
    27
+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
yann@1
    28
 
yann@1
    29
 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
yann@1
    30
 
yann@1
    31
-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
yann@1
    32
+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
yann@1
    33
 
yann@1
    34
 #undef  MULTILIB_DEFAULTS
yann@1
    35
 #define MULTILIB_DEFAULTS \
yann@1
    36
-	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
yann@1
    37
+	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
yann@1
    38
 
yann@1
    39
 /* The GNU C++ standard library requires that these macros be defined.  */
yann@1
    40
 #undef CPLUSPLUS_CPP_SPEC
yann@1
    41
@@ -95,7 +109,7 @@
yann@1
    42
    %{rdynamic:-export-dynamic} \
yann@1
    43
    %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "} \
yann@1
    44
    -X \
yann@1
    45
-   %{mbig-endian:-EB}" \
yann@1
    46
+   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
yann@1
    47
    SUBTARGET_EXTRA_LINK_SPEC
yann@1
    48
 
yann@1
    49
 #define TARGET_OS_CPP_BUILTINS()		\
yann@1
    50
Only in gcc-4.0.4/gcc/config/arm: linux-elf.h.orig
yann@1
    51
diff -dur gcc-4.0.4.orig/gcc/config.gcc gcc-4.0.4/gcc/config.gcc
yann@1
    52
--- gcc-4.0.4.orig/gcc/config.gcc	2007-02-02 19:24:50.000000000 +0100
yann@1
    53
+++ gcc-4.0.4/gcc/config.gcc	2007-02-02 19:26:12.000000000 +0100
yann@1
    54
@@ -672,6 +672,11 @@
yann@1
    55
 	;;
yann@1
    56
 arm*-*-linux*)			# ARM GNU/Linux with ELF
yann@1
    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"
yann@1
    58
+	case $target in
yann@1
    59
+	arm*b-*)
yann@1
    60
+		tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
yann@1
    61
+		;;
yann@1
    62
+	esac
yann@1
    63
 	tmake_file="${tmake_file} arm/t-arm arm/t-linux"
yann@1
    64
 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
yann@1
    65
 	gnu_ld=yes