summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2007-04-26 13:16:46 +0000
committerMarc Kleine-Budde <mkl@pengutronix.de>2007-04-26 13:16:46 +0000
commita206d7dcf4c343a9a34512aaaed2448f7b628897 (patch)
tree329581374654d2ac36751522b39102c3297ecaa9
parentcafc416c47cb9bc73342165bc69ea21d336e06c6 (diff)
downloadOSELAS.Toolchain-a206d7dcf4c343a9a34512aaaed2448f7b628897.tar.gz
OSELAS.Toolchain-a206d7dcf4c343a9a34512aaaed2448f7b628897.tar.xz
git-svn-id: https://svn.pengutronix.de/svn/oselas/toolchain/branches/OSELAS.Toolchain-1.1-branch@2664 f8d472c7-5700-0410-ac5a-87979cec3adf
-rw-r--r--patches/gcc-4.2-20070316/generic/arm-softfloat.diff38
-rw-r--r--patches/gcc-4.2-20070316/generic/gcc-4.1.1_gcc_c_incpath-no-host-includes.diff52
-rw-r--r--patches/gcc-4.2-20070316/generic/gcc-4.2-arm-bigendian.patch127
-rw-r--r--patches/gcc-4.2-20070316/generic/series4
4 files changed, 221 insertions, 0 deletions
diff --git a/patches/gcc-4.2-20070316/generic/arm-softfloat.diff b/patches/gcc-4.2-20070316/generic/arm-softfloat.diff
new file mode 100644
index 0000000..1c69419
--- /dev/null
+++ b/patches/gcc-4.2-20070316/generic/arm-softfloat.diff
@@ -0,0 +1,38 @@
+Index: gcc-4.2-20061031/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.2-20061031.orig/gcc/config/arm/linux-elf.h
++++ gcc-4.2-20061031/gcc/config/arm/linux-elf.h
+@@ -54,7 +54,7 @@
+
+ #undef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
++ { "marm", TARGET_ENDIAN_OPTION, "msoft-float" "mhard-float", "mno-thumb-interwork" }
+
+ /* Now we define the strings used to build the spec file. */
+ #undef LIB_SPEC
+@@ -63,7 +63,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
+Index: gcc-4.2-20061031/gcc/config/arm/t-linux
+===================================================================
+--- gcc-4.2-20061031.orig/gcc/config/arm/t-linux
++++ gcc-4.2-20061031/gcc/config/arm/t-linux
+@@ -4,7 +4,10 @@ TARGET_LIBGCC2_CFLAGS = -fomit-frame-poi
+ LIBGCC2_DEBUG_CFLAGS = -g0
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
++ _fixsfsi _fixunssfsi _floatdidf _floatdisf
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
diff --git a/patches/gcc-4.2-20070316/generic/gcc-4.1.1_gcc_c_incpath-no-host-includes.diff b/patches/gcc-4.2-20070316/generic/gcc-4.1.1_gcc_c_incpath-no-host-includes.diff
new file mode 100644
index 0000000..0648c44
--- /dev/null
+++ b/patches/gcc-4.2-20070316/generic/gcc-4.1.1_gcc_c_incpath-no-host-includes.diff
@@ -0,0 +1,52 @@
+#
+# Submitted-By: Marc Kleine-Budde, 2006-11-03
+#
+# Error:
+#
+# No error :)
+# With this patch gcc bails out if you include a host include path into the searchlist (-I)
+#
+# Description:
+#
+# inspired by:
+# http://www.openembedded.org/repo/org.openembedded.dev/packages/gcc/gcc-4.1.1/zecke-no-host-includes.patch
+#
+Index: gcc-4.2-20061031/gcc/c-incpath.c
+===================================================================
+--- gcc-4.2-20061031.orig/gcc/c-incpath.c
++++ gcc-4.2-20061031/gcc/c-incpath.c
+@@ -359,6 +359,34 @@ add_path (char *path, int chain, int cxx
+ p->construct = 0;
+ p->user_supplied_p = user_supplied_p;
+
++#ifdef CROSS_COMPILE
++ /* A common error when cross compiling is including
++ host headers. This code below will try to fail fast
++ for cross compiling. Currently we consider /usr/include,
++ /opt/include and /sw/include as harmful. */
++ {
++ unsigned int i;
++ const char *bad_path[] = {
++ "/usr/include",
++ "/usr/local/include",
++ "/sw/include",
++ "/opt/include",
++ };
++
++ for (i = 0; i < sizeof(bad_path)/sizeof(bad_path[0]); i++) {
++ if( strstr(p->name, bad_path[i]) == p->name ) {
++ fprintf(stderr,_("\n"
++ "CROSS COMPILE Badness: %s in INCLUDEPATH: %s\n"
++ "\n"),
++
++ bad_path[i], p->name);
++
++ exit (FATAL_EXIT_CODE);
++ }
++ }
++ }
++#endif
++
+ add_cpp_dir_path (p, chain);
+ }
+
diff --git a/patches/gcc-4.2-20070316/generic/gcc-4.2-arm-bigendian.patch b/patches/gcc-4.2-20070316/generic/gcc-4.2-arm-bigendian.patch
new file mode 100644
index 0000000..de56a5a
--- /dev/null
+++ b/patches/gcc-4.2-20070316/generic/gcc-4.2-arm-bigendian.patch
@@ -0,0 +1,127 @@
+By Lennert Buytenhek <buytenh@wantstofly.org>
+Adds support for arm*b-linux* big-endian ARM targets
+
+See http://gcc.gnu.org/PR16350
+
+Index: gcc-4.2-20061031/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.2-20061031.orig/gcc/config/arm/linux-elf.h
++++ gcc-4.2-20061031/gcc/config/arm/linux-elf.h
+@@ -28,19 +28,33 @@
+ #undef TARGET_VERSION
+ #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
+
++/*
++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
++ * (big endian) configurations.
++ */
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
++#define TARGET_ENDIAN_OPTION "mbig-endian"
++#define TARGET_LINKER_EMULATION "armelfb_linux"
++#else
++#define TARGET_ENDIAN_DEFAULT 0
++#define TARGET_ENDIAN_OPTION "mlittle-endian"
++#define TARGET_LINKER_EMULATION "armelf_linux"
++#endif
++
+ #undef TARGET_DEFAULT_FLOAT_ABI
+ #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
+
+ #undef TARGET_DEFAULT
+-#define TARGET_DEFAULT (0)
++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
+
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
+
+-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
+
+ #undef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
++ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
+
+ /* Now we define the strings used to build the spec file. */
+ #undef LIB_SPEC
+@@ -61,7 +75,7 @@
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
+ -X \
+- %{mbig-endian:-EB}" \
++ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
+ SUBTARGET_EXTRA_LINK_SPEC
+
+ #undef LINK_SPEC
+Index: gcc-4.2-20061031/gcc/config.gcc
+===================================================================
+--- gcc-4.2-20061031.orig/gcc/config.gcc
++++ gcc-4.2-20061031/gcc/config.gcc
+@@ -697,6 +697,11 @@ arm*-*-netbsd*)
+ ;;
+ arm*-*-linux*) # ARM GNU/Linux with ELF
+ tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
++ case $target in
++ arm*b-*)
++ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
++ ;;
++ esac
+ tmake_file="${tmake_file} t-linux arm/t-arm"
+ case ${target} in
+ arm*-*-linux-*eabi)
+Index: gcc-4.2-20061031/gcc/config/arm/linux-eabi.h
+===================================================================
+--- gcc-4.2-20061031.orig/gcc/config/arm/linux-eabi.h
++++ gcc-4.2-20061031/gcc/config/arm/linux-eabi.h
+@@ -20,6 +20,17 @@
+ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
++/*
++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
++ * (big endian) configurations.
++ */
++#undef TARGET_LINKER_EMULATION
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_LINKER_EMULATION "armelfb_linux_eabi"
++#else
++#define TARGET_LINKER_EMULATION "armelf_linux_eabi"
++#endif
++
+ /* On EABI GNU/Linux, we want both the BPABI builtins and the
+ GNU/Linux builtins. */
+ #undef TARGET_OS_CPP_BUILTINS
+@@ -48,7 +59,7 @@
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
+
+ #undef SUBTARGET_EXTRA_LINK_SPEC
+-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION
+
+ /* Use ld-linux.so.3 so that it will be possible to run "classic"
+ GNU/Linux binaries on an EABI system. */
+Index: gcc-4.2-20061031/gcc/config/arm/bpabi.h
+===================================================================
+--- gcc-4.2-20061031.orig/gcc/config/arm/bpabi.h
++++ gcc-4.2-20061031/gcc/config/arm/bpabi.h
+@@ -33,9 +33,19 @@
+ #undef FPUTYPE_DEFAULT
+ #define FPUTYPE_DEFAULT FPUTYPE_VFP
+
++/*
++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
++ * (big endian) configurations.
++ */
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
++#else
++#define TARGET_ENDIAN_DEFAULT 0
++#endif
++
+ /* EABI targets should enable interworking by default. */
+ #undef TARGET_DEFAULT
+-#define TARGET_DEFAULT MASK_INTERWORK
++#define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT)
+
+ /* The ARM BPABI functions return a boolean; they use no special
+ calling convention. */
diff --git a/patches/gcc-4.2-20070316/generic/series b/patches/gcc-4.2-20070316/generic/series
new file mode 100644
index 0000000..77ebc1f
--- /dev/null
+++ b/patches/gcc-4.2-20070316/generic/series
@@ -0,0 +1,4 @@
+gcc-4.1.1_gcc_c_incpath-no-host-includes.diff
+
+gcc-4.2-arm-bigendian.patch
+arm-softfloat.diff