gcc csl 2008q1: make it look more like other gcc recipes
authorKoen Kooi <koen@openembedded.org>
Mon, 12 May 2008 09:10:02 +0000 (09:10 +0000)
committerKoen Kooi <koen@openembedded.org>
Mon, 12 May 2008 09:10:02 +0000 (09:10 +0000)
packages/gcc/gcc-cross-initial_csl-arm-2008q1.bb
packages/gcc/gcc-cross_csl-arm-2008q1.bb
packages/gcc/gcc-csl-arm-2008q1.inc
packages/gcc/gcc-csl-arm/arm-nolibfloat.patch [new file with mode: 0644]
packages/gcc/gcc-csl-arm/arm-softfloat.patch [new file with mode: 0644]
packages/gcc/gcc-csl-arm/cache-amnesia.patch [new file with mode: 0644]
packages/gcc/gcc-csl-arm/zecke-no-host-includes.patch [new file with mode: 0644]

index c9f03a7..99656db 100644 (file)
@@ -4,3 +4,9 @@ require gcc-cross-initial.inc
 S = "${WORKDIR}/gcc-4.2"
 
 EXTRA_OECONF += "--disable-libssp --disable-bootstrap --disable-libgomp --disable-libmudflap "
+
+# Hack till we fix *libc properly
+do_stage_append() {
+       ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
+}
+
index 0024263..cdee2f8 100644 (file)
@@ -1,9 +1,12 @@
 PR = "r0"
 
-FORTRAN = ",fortran"
-
 require gcc-csl-arm-2008q1.inc
-require gcc-cross.inc
+require gcc-cross4.inc
 require gcc-configure-cross.inc
 require gcc-package-cross.inc
 
+SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 "
+
+EXTRA_OECONF += "--disable-libunwind-exceptions --with-mpfr=${STAGING_DIR_NATIVE}${layout_exec_prefix}"
+
+ARCH_FLAGS_FOR_TARGET += "-L${STAGING_DIR_TARGET}${layout_libdir} -isystem${STAGING_DIR_TARGET}${layout_includedir}"
index bca80c0..b51b5e5 100644 (file)
@@ -7,6 +7,8 @@ FILESDIR = "${FILE_DIRNAME}/gcc-csl-arm"
 
 SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/arm-none-eabi/arm-2008q1-126-arm-none-eabi.src.tar.bz2 \
            file://gcc41-configure.in.patch;patch=1 \
+           file://arm-nolibfloat.patch;patch=1 \
+           file://arm-softfloat.patch;patch=1 \
            file://ldflags.patch;patch=1 \
            file://zecke-xgcc-cpp.patch;patch=1 \
            file://gfortran.patch;patch=1 \
@@ -22,4 +24,12 @@ do_unpack2() {
        tar -xvjf ./arm-2008q1-126-arm-none-eabi/gcc-2008q1-126.tar.bz2
 }
 
+# Language Overrides
+FORTRAN = ""
+FORTRAN_linux-gnueabi = ",fortran"
+JAVA = ",java"
+
+EXTRA_OECONF_BASE = "--disable-libssp --disable-bootstrap --disable-libgomp --disable-libmudflap"
+ARM_INSTRUCTION_SET = "arm"
+
 addtask unpack2 after do_unpack before do_patch
diff --git a/packages/gcc/gcc-csl-arm/arm-nolibfloat.patch b/packages/gcc/gcc-csl-arm/arm-nolibfloat.patch
new file mode 100644 (file)
index 0000000..c4897c0
--- /dev/null
@@ -0,0 +1,24 @@
+# Dimitry Andric <dimitry@andric.com>, 2004-05-01
+#
+# * Removed the extra -lfloat option from LIBGCC_SPEC, since it isn't needed
+#   anymore.  (The required functions are now in libgcc.)
+# 
+# Fixes errors like
+# arm-softfloat-linux-gnu/3.4.0/../../../../arm-softfloat-linux-gnu/bin/ld: cannot find -lfloat
+# collect2: ld returned 1 exit status
+# make[2]: *** [arm-softfloat-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/iconvdata/ISO8859-1.so] Error 1
+# when building glibc-2.3.3 with gcc-3.4.0 for arm-softfloat
+
+Index: gcc-4.0.2/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.0.2.orig/gcc/config/arm/linux-elf.h  2005-03-04 16:14:01.000000000 +0000
++++ gcc-4.0.2/gcc/config/arm/linux-elf.h       2005-11-11 18:02:54.000000000 +0000
+@@ -56,7 +56,7 @@
+    %{shared:-lc} \
+    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+ /* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
+    the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
diff --git a/packages/gcc/gcc-csl-arm/arm-softfloat.patch b/packages/gcc/gcc-csl-arm/arm-softfloat.patch
new file mode 100644 (file)
index 0000000..5e1edd9
--- /dev/null
@@ -0,0 +1,16 @@
+Index: gcc-4.0.2/gcc/config/arm/t-linux
+===================================================================
+--- gcc-4.0.2.orig/gcc/config/arm/t-linux      2004-05-15 12:41:35.000000000 +0000
++++ gcc-4.0.2/gcc/config/arm/t-linux   2005-11-11 16:07:53.000000000 +0000
+@@ -4,7 +4,10 @@
+ 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 _floatundisf _floatundidf
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
diff --git a/packages/gcc/gcc-csl-arm/cache-amnesia.patch b/packages/gcc/gcc-csl-arm/cache-amnesia.patch
new file mode 100644 (file)
index 0000000..ef7cd11
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/gcc/configure b/gcc/configure
+index 44620ab..6e1830c 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -12272,7 +12272,7 @@ else
+       esac
+       saved_CFLAGS="${CFLAGS}"
+       CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
+-      ${realsrcdir}/configure \
++      CONFIG_SITE= ${realsrcdir}/configure --cache-file=./other.cache \
+               --enable-languages=${enable_languages-all} \
+               --target=$target_alias --host=$build_alias --build=$build_alias
+       CFLAGS="${saved_CFLAGS}"
diff --git a/packages/gcc/gcc-csl-arm/zecke-no-host-includes.patch b/packages/gcc/gcc-csl-arm/zecke-no-host-includes.patch
new file mode 100644 (file)
index 0000000..6afb10d
--- /dev/null
@@ -0,0 +1,31 @@
+Index: gcc-4.0.2/gcc/c-incpath.c
+===================================================================
+--- gcc-4.0.2.orig/gcc/c-incpath.c     2005-01-23 16:05:27.000000000 +0100
++++ gcc-4.0.2/gcc/c-incpath.c  2006-05-15 21:23:02.000000000 +0200
+@@ -350,6 +350,26 @@
+   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.  */
++      {
++              /* printf("Adding Path: %s\n", p->name ); */
++              if( strstr(p->name, "/usr/include" ) == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /usr/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++              } else if( strstr(p->name, "/sw/include") == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /sw/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++              } else if( strstr(p->name, "/opt/include") == p->name ) {
++                      fprintf(stderr, _("CROSS COMPILE Badness: /opt/include in INCLUDEPATH: %s\n"), p->name);
++                      abort();
++               }
++      }
++#endif
++
+   add_cpp_dir_path (p, chain);
+ }