diff options
-rw-r--r-- | packages/gcc/files/canadian-build-modules-configure.patch | 22 | ||||
-rw-r--r-- | packages/gcc/files/pr22133-mingw-path-fixup.patch | 29 | ||||
-rw-r--r-- | packages/gcc/files/pr33281-mingw-host-fragment.patch | 38 | ||||
-rw-r--r-- | packages/gcc/files/pr35916-mingw-__USE_MINGW_ACCESS-everywhere.patch | 13 | ||||
-rw-r--r-- | packages/gcc/gcc-canadian-cross-initial.inc | 4 | ||||
-rw-r--r-- | packages/gcc/gcc-canadian-sdk_4.2.4.bb | 31 | ||||
-rw-r--r-- | packages/gcc/gcc-configure-canadian-sdk.inc | 83 | ||||
-rw-r--r-- | packages/gcc/gcc-package-canadian-sdk.inc | 39 |
8 files changed, 259 insertions, 0 deletions
diff --git a/packages/gcc/files/canadian-build-modules-configure.patch b/packages/gcc/files/canadian-build-modules-configure.patch new file mode 100644 index 0000000000..8aede105c5 --- /dev/null +++ b/packages/gcc/files/canadian-build-modules-configure.patch @@ -0,0 +1,22 @@ +diff -urN gcc-4.2.2-orig/gcc/configure gcc-4.2.2/gcc/configure +--- gcc-4.2.2-orig/gcc/configure 2008-08-31 23:10:56.000000000 +0200 ++++ gcc-4.2.2/gcc/configure 2008-08-31 23:03:02.000000000 +0200 +@@ -12716,6 +12716,7 @@ + esac + saved_CFLAGS="${CFLAGS}" + CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ ++ CPP="${CPP_FOR_BUILD}" CPPFLAGS="${CPPFLAGS_FOR_BUILD}" \ + CONFIG_SITE= ${realsrcdir}/configure --cache-file=./other.cache \ + --enable-languages=${enable_languages-all} \ + --target=$target_alias --host=$build_alias --build=$build_alias +diff -urN gcc-4.2.2-orig/gcc/configure.ac gcc-4.2.2/gcc/configure.ac +--- gcc-4.2.2-orig/gcc/configure.ac 2008-08-31 23:10:53.000000000 +0200 ++++ gcc-4.2.2/gcc/configure.ac 2008-08-31 23:03:29.000000000 +0200 +@@ -1490,6 +1490,7 @@ + esac + saved_CFLAGS="${CFLAGS}" + CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ ++ CPP="${CPP_FOR_BUILD}" CPPFLAGS="${CPPFLAGS_FOR_BUILD}" \ + ${realsrcdir}/configure \ + --enable-languages=${enable_languages-all} \ + --target=$target_alias --host=$build_alias --build=$build_alias diff --git a/packages/gcc/files/pr22133-mingw-path-fixup.patch b/packages/gcc/files/pr22133-mingw-path-fixup.patch new file mode 100644 index 0000000000..429e9ffd0c --- /dev/null +++ b/packages/gcc/files/pr22133-mingw-path-fixup.patch @@ -0,0 +1,29 @@ +diff -rupN gcc-4.2.orig/gcc/c-incpath.c gcc-4.2/gcc/c-incpath.c +--- gcc-4.2.orig/gcc/c-incpath.c 2007-09-01 11:28:30.000000000 -0400 ++++ gcc-4.2/gcc/c-incpath.c 2008-08-17 16:56:01.000000000 -0400 +@@ -340,13 +340,18 @@ add_path (char *path, int chain, int cxx + cpp_dir *p; + + #if defined (HAVE_DOS_BASED_FILE_SYSTEM) +- /* Convert all backslashes to slashes. The native CRT stat() +- function does not recognize a directory that ends in a backslash +- (unless it is a drive root dir, such "c:\"). Forward slashes, +- trailing or otherwise, cause no problems for stat(). */ +- char* c; +- for (c = path; *c; c++) +- if (*c == '\\') *c = '/'; ++ /* Remove unnecessary trailing slashes. On some versions of MS ++ Windows, trailing _forward_ slashes cause no problems for stat(). ++ On newer versions, stat() does not recognise a directory that ends ++ in a '\\' or '/', unless it is a drive root dir, such as "c:/", ++ where it is obligatory. */ ++ int pathlen = strlen (path); ++ char* end = path + pathlen - 1; ++ /* Preserve the lead '/' or lead "c:/". */ ++ char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1); ++ ++ for (; end > start && IS_DIR_SEPARATOR (*end); end--) ++ *end = 0; + #endif + + p = XNEW (cpp_dir); diff --git a/packages/gcc/files/pr33281-mingw-host-fragment.patch b/packages/gcc/files/pr33281-mingw-host-fragment.patch new file mode 100644 index 0000000000..e16fb4464a --- /dev/null +++ b/packages/gcc/files/pr33281-mingw-host-fragment.patch @@ -0,0 +1,38 @@ +--- + config/mh-mingw | 3 +++ + configure | 1 + + configure.in | 1 + + 3 files changed, 5 insertions(+) + +Index: gcc-4.2.3/config/mh-mingw +=================================================================== +--- /dev/null ++++ gcc-4.2.3/config/mh-mingw +@@ -0,0 +1,3 @@ ++# Add -D__USE_MINGW_ACCESS to enable the built compiler to work on Windows ++# Vista (see PR33281 for details). ++BOOT_CFLAGS += -D__USE_MINGW_ACCESS +Index: gcc-4.2.3/configure.in +=================================================================== +--- gcc-4.2.3.orig/configure.in ++++ gcc-4.2.3/configure.in +@@ -929,6 +929,7 @@ case "${host}" in + host_makefile_frag="config/mh-cygwin" + ;; + *-mingw32*) ++ host_makefile_frag="config/mh-mingw" + ;; + *-interix*) + host_makefile_frag="config/mh-interix" +Index: gcc-4.2.3/configure +=================================================================== +--- gcc-4.2.3.orig/configure ++++ gcc-4.2.3/configure +@@ -1769,6 +1769,7 @@ case "${host}" in + host_makefile_frag="config/mh-cygwin" + ;; + *-mingw32*) ++ host_makefile_frag="config/mh-mingw" + ;; + *-interix*) + host_makefile_frag="config/mh-interix" diff --git a/packages/gcc/files/pr35916-mingw-__USE_MINGW_ACCESS-everywhere.patch b/packages/gcc/files/pr35916-mingw-__USE_MINGW_ACCESS-everywhere.patch new file mode 100644 index 0000000000..faf44c27f9 --- /dev/null +++ b/packages/gcc/files/pr35916-mingw-__USE_MINGW_ACCESS-everywhere.patch @@ -0,0 +1,13 @@ +--- + config/mh-mingw | 1 + + 1 file changed, 1 insertion(+) + +Index: gcc-4.2.3/config/mh-mingw +=================================================================== +--- gcc-4.2.3.orig/config/mh-mingw ++++ gcc-4.2.3/config/mh-mingw +@@ -1,3 +1,4 @@ + # Add -D__USE_MINGW_ACCESS to enable the built compiler to work on Windows + # Vista (see PR33281 for details). + BOOT_CFLAGS += -D__USE_MINGW_ACCESS ++CFLAGS += -D__USE_MINGW_ACCESS diff --git a/packages/gcc/gcc-canadian-cross-initial.inc b/packages/gcc/gcc-canadian-cross-initial.inc new file mode 100644 index 0000000000..99c7a476ef --- /dev/null +++ b/packages/gcc/gcc-canadian-cross-initial.inc @@ -0,0 +1,4 @@ +require gcc-cross-initial.inc + +DEPENDS = "virtual/${TARGET_PREFIX}binutils" +DEPENDS += "virtual/${TARGET_PREFIX}libc-initial" diff --git a/packages/gcc/gcc-canadian-sdk_4.2.4.bb b/packages/gcc/gcc-canadian-sdk_4.2.4.bb new file mode 100644 index 0000000000..03d9ae364a --- /dev/null +++ b/packages/gcc/gcc-canadian-sdk_4.2.4.bb @@ -0,0 +1,31 @@ +inherit canadian-sdk + +PR = "r1" + +FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/gcc-${PV}" + +PACKAGES = "${PN}" + +require gcc-${PV}.inc + +# Correct gmp / mpfr +DEPENDS = "gmp-canadian mpfr-canadian" + +require gcc-configure-canadian-sdk.inc +require gcc-package-canadian-sdk.inc + +SRC_URI_append = "file://fortran-cross-compile-hack.patch;patch=1 \ + file://pr22133-mingw-path-fixup.patch;patch=1 \ + file://pr33281-mingw-host-fragment.patch;patch=1 \ + file://pr35916-mingw-__USE_MINGW_ACCESS-everywhere.patch;patch=1" + +ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}" + + +SRC_URI_append =+ "\ + file://canadian-build-modules-configure.patch;patch=1 \ +" + +EXTRA_OECONF += "--disable-libunwind-exceptions --disable-libssp \ + --disable-libgomp --disable-libmudflap \ + --with-mpfr=${STAGING_LIBDIR}" diff --git a/packages/gcc/gcc-configure-canadian-sdk.inc b/packages/gcc/gcc-configure-canadian-sdk.inc new file mode 100644 index 0000000000..489cb46371 --- /dev/null +++ b/packages/gcc/gcc-configure-canadian-sdk.inc @@ -0,0 +1,83 @@ +require gcc-configure-common.inc + +USE_NLS = '${@base_conditional( "TARGET_OS", "linux-uclibc", "no", "", d )}' +USE_NLS = '${@base_conditional( "TARGET_OS", "linux-uclibcgnueabi", "no", "", d )}' + +ARCH_FLAGS_FOR_TARGET="" + +# Tools for build +export CC_FOR_BUILD="${BUILD_CC}" +export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}" +export CPP_FOR_BUILD="${BUILD_CPP}" +export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}" +export CXX_FOR_BUILD="${BUILD_CXX}" +export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}" +export LD_FOR_BUILD="${BUILD_LD}" +export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" +export AS_FOR_BUILD="${BUILD_PREFIX}as" +export AR_FOR_BUILD="${BUILD_PREFIX}ar" +export NM_FOR_BUILD="${BUILD_PREFIX}nm" +export RANLIB_FOR_BUILD="${BUILD_PREFIX}ranlib" +export GCJ_FOR_BUILD="${BUILD_PREFIX}gcj" +export GFORTRAN_FOR_BUILD="${BUILD_PREFIX}gfortran" +export DLLTOOL_FOR_BUILD="${BUILD_PREFIX}dlltool" +export WINDRES_FOR_BUILD="${BUILD_PREFIX}windres" + +# Tools for host +#CC +#CFLAGS +#CXX +#CXXFLAGS +#LD +LDFLAGS="" +#AS +#AR +#NM +#RANLIB +#GCJ +#GFORTRAN +export DLLTOOL="${HOST_PREFIX}dlltool" +export WINDRES="${HOST_PREFIX}windres" + +# Tools for target +export CC_FOR_TARGET="${TARGET_CC}" +export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}" +export CXX_FOR_TARGET="${TARGET_CXX}" +export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" +export LD_FOR_TARGET="${TARGET_LD}" +export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" +export AS_FOR_TARGET="${TARGET_PREFIX}as" +export AR_FOR_TARGET="${TARGET_PREFIX}ar" +export NM_FOR_TARGET="${TARGET_PREFIX}nm" +export RANLIB_FOR_TARGET="${TARGET_PREFIX}ranlib" +export GCJ_FOR_TARGET="${TARGET_PREFIX}gcj" +export GFORTRAN_FOR_TARGET="${TARGET_PREFIX}gfortran" +export DLLTOOL_FOR_TARGET="${TARGET_PREFIX}dlltool" +export WINDRES_FOR_TARGET="${TARGET_PREFIX}windres" + +EXTRA_OECONF_DEP ?= "" + +SYSROOT = "${WORKDIR}/sysroot" +EXTRA_OECONF += "" +EXTRA_OECONF_PATHS = " \ + --with-local-prefix=$dollar{prefix}/local \ + --with-gxx-include-dir=$dollar{prefix}/${TARGET_SYS}/usr/include/c++/${BINV} \ + --with-build-sysroot=${SYSROOT} \ + --with-sysroot=${SDK_REALPATH}/${TARGET_SYS} \ +" + +do_configure () { + # Work around Hardcoded path assumptions in gcc + mkdir -p ${SYSROOT}/usr + ln -sf ${STAGING_DIR_HOST}${layout_includedir} \ + ${SYSROOT}/usr/include + ln -sf ${STAGING_DIR_HOST}${layout_libdir} \ + ${SYSROOT}/usr/lib + (cd ${S} && gnu-configize) || die "failure running gnu-configize" + (cd ${S}/libstdc++-v3 && autoreconf) + canadian_sdk_runconf +} + +do_compile () { + oe_runmake +} diff --git a/packages/gcc/gcc-package-canadian-sdk.inc b/packages/gcc/gcc-package-canadian-sdk.inc new file mode 100644 index 0000000000..dff53cdd96 --- /dev/null +++ b/packages/gcc/gcc-package-canadian-sdk.inc @@ -0,0 +1,39 @@ +require gcc-package-sdk.inc + +PACKAGES += "libgcc libgcc-dev libgfortran-dev libmudflap libmudflap-dev" + +FILES_libgcc = "${libdir}/libgcc*.so.*" +FILES_libgcc-dev = "${libdir}/libgcc*.so" + +FILES_libstdc++ = "${libdir}/libstdc++.so.*" +FILES_libstdc++-dev = "\ + ${incluedir}/c++/${BINV} \ + ${libdir}/libstdc++.so \ + ${libdir}/libstdc++.la \ + ${libdir}/libstdc++.a \ + ${libdir}/libsupc++.la \ + ${libdir}/libsupc++.a \ +" + +FILES_libgfortran-dev = "${libdir}/libgfortran.a \ + ${libdir}/libgfortran.so \ + ${libdir}/libgfortranbegin.a" + +FILES_libmudflap = "${libdir}/libmudflap*.so.*" +FILES_libmudflap-dev = "\ + ${libdir}/libmudflap*.so \ + ${libdir}/libmudflap*.a \ + ${libdir}/libmudflap*.a \ +" + +# Packages emitted by our gcc-cross builds. +# +INHIBIT_PACKAGE_STRIP ?= "" +OLD_INHIBIT_PACKAGE_STRIP := "${INHIBIT_PACKAGE_STRIP}" +INHIBIT_PACKAGE_STRIP = "1" + +python do_package() { + if bb.data.getVar('DEBIAN_NAMES', d, 1): + bb.data.setVar('PKG_libgcc', 'libgcc1', d) + bb.build.exec_func('package_do_package', d) +} |