diff options
author | Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> | 2013-03-13 14:40:56 +0100 |
---|---|---|
committer | Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> | 2013-03-13 14:43:50 +0100 |
commit | 12a612e83924ad5f9ddf2f41df41c35eb744a3fc (patch) | |
tree | 47f4866ca9725ff853c9efef1dde7bbb985c52b5 /meta-linaro-toolchain | |
parent | a9d70669d6a9d2e80a01182c732336be0cd5513b (diff) | |
download | meta-linaro-12a612e83924ad5f9ddf2f41df41c35eb744a3fc.tar.gz |
move toolchain components into meta-linaro-toolchain
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Diffstat (limited to 'meta-linaro-toolchain')
33 files changed, 1018 insertions, 0 deletions
diff --git a/meta-linaro-toolchain/conf/distro/include/external-linaro-toolchain-versions.inc b/meta-linaro-toolchain/conf/distro/include/external-linaro-toolchain-versions.inc new file mode 100644 index 00000000..6b5a6fb7 --- /dev/null +++ b/meta-linaro-toolchain/conf/distro/include/external-linaro-toolchain-versions.inc @@ -0,0 +1,108 @@ +def elt_run(d, cmd, *args): + import bb.process + import subprocess + + topdir = d.getVar('TOPDIR', True) + toolchain_path = d.getVar('EXTERNAL_TOOLCHAIN', True) + if not toolchain_path: + return 'UNKNOWN', 'UNKNOWN' + + target_prefix = d.getVar('TARGET_PREFIX', True) + path = os.path.join(toolchain_path, 'bin', target_prefix + cmd) + args = [path] + list(args) + + return bb.process.run(args, cwd=topdir, stderr=subprocess.PIPE) + +def elt_get_version(d): + try: + stdout, stderr = elt_run(d, 'gcc', '-v') + except bb.process.CmdError as exc: + bb.error('Failed to obtain external Linaro toolchain version: %s' % exc) + return 'UNKNOWN' + else: + last_line = stderr.splitlines()[-1] + return last_line + +def elt_get_main_version(d): + version = elt_get_version(d) + if version != 'UNKNOWN': + return version.split()[-1].rstrip(')') + else: + return version + +def elt_get_gcc_version(d): + version = elt_get_version(d) + if version != 'UNKNOWN': + return version.split()[2] + else: + return version + +def elt_get_libc_version(d): + import os,bb + syspath = bb.data.expand('${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}', d) + if not syspath: + return 'UNKNOWN' + + libpath = syspath + '/libc/lib/${ELT_TARGET_SYS}/' + + if os.path.exists(libpath): + for file in os.listdir(libpath): + if file.find('libc-') == 0: + return file[5:-3] + + libpath = syspath + '/libc/lib/' + + if os.path.exists(libpath): + for file in os.listdir(libpath): + if file.find('libc-') == 0: + return file[5:-3] + return 'UNKNOWN' + +def elt_get_kernel_version(d): + import os,bb + syspath = bb.data.expand('${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}', d) + if not syspath: + return 'UNKNOWN' + + vf = syspath + '/libc/usr/include/linux/version.h' + + try: + f = open(vf, 'r') + except (OSError, IOError): + return 'UNKNOWN' + + l = f.readlines(); + f.close(); + for s in l: + if s.find('LINUX_VERSION_CODE') > 0: + ver = int(s.split()[2]) + maj = ver / 65536 + ver = ver % 65536 + min = ver / 256 + ver = ver % 256 + return str(maj)+'.'+str(min)+'.'+str(ver) + return 'UNKNOWN' + +def elt_get_gdb_version(d): + try: + stdout, stderr = elt_run(d, 'gdb', '-v') + except CmdError: + return 'UNKNOWN' + else: + first_line = stdout.splitlines()[0] + return first_line.split()[-1] + +python external_linaro_toolchain_version_handler () { + if not isinstance(e, bb.event.ConfigParsed): + return + d = e.data + ld = d.createCopy() + ld.finalize() + + d.setVar('ELT_VER_MAIN', elt_get_main_version(ld)) + d.setVar('ELT_VER_GCC', elt_get_gcc_version(ld)) + d.setVar('ELT_VER_LIBC', elt_get_libc_version(ld)) + d.setVar('ELT_VER_KERNEL', elt_get_kernel_version(ld)) + d.setVar('ELT_VER_GDB', elt_get_gdb_version(ld)) +} +addhandler external_linaro_toolchain_version_handler diff --git a/meta-linaro-toolchain/conf/distro/include/tcmode-external-linaro.inc b/meta-linaro-toolchain/conf/distro/include/tcmode-external-linaro.inc new file mode 100644 index 00000000..284fb8bc --- /dev/null +++ b/meta-linaro-toolchain/conf/distro/include/tcmode-external-linaro.inc @@ -0,0 +1,68 @@ +# +# Configuration to use an external Linaro binary toolchain +# + +EXTERNAL_TOOLCHAIN ?= "/usr/local/linaro-binary-toolchain/${TARGET_ARCH}" + +TOOLCHAIN_PATH_ADD = "${EXTERNAL_TOOLCHAIN}/bin:" +PATH =. "${TOOLCHAIN_PATH_ADD}" + +ELT_TARGET_SYS ?= "arm-linux-gnueabihf" +TARGET_PREFIX = "${ELT_TARGET_SYS}-" + +PREFERRED_PROVIDER_linux-libc-headers = "external-linaro-toolchain" +PREFERRED_PROVIDER_linux-libc-headers-dev = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++ = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs = "external-linaro-toolchain" +PREFERRED_PROVIDER_libgcc = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/libc = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/libintl = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/libiconv = "external-linaro-toolchain" +PREFERRED_PROVIDER_glibc-thread-db = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/linux-libc-headers = "external-linaro-toolchain" + +TARGET_CPPFLAGS_prepend = " -isystem${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/include " +TARGET_LDFLAGS_prepend = " -L${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/lib -Wl,-rpath-link,${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/lib " + +TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_HOST}" + +DISTRO_FEATURES_LIBC = "ipv4 ipv6 libc-backtrace libc-big-macros libc-bsd libc-cxx-tests libc-catgets libc-crypt \ + libc-crypt-ufc libc-db-aliases libc-envz libc-fcvt libc-fmtmsg libc-fstab libc-ftraverse \ + libc-getlogin libc-idn libc-inet-anl libc-libm libc-libm-big \ + libc-memusage libc-nis libc-nsswitch libc-rcmd libc-rtld-debug libc-spawn libc-streams libc-sunrpc \ + libc-utmp libc-utmpx libc-wordexp libc-posix-clang-wchar libc-posix-regexp libc-posix-regexp-glibc \ + libc-posix-wchar-io" + +ENABLE_BINARY_LOCALE_GENERATION = "0" +GLIBC_INTERNAL_USE_BINARY_LOCALE = "precompiled" + +def populate_toolchain_links(d): + import errno + import os + from glob import glob + + d = d.createCopy() + d.finalize() + + pattern = bb.data.expand('${EXTERNAL_TOOLCHAIN}/bin/${TARGET_PREFIX}*', d) + files = glob(pattern) + if not files: + bb.fatal("Unable to populate toolchain binary symlinks") + + bindir = d.getVar('STAGING_BINDIR_TOOLCHAIN', True) + bb.mkdirhier(bindir) + for f in files: + base = os.path.basename(f) + newpath = os.path.join(bindir, base) + try: + os.symlink(f, newpath) + except OSError as exc: + if exc.errno == errno.EEXIST: + break + bb.fatal("Unable to populate toolchain binary symlink for %s: %s" % (newpath, exc)) + +require conf/distro/include/external-linaro-toolchain-versions.inc diff --git a/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/external-linaro-toolchain.bb b/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/external-linaro-toolchain.bb new file mode 100644 index 00000000..83a85324 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/external-linaro-toolchain.bb @@ -0,0 +1,218 @@ +require recipes-core/eglibc/eglibc-package.inc + +INHIBIT_DEFAULT_DEPS = "1" + +# License applies to this recipe code, not the toolchain itself +LICENSE = "MIT" +LIC_FILES_CHKSUM = "\ + file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \ +" + +PROVIDES += "\ + linux-libc-headers \ + virtual/${TARGET_PREFIX}gcc \ + virtual/${TARGET_PREFIX}g++ \ + virtual/${TARGET_PREFIX}gcc-initial \ + virtual/${TARGET_PREFIX}binutils \ + virtual/${TARGET_PREFIX}libc-for-gcc \ + virtual/${TARGET_PREFIX}compilerlibs \ + virtual/libc \ + virtual/libintl \ + virtual/libiconv \ + glibc-thread-db \ + libgcc \ + virtual/linux-libc-headers \ +" +PV = "${ELT_VER_MAIN}" +PR = "r2" + +# https://launchpad.net/linaro-toolchain-binaries +# http://launchpad.net/linaro-toolchain-binaries/trunk/2012.03/+download/gcc-linaro-arm-linux-gnueabi-2012.03-20120326_linux.tar.bz2 +SRC_URI = "file://SUPPORTED" + +do_install() { + install -d ${D}${base_libdir} + install -d ${D}${bindir} + install -d ${D}${sbindir} + install -d ${D}${libdir} + install -d ${D}${libexecdir} + install -d ${D}${datadir} + install -d ${D}${includedir} + + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/lib/* ${D}${base_libdir} + if [ -d ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/lib/${ELT_TARGET_SYS} ]; then + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/lib/${ELT_TARGET_SYS}/* ${D}${base_libdir} + else + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/lib/* ${D}${base_libdir} + fi + if [ -d ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/usr/lib/${ELT_TARGET_SYS} ]; then + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/usr/lib/${ELT_TARGET_SYS}/* ${D}${libdir} + else + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/usr/lib/* ${D}${libdir} + fi + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/usr/share/* ${D}${datadir} + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/usr/include/* ${D}${includedir} + if [ -d ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/usr/include/${ELT_TARGET_SYS} ]; then + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/usr/include/${ELT_TARGET_SYS}/* ${D}${includedir} + + rm -r ${D}${includedir}/${ELT_TARGET_SYS} + fi + + # fix up the copied symlinks (they are still pointing to the multiarch directory) + ln -sf ld-2.13.so ${D}${base_libdir}/ld-linux.so.3 + ln -sf ../../lib/libnsl.so.1 ${D}${libdir}/libnsl.so + ln -sf ../../lib/librt.so.1 ${D}${libdir}/librt.so + ln -sf ../../lib/libcrypt.so.1 ${D}${libdir}/libcrypt.so + ln -sf ../../lib/libnss_nis.so.2 ${D}${libdir}/libnss_nis.so + ln -sf ../../lib/libresolv.so.2 ${D}${libdir}/libresolv.so + ln -sf ../../lib/libnss_dns.so.2 ${D}${libdir}/libnss_dns.so + ln -sf ../../lib/libnss_hesiod.so.2 ${D}${libdir}/libnss_hesiod.so + ln -sf ../../lib/libutil.so.1 ${D}${libdir}/libutil.so + ln -sf ../../lib/libnss_files.so.2 ${D}${libdir}/libnss_files.so + ln -sf ../../lib/libnss_compat.so.2 ${D}${libdir}/libnss_compat.so + ln -sf ../../lib/libcidn.so.1 ${D}${libdir}/libcidn.so + ln -sf ../../lib/libBrokenLocale.so.1 ${D}${libdir}/libBrokenLocale.so + ln -sf ../../lib/libthread_db.so.1 ${D}${libdir}/libthread_db.so + ln -sf ../../lib/libanl.so.1 ${D}${libdir}/libanl.so + ln -sf ../../lib/libdl.so.2 ${D}${libdir}/libdl.so + ln -sf ../../lib/libnss_nisplus.so.2 ${D}${libdir}/libnss_nisplus.so + ln -sf ../../lib/libm.so.6 ${D}${libdir}/libm.so + + if [ -f ${D}${libdir}/libc.so ];then + sed -i -e "s# /lib/${ELT_TARGET_SYS}# ../../lib#g" -e "s# /usr/lib/${ELT_TARGET_SYS}# .#g" ${D}${libdir}/libc.so + fi + if [ -f ${D}${base_libdir}/libc.so ];then + sed -i -e "s# /lib/${ELT_TARGET_SYS}# ../../lib#g" -e "s# /usr/lib/${ELT_TARGET_SYS}# .#g" ${D}${base_libdir}/libc.so + fi + if [ -f ${D}${libdir}/libpthread.so ];then + sed -i -e "s# /lib/${ELT_TARGET_SYS}# ../../lib#g" -e "s# /usr/lib/${ELT_TARGET_SYS}# .#g" ${D}${libdir}/libpthread.so + fi + if [ -f ${D}${base_libdir}/libpthread.so ];then + sed -i -e "s# /lib/${ELT_TARGET_SYS}# ../../lib#g" -e "s# /usr/lib/${ELT_TARGET_SYS}# .#g" ${D}${base_libdir}/libpthread.so + fi +} + +PACKAGES =+ "\ + libgcc \ + libgcc-dev \ + libstdc++ \ + libstdc++-dev \ + libstdc++-staticdev \ + linux-libc-headers \ + linux-libc-headers-dev \ +" + +INSANE_SKIP_${PN}-dbg = "staticdev" +INSANE_SKIP_${PN}-utils += "ldflags" +INSANE_SKIP_libstdc++ += "ldflags" +INSANE_SKIP_libgcc += "ldflags" +INSANE_SKIP_gdbserver += "ldflags" + +PKG_${PN} = "eglibc" +PKG_${PN}-dev = "eglibc-dev" +PKG_${PN}-doc = "eglibc-doc" +PKG_${PN}-dbg = "eglibc-dbg" +PKG_${PN}-pic = "eglibc-pic" +PKG_${PN}-utils = "eglibc-utils" +PKG_${PN}-gconv = "eglibc-gconv" +PKG_${PN}-extra-nss = "eglibc-extra-nss" +PKG_${PN}-thread-db = "eglibc-thread-db" +PKG_${PN}-pcprofile = "eglibc-pcprofile" + +PKGV_${PN} = "${ELT_VER_LIBC}" +PKGV_${PN}-dev = "${ELT_VER_LIBC}" +PKGV_${PN}-doc = "${ELT_VER_LIBC}" +PKGV_${PN}-dbg = "${ELT_VER_LIBC}" +PKGV_${PN}-pic = "${ELT_VER_LIBC}" +PKGV_${PN}-utils = "${ELT_VER_LIBC}" +PKGV_${PN}-gconv = "${ELT_VER_LIBC}" +PKGV_${PN}-extra-nss = "${ELT_VER_LIBC}" +PKGV_${PN}-thread-db = "${ELT_VER_LIBC}" +PKGV_${PN}-pcprofile = "${ELT_VER_LIBC}" +PKGV_catchsegv = "${ELT_VER_LIBC}" +PKGV_libsegfault = "${ELT_VER_LIBC}" +PKGV_sln = "${ELT_VER_LIBC}" +PKGV_nscd = "${ELT_VER_LIBC}" +PKGV_ldd = "${ELT_VER_LIBC}" +PKGV_libgcc = "${ELT_VER_GCC}" +PKGV_libgcc-dev = "${ELT_VER_GCC}" +PKGV_libstdc++ = "${ELT_VER_GCC}" +PKGV_libstdc++-dev = "${ELT_VER_GCC}" +PKGV_libstdc++-staticdev = "${ELT_VER_GCC}" +PKGV_linux-libc-headers = "${ELT_VER_KERNEL}" +PKGV_linux-libc-headers-dev = "${ELT_VER_KERNEL}" +PKGV_gdbserver = "${ELT_VER_GDBSERVER}" + +FILES_libgcc = "${base_libdir}/libgcc_s.so.1" +FILES_libgcc-dev = "${base_libdir}/libgcc_s.so" +FILES_libstdc++ = "${base_libdir}/libstdc++.so.*" +FILES_libstdc++-dev = "\ + ${includedir}/c++/${PV} \ + ${base_libdir}/libstdc++.so \ + ${base_libdir}/libstdc++.a \ + ${base_libdir}/libsupc++.a \ +" +FILES_linux-libc-headers = "\ + ${includedir}/asm* \ + ${includedir}/linux \ + ${includedir}/mtd \ + ${includedir}/rdma \ + ${includedir}/scsi \ + ${includedir}/sound \ + ${includedir}/video \ +" +FILES_${PN} += "\ + ${libdir}/bin \ + ${libdir}/locale \ + ${libdir}/gconv/gconv-modules \ + ${datadir}/zoneinfo \ + ${base_libdir}/libcrypt*.so.* \ + ${base_libdir}/libcrypt-*.so \ + ${base_libdir}/libc.so.* \ + ${base_libdir}/libc-*.so \ + ${base_libdir}/libm*.so.* \ + ${base_libdir}/libm-*.so \ + ${base_libdir}/ld*.so.* \ + ${base_libdir}/ld-*.so \ + ${base_libdir}/libpthread*.so.* \ + ${base_libdir}/libpthread-*.so \ + ${base_libdir}/libresolv*.so.* \ + ${base_libdir}/libresolv-*.so \ + ${base_libdir}/librt*.so.* \ + ${base_libdir}/librt-*.so \ + ${base_libdir}/libutil*.so.* \ + ${base_libdir}/libutil-*.so \ + ${base_libdir}/libnsl*.so.* \ + ${base_libdir}/libnsl-*.so \ + ${base_libdir}/libnss_files*.so.* \ + ${base_libdir}/libnss_files-*.so \ + ${base_libdir}/libnss_compat*.so.* \ + ${base_libdir}/libnss_compat-*.so \ + ${base_libdir}/libnss_dns*.so.* \ + ${base_libdir}/libnss_dns-*.so \ + ${base_libdir}/libnss_nis*.so.* \ + ${base_libdir}/libnss_nisplus-*.so \ + ${base_libdir}/libnss_nisplus*.so.* \ + ${base_libdir}/libnss_nis-*.so \ + ${base_libdir}/libnss_hesiod*.so.* \ + ${base_libdir}/libnss_hesiod-*.so \ + ${base_libdir}/libdl*.so.* \ + ${base_libdir}/libdl-*.so \ + ${base_libdir}/libanl*.so.* \ + ${base_libdir}/libanl-*.so \ + ${base_libdir}/libBrokenLocale*.so.* \ + ${base_libdir}/libBrokenLocale-*.so \ + ${base_libdir}/libcidn*.so.* \ + ${base_libdir}/libcidn-*.so \ + ${base_libdir}/libthread_db*.so.* \ + ${base_libdir}/libthread_db-*.so \ + ${base_libdir}/libmemusage.so \ + ${base_libdir}/libSegFault.so \ + ${base_libdir}/libpcprofile.so \ +" +ELT_VER_MAIN ??= "" + +python () { + if not d.getVar("ELT_VER_MAIN"): + raise bb.parse.SkipPackage("External Linaro toolchain not configured (ELT_VER_MAIN not set).") diff --git a/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/files/SUPPORTED b/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/files/SUPPORTED new file mode 100644 index 00000000..9615075e --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/files/SUPPORTED @@ -0,0 +1 @@ +POSIX diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-canadian_linaro-4.6.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-canadian_linaro-4.6.bb new file mode 100644 index 00000000..59122edc --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-canadian_linaro-4.6.bb @@ -0,0 +1,5 @@ +# Copyright (C) 2012 Khem Raj <khem@openembedded.org> +# Released under the MIT license (see COPYING.MIT for the terms) + +require gcc-linaro-common-4.6.inc +require recipes-devtools/gcc/gcc-cross-canadian_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-canadian_linaro-4.7.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-canadian_linaro-4.7.bb new file mode 100644 index 00000000..91cfbf30 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-canadian_linaro-4.7.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.7.inc +require recipes-devtools/gcc/gcc-cross-canadian_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-initial_linaro-4.6.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-initial_linaro-4.6.bb new file mode 100644 index 00000000..b0dbcc6f --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-initial_linaro-4.6.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.6.inc +require recipes-devtools/gcc/gcc-cross-initial_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-initial_linaro-4.7.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-initial_linaro-4.7.bb new file mode 100644 index 00000000..d0ec13f2 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-initial_linaro-4.7.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.7.inc +require recipes-devtools/gcc/gcc-cross-initial_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross_linaro-4.6.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross_linaro-4.6.bb new file mode 100644 index 00000000..6b5ad0cb --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross_linaro-4.6.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.6.inc +require recipes-devtools/gcc/gcc-cross_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross_linaro-4.7.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross_linaro-4.7.bb new file mode 100644 index 00000000..0ecec160 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross_linaro-4.7.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.7.inc +require recipes-devtools/gcc/gcc-cross_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk-initial_linaro-4.6.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk-initial_linaro-4.6.bb new file mode 100644 index 00000000..d78dc6a0 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk-initial_linaro-4.6.bb @@ -0,0 +1,4 @@ +require gcc-linaro-common-4.6.inc +require recipes-devtools/gcc/gcc-crosssdk-initial_${BASEPV}.bb + +EXTRA_OECONF += " --with-native-system-header-dir=${SYSTEMHEADERS} " diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk-initial_linaro-4.7.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk-initial_linaro-4.7.bb new file mode 100644 index 00000000..1252a1c0 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk-initial_linaro-4.7.bb @@ -0,0 +1,4 @@ +require gcc-linaro-common-4.7.inc +require recipes-devtools/gcc/gcc-crosssdk-initial_${BASEPV}.bb + +EXTRA_OECONF += " --with-native-system-header-dir=${SYSTEMHEADERS} " diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk_linaro-4.6.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk_linaro-4.6.bb new file mode 100644 index 00000000..aeec7ce6 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk_linaro-4.6.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.6.inc +require recipes-devtools/gcc/gcc-crosssdk_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk_linaro-4.7.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk_linaro-4.7.bb new file mode 100644 index 00000000..c5554364 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk_linaro-4.7.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.7.inc +require recipes-devtools/gcc/gcc-crosssdk_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.6.inc b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.6.inc new file mode 100644 index 00000000..9368b7ee --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.6.inc @@ -0,0 +1,23 @@ +require recipes-devtools/gcc/gcc-4.6.inc +require gcc-linaro-common-4.6.inc + +PR = "r5" +RELEASE = "2013.02" +BINV = "4.6.4" + +FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/gcc-${PV}' ], d)}" + +#SRC_URI = "https://launchpad.net/gcc-linaro/4.6/4.6-${RELEASE}/+download/gcc-${PV}-${RELEASE}.tar.bz2 + +SRC_URI = "http://cbuild.validation.linaro.org/snapshots/gcc-${PV}-${RELEASE}.tar.bz2 \ + file://gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \ + file://64bithack.patch \ + file://optional_libstdc.patch \ + file://use-defaults.h-and-t-oe-in-B.patch \ + " + +SRC_URI[md5sum] = "f9331b2efdf10701c6de585863f5d40d" +SRC_URI[sha256sum] = "d1a32d7e4c1ebee73b6c3fc69504239da6b2c903c3976a027cc8cd1c15e76b60" + +S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}-${RELEASE}" +B = "${WORKDIR}/gcc-${PV}-${RELEASE}/build.${HOST_SYS}.${TARGET_SYS}" diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.6/64bithack.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.6/64bithack.patch new file mode 100644 index 00000000..be6a2689 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.6/64bithack.patch @@ -0,0 +1,28 @@ +This patch causes the GCC to install the libstc++ into lib as opposed to +lib64 on X86_64 Linux targets. Usually the libstdc++ will be placed in lib64 +during the install step. Because that's where 64bit libs go for linux targets +according to the FHS. If you don't like this but want to use linux as a target +you have to patch the toolchain which is what 64bithack.patch attempts to do. +One solution would be to have a distinctive OE target that doesn't support +multilib and has 64bit libs under lib. The advantage over the current +meta/recipes-devtools/gcc/gcc-4.6/64bithack.patch provided by oe-core is that +multilib upport is entirely disabled and MULTILIB_OSDIRNAMES is empty. This +prevents a broken toolchain in case --enable-multilib gets used. + +Upstream-Status: Inappropriate + +Signed-off-by: Ken Werner <ken.werner@linaro.org> + +Index: gcc-linaro-4.6-2012.04/gcc/config.gcc +=================================================================== +--- gcc-linaro-4.6-2012.04.orig/gcc/config.gcc ++++ gcc-linaro-4.6-2012.04/gcc/config.gcc +@@ -1310,7 +1310,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu + tm_file="${tm_file} knetbsd-gnu.h" + ;; + esac +- tmake_file="${tmake_file} i386/t-linux64 i386/t-crtstuff i386/t-crtpc i386/t-crtfm t-dfprules" ++ tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtpc i386/t-crtfm t-dfprules" + ;; + i[34567]86-pc-msdosdjgpp*) + xm_file=i386/xm-djgpp.h diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.6/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.6/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch new file mode 100644 index 00000000..ce827400 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.6/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch @@ -0,0 +1,33 @@ +Upstream-Status: Inappropriate [embedded specific] + +--- + configure | 2 +- + configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +Index: gcc-4.6.0/configure.ac +=================================================================== +--- gcc-4.6.0.orig/configure.ac ++++ gcc-4.6.0/configure.ac +@@ -3073,7 +3073,7 @@ fi + # for target_alias and gcc doesn't manage it consistently. + target_configargs="--cache-file=./config.cache ${target_configargs}" + +-FLAGS_FOR_TARGET= ++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" + case " $target_configdirs " in + *" newlib "*) + case " $target_configargs " in +Index: gcc-4.6.0/configure +=================================================================== +--- gcc-4.6.0.orig/configure ++++ gcc-4.6.0/configure +@@ -7594,7 +7594,7 @@ fi + # for target_alias and gcc doesn't manage it consistently. + target_configargs="--cache-file=./config.cache ${target_configargs}" + +-FLAGS_FOR_TARGET= ++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" + case " $target_configdirs " in + *" newlib "*) + case " $target_configargs " in diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.6/optional_libstdc.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.6/optional_libstdc.patch new file mode 100644 index 00000000..fe157a89 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.6/optional_libstdc.patch @@ -0,0 +1,86 @@ +Upstream-Status: Inappropriate [embedded specific] + +gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++ +will not run correctly since by default the linker will try to link against libstdc++ +which shouldn't exist yet. We need an option to disable -lstdc++ +option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc +driver. This patch adds such an option which only disables the -lstdc++. + +A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to +do this officially, the likely answer is don't build libstdc++ separately. + +RP 29/6/10 + +Index: gcc-4.6.0/gcc/cp/g++spec.c +=================================================================== +--- gcc-4.6.0.orig/gcc/cp/g++spec.c ++++ gcc-4.6.0/gcc/cp/g++spec.c +@@ -127,6 +127,7 @@ lang_specific_driver (struct cl_decoded_ + switch (decoded_options[i].opt_index) + { + case OPT_nostdlib: ++ case OPT_nostdlib__: + case OPT_nodefaultlibs: + library = -1; + break; +Index: gcc-4.6.0/gcc/doc/invoke.texi +=================================================================== +--- gcc-4.6.0.orig/gcc/doc/invoke.texi ++++ gcc-4.6.0/gcc/doc/invoke.texi +@@ -193,7 +193,7 @@ in the following sections. + -fno-pretty-templates @gol + -frepo -fno-rtti -fstats -ftemplate-depth=@var{n} @gol + -fno-threadsafe-statics -fuse-cxa-atexit -fno-weak -nostdinc++ @gol +--fno-default-inline -fvisibility-inlines-hidden @gol ++-nostdlib++ -fno-default-inline -fvisibility-inlines-hidden @gol + -fvisibility-ms-compat @gol + -Wabi -Wconversion-null -Wctor-dtor-privacy @gol + -Wnoexcept -Wnon-virtual-dtor -Wreorder @gol +@@ -431,7 +431,7 @@ Objective-C and Objective-C++ Dialects}. + @gccoptlist{@var{object-file-name} -l@var{library} @gol + -nostartfiles -nodefaultlibs -nostdlib -pie -rdynamic @gol + -s -static -static-libgcc -static-libstdc++ -shared @gol +--shared-libgcc -symbolic @gol ++-shared-libgcc -symbolic -nostdlib++ @gol + -T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol + -u @var{symbol}} + +@@ -9069,6 +9069,11 @@ These entries are usually resolved by en + libc. These entry points should be supplied through some other + mechanism when this option is specified. + ++@item -nostdlib++ ++@opindex nostdlib++ ++Do not use the standard system C++ runtime libraries when linking. ++Only the libraries you specify will be passed to the linker. ++ + @cindex @option{-lgcc}, use with @option{-nostdlib} + @cindex @option{-nostdlib} and unresolved references + @cindex unresolved references and @option{-nostdlib} +Index: gcc-4.6.0/gcc/c-family/c.opt +=================================================================== +--- gcc-4.6.0.orig/gcc/c-family/c.opt ++++ gcc-4.6.0/gcc/c-family/c.opt +@@ -1111,6 +1111,10 @@ nostdinc++ + C++ ObjC++ + Do not search standard system include directories for C++ + ++nostdlib++ ++Driver ++Do not link standard C++ runtime library ++ + o + C ObjC C++ ObjC++ Joined Separate + ; Documented in common.opt +Index: gcc-4.6.0/gcc/gcc.c +=================================================================== +--- gcc-4.6.0.orig/gcc/gcc.c ++++ gcc-4.6.0/gcc/gcc.c +@@ -666,6 +666,7 @@ proper position among the other output f + %(mflib) " STACK_SPLIT_SPEC "\ + %{fprofile-arcs|fprofile-generate*|coverage:-lgcov}\ + %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\ ++ %{!nostdlib++:}\ + %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}" + #endif + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.6/use-defaults.h-and-t-oe-in-B.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.6/use-defaults.h-and-t-oe-in-B.patch new file mode 100644 index 00000000..b4351ee7 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.6/use-defaults.h-and-t-oe-in-B.patch @@ -0,0 +1,80 @@ +Upstream-Status: Pending + +Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B}, so that +the source can be shared between gcc-cross-initial, +gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build. +--- + gcc/Makefile.in | 2 +- + gcc/configure | 4 ++-- + gcc/configure.ac | 4 ++-- + gcc/mkconfig.sh | 4 ++-- + 4 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index 7790915..3a0c34a 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -463,7 +463,7 @@ LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ] + TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@ + + xmake_file=@xmake_file@ +-tmake_file=@tmake_file@ ++tmake_file=@tmake_file@ ./t-oe + TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@ + TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@ + TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@ +diff --git a/gcc/configure b/gcc/configure +index 82fa3e4..d4711b5 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -11227,8 +11227,8 @@ for f in $tm_file; do + tm_include_list="${tm_include_list} $f" + ;; + defaults.h ) +- tm_file_list="${tm_file_list} \$(srcdir)/$f" +- tm_include_list="${tm_include_list} $f" ++ tm_file_list="${tm_file_list} ./$f" ++ tm_include_list="${tm_include_list} ./$f" + ;; + * ) + tm_file_list="${tm_file_list} \$(srcdir)/config/$f" +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 844d8da..a960343 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -1628,8 +1628,8 @@ for f in $tm_file; do + tm_include_list="${tm_include_list} $f" + ;; + defaults.h ) +- tm_file_list="${tm_file_list} \$(srcdir)/$f" +- tm_include_list="${tm_include_list} $f" ++ tm_file_list="${tm_file_list} ./$f" ++ tm_include_list="${tm_include_list} ./$f" + ;; + * ) + tm_file_list="${tm_file_list} \$(srcdir)/config/$f" +diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh +index d56df8c..875d0f1 100644 +--- a/gcc/mkconfig.sh ++++ b/gcc/mkconfig.sh +@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then + if [ $# -ge 1 ]; then + echo '#ifdef IN_GCC' >> ${output}T + for file in "$@"; do +- if test x"$file" = x"defaults.h"; then ++ if test x"$file" = x"./defaults.h"; then + postpone_defaults_h="yes" + else + echo "# include \"$file\"" >> ${output}T +@@ -103,7 +103,7 @@ esac + + # If we postponed including defaults.h, add the #include now. + if test x"$postpone_defaults_h" = x"yes"; then +- echo "# include \"defaults.h\"" >> ${output}T ++ echo "# include \"./defaults.h\"" >> ${output}T + fi + + # Add multiple inclusion protection guard, part two. +-- +1.7.1 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7.inc b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7.inc new file mode 100644 index 00000000..dd9a1af9 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7.inc @@ -0,0 +1,24 @@ +require recipes-devtools/gcc/gcc-4.7.inc +require gcc-linaro-common-4.7.inc + +PR = "r9" +RELEASE = "2013.02" +BINV = "4.7.3" + +FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/gcc-${PV}' ], d)}" + +#SRC_URI = "https://launchpad.net/gcc-linaro/4.7/4.7-${RELEASE}/+download/gcc-${PV}-${RELEASE}.tar.bz2 + +SRC_URI = "http://cbuild.validation.linaro.org/snapshots/gcc-${PV}-${RELEASE}-01.tar.bz2 \ + file://gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \ + file://64bithack.patch \ + file://optional_libstdc.patch \ + file://use-defaults.h-and-t-oe-in-B.patch \ + file://fix-g++-sysroot.patch \ + " + +SRC_URI[md5sum] = "4c8d749eb6358a7b6a3ce617e96eb5a9" +SRC_URI[sha256sum] = "cff6680c01c0512564ae78ae42f5498507c8a01f59ec34f7d8766a34db655f43" + +S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}-${RELEASE}-01" +B = "${WORKDIR}/gcc-${PV}-${RELEASE}/build.${HOST_SYS}.${TARGET_SYS}" diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7/64bithack.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7/64bithack.patch new file mode 100644 index 00000000..7a4ba4c1 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7/64bithack.patch @@ -0,0 +1,27 @@ +This patch causes the GCC to install the libstc++ into lib as opposed to +lib64 on X86_64 Linux targets. Usually the libstdc++ will be placed in lib64 +during the install step. Because that's where 64bit libs go for linux targets +according to the FHS. If you don't like this but want to use linux as a target +you have to patch the toolchain which is what 64bithack.patch attempts to do. +One solution would be to have a distinctive OE target that doesn't support +multilib and has 64bit libs under lib. The advantage over the current +meta/recipes-devtools/gcc/gcc-4.7/64bithack.patch provided by oe-core is that +multilib upport is entirely disabled and MULTILIB_OSDIRNAMES is empty. This +prevents a broken toolchain in case --enable-multilib gets used. + +Upstream-Status: Inappropriate + +Signed-off-by: Ken Werner <ken.werner@linaro.org> + +Index: gcc-linaro-4.7-2012.05/gcc/config.gcc +=================================================================== +--- gcc-linaro-4.7-2012.05.orig/gcc/config.gcc ++++ gcc-linaro-4.7-2012.05/gcc/config.gcc +@@ -1303,7 +1303,6 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu + tm_file="${tm_file} knetbsd-gnu.h" + ;; + esac +- tmake_file="${tmake_file} i386/t-linux64" + x86_multilibs="${with_multilib_list}" + if test "$x86_multilibs" = "default"; then + x86_multilibs="m64,m32" diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7/fix-g++-sysroot.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7/fix-g++-sysroot.patch new file mode 100644 index 00000000..e6028d55 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7/fix-g++-sysroot.patch @@ -0,0 +1,78 @@ +backport + +http://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg26013.html + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Refreshed for meta-linaro by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> + +--- + gcc/configure | 8 +++++++- + gcc/configure.ac | 8 +++++++- + 2 files changed, 14 insertions(+), 2 deletions(-) + +--- gcc-linaro-4.7-2013.02.orig/gcc/configure ++++ gcc-linaro-4.7-2013.02/gcc/configure +@@ -3322,11 +3322,13 @@ fi + + gcc_gxx_include_dir_add_sysroot=0 + if test "${with_sysroot+set}" = set; then + gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` + if test "${gcc_gxx_without_sysroot}"; then +- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" ++ if test x${with_sysroot} != x/; then ++ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" ++ fi + gcc_gxx_include_dir_add_sysroot=1 + fi + fi + + +@@ -7284,10 +7286,14 @@ fi + + # Check whether --with-sysroot was given. + if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; + case ${with_sysroot} in ++ /) ;; ++ */) with_sysroot=`echo $with_sysroot | sed 's,/$,,'` ;; ++ esac ++ case ${with_sysroot} in + yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;; + *) TARGET_SYSTEM_ROOT=$with_sysroot ;; + esac + + TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"' +--- gcc-linaro-4.7-2013.02.orig/gcc/configure.ac ++++ gcc-linaro-4.7-2013.02/gcc/configure.ac +@@ -147,11 +147,13 @@ fi + + gcc_gxx_include_dir_add_sysroot=0 + if test "${with_sysroot+set}" = set; then + gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` + if test "${gcc_gxx_without_sysroot}"; then +- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" ++ if test x${with_sysroot} != x/; then ++ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" ++ fi + gcc_gxx_include_dir_add_sysroot=1 + fi + fi + + AC_ARG_WITH(cpp_install_dir, +@@ -784,10 +786,14 @@ AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET) + AC_ARG_WITH(sysroot, + [AS_HELP_STRING([[--with-sysroot[=DIR]]], + [search for usr/lib, usr/include, et al, within DIR])], + [ + case ${with_sysroot} in ++ /) ;; ++ */) with_sysroot=`echo $with_sysroot | sed 's,/$,,'` ;; ++ esac ++ case ${with_sysroot} in + yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;; + *) TARGET_SYSTEM_ROOT=$with_sysroot ;; + esac + + TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"' diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch new file mode 100644 index 00000000..964c4bbb --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch @@ -0,0 +1,33 @@ +Upstream-Status: Inappropriate [embedded specific] + +--- + configure | 2 +- + configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +Index: gcc-4_7-branch/configure.ac +=================================================================== +--- gcc-4_7-branch.orig/configure.ac 2012-04-10 10:19:50.923337154 -0700 ++++ gcc-4_7-branch/configure.ac 2012-04-10 10:19:54.911337344 -0700 +@@ -2825,7 +2825,7 @@ + # for target_alias and gcc doesn't manage it consistently. + target_configargs="--cache-file=./config.cache ${target_configargs}" + +-FLAGS_FOR_TARGET= ++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" + case " $target_configdirs " in + *" newlib "*) + case " $target_configargs " in +Index: gcc-4_7-branch/configure +=================================================================== +--- gcc-4_7-branch.orig/configure 2012-04-10 10:19:50.911337153 -0700 ++++ gcc-4_7-branch/configure 2012-04-10 10:19:54.915337349 -0700 +@@ -7368,7 +7368,7 @@ + # for target_alias and gcc doesn't manage it consistently. + target_configargs="--cache-file=./config.cache ${target_configargs}" + +-FLAGS_FOR_TARGET= ++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" + case " $target_configdirs " in + *" newlib "*) + case " $target_configargs " in diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7/optional_libstdc.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7/optional_libstdc.patch new file mode 100644 index 00000000..fe157a89 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7/optional_libstdc.patch @@ -0,0 +1,86 @@ +Upstream-Status: Inappropriate [embedded specific] + +gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++ +will not run correctly since by default the linker will try to link against libstdc++ +which shouldn't exist yet. We need an option to disable -lstdc++ +option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc +driver. This patch adds such an option which only disables the -lstdc++. + +A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to +do this officially, the likely answer is don't build libstdc++ separately. + +RP 29/6/10 + +Index: gcc-4.6.0/gcc/cp/g++spec.c +=================================================================== +--- gcc-4.6.0.orig/gcc/cp/g++spec.c ++++ gcc-4.6.0/gcc/cp/g++spec.c +@@ -127,6 +127,7 @@ lang_specific_driver (struct cl_decoded_ + switch (decoded_options[i].opt_index) + { + case OPT_nostdlib: ++ case OPT_nostdlib__: + case OPT_nodefaultlibs: + library = -1; + break; +Index: gcc-4.6.0/gcc/doc/invoke.texi +=================================================================== +--- gcc-4.6.0.orig/gcc/doc/invoke.texi ++++ gcc-4.6.0/gcc/doc/invoke.texi +@@ -193,7 +193,7 @@ in the following sections. + -fno-pretty-templates @gol + -frepo -fno-rtti -fstats -ftemplate-depth=@var{n} @gol + -fno-threadsafe-statics -fuse-cxa-atexit -fno-weak -nostdinc++ @gol +--fno-default-inline -fvisibility-inlines-hidden @gol ++-nostdlib++ -fno-default-inline -fvisibility-inlines-hidden @gol + -fvisibility-ms-compat @gol + -Wabi -Wconversion-null -Wctor-dtor-privacy @gol + -Wnoexcept -Wnon-virtual-dtor -Wreorder @gol +@@ -431,7 +431,7 @@ Objective-C and Objective-C++ Dialects}. + @gccoptlist{@var{object-file-name} -l@var{library} @gol + -nostartfiles -nodefaultlibs -nostdlib -pie -rdynamic @gol + -s -static -static-libgcc -static-libstdc++ -shared @gol +--shared-libgcc -symbolic @gol ++-shared-libgcc -symbolic -nostdlib++ @gol + -T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol + -u @var{symbol}} + +@@ -9069,6 +9069,11 @@ These entries are usually resolved by en + libc. These entry points should be supplied through some other + mechanism when this option is specified. + ++@item -nostdlib++ ++@opindex nostdlib++ ++Do not use the standard system C++ runtime libraries when linking. ++Only the libraries you specify will be passed to the linker. ++ + @cindex @option{-lgcc}, use with @option{-nostdlib} + @cindex @option{-nostdlib} and unresolved references + @cindex unresolved references and @option{-nostdlib} +Index: gcc-4.6.0/gcc/c-family/c.opt +=================================================================== +--- gcc-4.6.0.orig/gcc/c-family/c.opt ++++ gcc-4.6.0/gcc/c-family/c.opt +@@ -1111,6 +1111,10 @@ nostdinc++ + C++ ObjC++ + Do not search standard system include directories for C++ + ++nostdlib++ ++Driver ++Do not link standard C++ runtime library ++ + o + C ObjC C++ ObjC++ Joined Separate + ; Documented in common.opt +Index: gcc-4.6.0/gcc/gcc.c +=================================================================== +--- gcc-4.6.0.orig/gcc/gcc.c ++++ gcc-4.6.0/gcc/gcc.c +@@ -666,6 +666,7 @@ proper position among the other output f + %(mflib) " STACK_SPLIT_SPEC "\ + %{fprofile-arcs|fprofile-generate*|coverage:-lgcov}\ + %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\ ++ %{!nostdlib++:}\ + %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}" + #endif + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7/use-defaults.h-and-t-oe-in-B.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7/use-defaults.h-and-t-oe-in-B.patch new file mode 100644 index 00000000..b4351ee7 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.7/use-defaults.h-and-t-oe-in-B.patch @@ -0,0 +1,80 @@ +Upstream-Status: Pending + +Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B}, so that +the source can be shared between gcc-cross-initial, +gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build. +--- + gcc/Makefile.in | 2 +- + gcc/configure | 4 ++-- + gcc/configure.ac | 4 ++-- + gcc/mkconfig.sh | 4 ++-- + 4 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index 7790915..3a0c34a 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -463,7 +463,7 @@ LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ] + TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@ + + xmake_file=@xmake_file@ +-tmake_file=@tmake_file@ ++tmake_file=@tmake_file@ ./t-oe + TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@ + TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@ + TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@ +diff --git a/gcc/configure b/gcc/configure +index 82fa3e4..d4711b5 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -11227,8 +11227,8 @@ for f in $tm_file; do + tm_include_list="${tm_include_list} $f" + ;; + defaults.h ) +- tm_file_list="${tm_file_list} \$(srcdir)/$f" +- tm_include_list="${tm_include_list} $f" ++ tm_file_list="${tm_file_list} ./$f" ++ tm_include_list="${tm_include_list} ./$f" + ;; + * ) + tm_file_list="${tm_file_list} \$(srcdir)/config/$f" +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 844d8da..a960343 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -1628,8 +1628,8 @@ for f in $tm_file; do + tm_include_list="${tm_include_list} $f" + ;; + defaults.h ) +- tm_file_list="${tm_file_list} \$(srcdir)/$f" +- tm_include_list="${tm_include_list} $f" ++ tm_file_list="${tm_file_list} ./$f" ++ tm_include_list="${tm_include_list} ./$f" + ;; + * ) + tm_file_list="${tm_file_list} \$(srcdir)/config/$f" +diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh +index d56df8c..875d0f1 100644 +--- a/gcc/mkconfig.sh ++++ b/gcc/mkconfig.sh +@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then + if [ $# -ge 1 ]; then + echo '#ifdef IN_GCC' >> ${output}T + for file in "$@"; do +- if test x"$file" = x"defaults.h"; then ++ if test x"$file" = x"./defaults.h"; then + postpone_defaults_h="yes" + else + echo "# include \"$file\"" >> ${output}T +@@ -103,7 +103,7 @@ esac + + # If we postponed including defaults.h, add the #include now. + if test x"$postpone_defaults_h" = x"yes"; then +- echo "# include \"defaults.h\"" >> ${output}T ++ echo "# include \"./defaults.h\"" >> ${output}T + fi + + # Add multiple inclusion protection guard, part two. +-- +1.7.1 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-common-4.6.inc b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-common-4.6.inc new file mode 100644 index 00000000..4bb5cae1 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-common-4.6.inc @@ -0,0 +1,2 @@ +BASEPV = "4.6" +PV = "linaro-${BASEPV}" diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-common-4.7.inc b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-common-4.7.inc new file mode 100644 index 00000000..f9d63115 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-common-4.7.inc @@ -0,0 +1,2 @@ +BASEPV = "4.7" +PV = "linaro-${BASEPV}" diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-runtime_linaro-4.6.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-runtime_linaro-4.6.bb new file mode 100644 index 00000000..57e445e8 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-runtime_linaro-4.6.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.6.inc +require recipes-devtools/gcc/gcc-runtime_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-runtime_linaro-4.7.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-runtime_linaro-4.7.bb new file mode 100644 index 00000000..a976006e --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-runtime_linaro-4.7.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.7.inc +require recipes-devtools/gcc/gcc-runtime_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc_linaro-4.6.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc_linaro-4.6.bb new file mode 100644 index 00000000..d16ece24 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc_linaro-4.6.bb @@ -0,0 +1,3 @@ +require gcc-linaro-common-4.6.inc +require recipes-devtools/gcc/gcc_${BASEPV}.bb + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc_linaro-4.7.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc_linaro-4.7.bb new file mode 100644 index 00000000..d8b14eb5 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc_linaro-4.7.bb @@ -0,0 +1,3 @@ +require gcc-linaro-common-4.7.inc +require recipes-devtools/gcc/gcc_${BASEPV}.bb + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/libgcc_linaro-4.6.bb b/meta-linaro-toolchain/recipes-devtools/gcc/libgcc_linaro-4.6.bb new file mode 100644 index 00000000..f44a0843 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/libgcc_linaro-4.6.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.6.inc +require recipes-devtools/gcc/libgcc_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/libgcc_linaro-4.7.bb b/meta-linaro-toolchain/recipes-devtools/gcc/libgcc_linaro-4.7.bb new file mode 100644 index 00000000..f98fa24d --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/libgcc_linaro-4.7.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.7.inc +require recipes-devtools/gcc/libgcc_${BASEPV}.bb |