aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2019-01-25 15:44:07 +0000
committerLinaro Code Review <review@review.linaro.org>2019-01-25 15:44:07 +0000
commit59b0802b62d5aaf7cfe92843b5bf4ea5f8df335e (patch)
treefa04fb197244c8f8f50d41e130388704b95a6097
parentfbd4eeca52d1f813727977a78fd8664f88c5e4e3 (diff)
parent14b301dac22c9cd4836e653909fb271b78cd53ec (diff)
downloadmeta-linaro-59b0802b62d5aaf7cfe92843b5bf4ea5f8df335e.tar.gz
Merge "external-arm-toolchain: add external prebuilt ARM toolchain"
-rw-r--r--meta-linaro-toolchain/conf/distro/include/external-arm-toolchain-versions.inc128
-rw-r--r--meta-linaro-toolchain/conf/distro/include/tcmode-external-arm.inc110
-rw-r--r--meta-linaro-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb579
-rw-r--r--meta-linaro-toolchain/recipes-devtools/external-arm-toolchain/files/SUPPORTED1
4 files changed, 818 insertions, 0 deletions
diff --git a/meta-linaro-toolchain/conf/distro/include/external-arm-toolchain-versions.inc b/meta-linaro-toolchain/conf/distro/include/external-arm-toolchain-versions.inc
new file mode 100644
index 00000000..7064d6b3
--- /dev/null
+++ b/meta-linaro-toolchain/conf/distro/include/external-arm-toolchain-versions.inc
@@ -0,0 +1,128 @@
+def eat_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 eat_get_version(d):
+ try:
+ stdout, stderr = eat_run(d, 'gcc', '-v')
+ except bb.process.CmdError as exc:
+ bb.error('Failed to obtain external Arm toolchain version: %s' % exc)
+ return 'UNKNOWN'
+ else:
+ last_line = stderr.splitlines()[-1]
+ return last_line
+
+# Extract the YYYY.MM version
+def eat_get_main_version(d):
+ version = eat_get_version(d)
+ bb.debug(2, 'Trying for parse version info from: %s' % version)
+ if version != 'UNKNOWN':
+ if version.split()[4] == '(GNU':
+ # gcc version 8.2.1 20180802 (GNU Toolchain for the A-profile Architecture 8.2-2018.11 (arm-rel-8.26))
+ return version.split()[10].split('-')[1]
+ bb.error('Failed to parse external Arm toolchain version from: %s' % version)
+ else:
+ return version
+
+# Extract the x.y.z version from 'gcc version 4.9.1'
+def eat_get_gcc_version(d):
+ version = eat_get_version(d)
+ if version != 'UNKNOWN':
+ return version.split()[2]
+ else:
+ return version
+
+def eat_get_libc_version(d):
+ import os,bb
+ syspath = bb.data.expand('${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}', d)
+ if not syspath:
+ return 'UNKNOWN'
+
+ libpath = syspath + '/libc/lib64/' + bb.data.expand('${EAT_TARGET_SYS}/', d)
+
+ if os.path.exists(libpath):
+ for file in os.listdir(libpath):
+ if file.find('libc-') == 0:
+ return file[5:-3]
+
+ libpath = syspath + '/libc/lib64/'
+
+ if os.path.exists(libpath):
+ for file in os.listdir(libpath):
+ if file.find('libc-') == 0:
+ return file[5:-3]
+
+ libpath = syspath + '/libc/usr/lib64/' + bb.data.expand('${EAT_TARGET_SYS}/', d)
+
+ if os.path.exists(libpath):
+ for file in os.listdir(libpath):
+ if file.find('libc-') == 0:
+ return file[5:-3]
+
+ libpath = syspath + '/libc/usr/lib64/'
+
+ if os.path.exists(libpath):
+ for file in os.listdir(libpath):
+ if file.find('libc-') == 0:
+ return file[5:-3]
+ return 'UNKNOWN'
+
+def eat_get_kernel_version(d):
+ import os,bb
+ syspath = bb.data.expand('${EXTERNAL_TOOLCHAIN}/${EAT_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 eat_get_gdb_version(d):
+ try:
+ stdout, stderr = eat_run(d, 'gdb', '-v')
+ except bb.process.CmdError:
+ return 'UNKNOWN'
+ else:
+ first_line = stdout.splitlines()[0]
+ return first_line.split()[-1]
+
+python external_arm_toolchain_version_handler () {
+ if not isinstance(e, bb.event.ConfigParsed):
+ return
+ d = e.data
+ ld = d.createCopy()
+ ld.finalize()
+
+ d.setVar('EAT_VER_MAIN', eat_get_main_version(ld))
+ d.setVar('EAT_VER_GCC', eat_get_gcc_version(ld))
+ d.setVar('EAT_VER_LIBC', eat_get_libc_version(ld))
+ d.setVar('EAT_VER_KERNEL', eat_get_kernel_version(ld))
+ d.setVar('EAT_VER_GDB', eat_get_gdb_version(ld))
+}
+addhandler external_arm_toolchain_version_handler
diff --git a/meta-linaro-toolchain/conf/distro/include/tcmode-external-arm.inc b/meta-linaro-toolchain/conf/distro/include/tcmode-external-arm.inc
new file mode 100644
index 00000000..5f3a4e68
--- /dev/null
+++ b/meta-linaro-toolchain/conf/distro/include/tcmode-external-arm.inc
@@ -0,0 +1,110 @@
+#
+# Configuration to use an external Arm binary toolchain
+#
+
+EXTERNAL_TOOLCHAIN ?= "/usr/local/arm-binary-toolchain/${TARGET_ARCH}"
+
+TOOLCHAIN_PATH_ADD = "${EXTERNAL_TOOLCHAIN}/bin:"
+PATH =. "${TOOLCHAIN_PATH_ADD}"
+
+ELT_TARGET_SYS_arm ?= "arm-linux-gnueabihf"
+ELT_TARGET_SYS_aarch64 ?= "aarch64-linux-gnu"
+ELT_TARGET_SYS = "${TARGET_SYS}"
+TARGET_PREFIX = "${ELT_TARGET_SYS}-"
+
+GCCMULTILIB_forcevariable = "--disable-multilib"
+IMAGE_LINGUAS_forcevariable = ""
+
+# Blacklist toolchain recipes as a belt-and-suspenders way to use the external toolchain
+PNBLACKLIST[glibc] = "Using external toolchain"
+PNBLACKLIST[libgcc] = "Using external toolchain"
+PNBLACKLIST[gcc-cross] = "Using external toolchain"
+PNBLACKLIST[gcc-runtime] = "Using external toolchain"
+
+PREFERRED_PROVIDER_linux-libc-headers = "external-arm-toolchain"
+PREFERRED_PROVIDER_linux-libc-headers-dev = "external-arm-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc = "external-arm-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial = "external-arm-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++ = "external-arm-toolchain"
+#PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils = "external-arm-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = "external-arm-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs = "external-arm-toolchain"
+PREFERRED_PROVIDER_glibc = "external-arm-toolchain"
+PREFERRED_PROVIDER_libgcc = "external-arm-toolchain"
+PREFERRED_PROVIDER_virtual/libc = "external-arm-toolchain"
+PREFERRED_PROVIDER_virtual/libintl = "external-arm-toolchain"
+PREFERRED_PROVIDER_virtual/libiconv = "external-arm-toolchain"
+PREFERRED_PROVIDER_virtual/crypt = "external-arm-toolchain"
+PREFERRED_PROVIDER_glibc-thread-db = "external-arm-toolchain"
+PREFERRED_PROVIDER_glibc-mtrace = "external-arm-toolchain"
+PREFERRED_PROVIDER_libc-mtrace = "external-arm-toolchain"
+PREFERRED_PROVIDER_virtual/linux-libc-headers = "external-arm-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"
+
+ERROR_QA[type] ?= "list"
+python toolchain_metadata_setup () {
+ import subprocess
+ if not isinstance(e, bb.event.ConfigParsed):
+ return
+
+ d = e.data
+ l = d.createCopy()
+ l.finalize()
+ oe_import(l)
+
+ external_toolchain = l.getVar('EXTERNAL_TOOLCHAIN', True)
+ if not external_toolchain or external_toolchain == 'UNDEFINED':
+ bb.fatal("Error: EXTERNAL_TOOLCHAIN must be set to the path to your arm toolchain")
+
+ if not os.path.exists(external_toolchain):
+ bb.fatal("Error: EXTERNAL_TOOLCHAIN path '%s' does not exist" % external_toolchain)
+
+ # The external toolchain may not have been built with the oe-core preferred
+ # gnu hash setting, so ensure that the corresponding sanity check is not an error.
+ error_qa = oe.data.typed_value('ERROR_QA', l)
+ if 'ldflags' in error_qa:
+ error_qa.remove('ldflags')
+ d.setVar('ERROR_QA', ' '.join(error_qa))
+}
+addhandler toolchain_metadata_setup
+
+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-arm-toolchain-versions.inc
diff --git a/meta-linaro-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb b/meta-linaro-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
new file mode 100644
index 00000000..a105cfcf
--- /dev/null
+++ b/meta-linaro-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
@@ -0,0 +1,579 @@
+require recipes-core/glibc/glibc-package.inc
+
+INHIBIT_DEFAULT_DEPS = "1"
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+
+# License applies to this recipe code, not the toolchain itself
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "\
+ file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ 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 \
+ binutils-cross-aarch64 \
+ virtual/${TARGET_PREFIX}libc-for-gcc \
+ virtual/${TARGET_PREFIX}compilerlibs \
+ virtual/libc \
+ virtual/libintl \
+ virtual/libiconv \
+ virtual/crypt \
+ glibc-mtrace \
+ glibc-thread-db \
+ glibc \
+ libc-mtrace \
+ gcc-runtime \
+ libgcc \
+ libg2c \
+ libg2c-dev \
+ libssp \
+ libssp-dev \
+ libssp-staticdev \
+ libgfortran \
+ libgfortran-dev \
+ libgfortran-staticdev \
+ libmudflap \
+ libmudflap-dev \
+ libgomp \
+ libgomp-dev \
+ libgomp-staticdev \
+ libitm \
+ libitm-dev \
+ libitm-staticdev \
+ libquadmath \
+ libquadmath-dev \
+ libquadmath-staticdev \
+ virtual/linux-libc-headers \
+ libgcov-dev \
+"
+
+PV = "${EAT_VER_MAIN}"
+
+SRC_URI = "file://SUPPORTED"
+
+do_install() {
+ # Add stubs for files OE-core expects
+ install -d ${S}/nscd/
+ touch ${S}/nscd/nscd.init
+ touch ${S}/nscd/nscd.conf
+ touch ${S}/nscd/nscd.service
+ touch ${S}/../makedbs.sh
+
+ 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 -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/lib64/* ${D}${base_libdir}
+ if [ -d ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/lib64/${EAT_TARGET_SYS} ]; then
+ cp -a -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/lib64/${EAT_TARGET_SYS}/* ${D}${base_libdir}
+ else
+ if [ -f ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/lib64/ld-${EAT_VER_LIBC}.so ]; then
+ cp -a -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/lib64/* ${D}${base_libdir}
+ else
+ cp -a -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/lib64/*.so* ${D}${base_libdir}
+ fi
+ fi
+ if [ -d ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/lib64/${EAT_TARGET_SYS} ]; then
+ cp -a -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/lib64/${EAT_TARGET_SYS}/* ${D}${libdir}
+ else
+ cp -a -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/lib64/* ${D}${libdir}
+ if [ ! -f ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/lib64/ld-${EAT_VER_LIBC}.so ]; then
+ rm -rf ${D}${libdir}/*.so*
+ fi
+ fi
+ cp -a -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/share/* ${D}${datadir}
+ cp -a -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/include/* ${D}${includedir}
+ if [ -d ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/include/${EAT_TARGET_SYS} ]; then
+ cp -a -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/include/${EAT_TARGET_SYS}/* ${D}${includedir}
+ rm -r ${D}${includedir}/${EAT_TARGET_SYS}
+ fi
+
+ # fix up the copied symlinks (they are still pointing to the multiarch directory)
+ linker_name="${@bb.utils.contains("TUNE_FEATURES", "aarch64", "ld-linux-aarch64.so.1", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "ld-linux-armhf.so.3", "ld-linux.so.3",d), d)}"
+ ln -sf ld-${EAT_VER_LIBC}.so ${D}${base_libdir}/${linker_name}
+ ln -sf ../../lib/libnsl.so.1 ${D}${libdir}/libnsl.so
+ ln -sf ../../lib/librt.so.1 ${D}${libdir}/librt.so
+ ln -sf ../../lib/libgcc_s.so.1 ${D}${libdir}/libgcc_s.so
+ ln -sf ../../lib/libcrypt.so.1 ${D}${libdir}/libcrypt.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/libpthread.so.0 ${D}${libdir}/libpthread.so
+ ln -sf ../../lib/libthread_db.so.1 ${D}${libdir}/libthread_db-1.0.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/libnss_db.so.2 ${D}${libdir}/libnss_db.so
+ ln -sf ../../lib/libnss_dns.so.2 ${D}${libdir}/libnss_dns.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/libm.so.6 ${D}${libdir}/libm.so
+ ln -sf ../../lib/libatomic.so.1 ${D}${libdir}/libatomic.so
+ ln -sf ../../lib/libgomp.so.1 ${D}${libdir}/libgomp.so
+ ln -sf ../../lib/libitm.so.1 ${D}${libdir}/libitm.so
+ ln -sf ../../lib/libssp.so.0 ${D}${libdir}/libssp.so
+ ln -sf ../../lib/libstdc++.so.6 ${D}${libdir}/libstdc++.so
+ ln -sf ../../lib/libubsan.so.0 ${D}${libdir}/libubsan.so
+ # ln -sf ../../lib/libasan.so.1 ${D}${libdir}/libasan.so
+ ln -sf ../../lib/libgfortran.so.5 ${D}${libdir}/libgfortran.so
+
+ # remove potential .so duplicates from base_libdir
+ # for all symlinks created above in libdir
+ rm -f ${D}${base_libdir}/libnsl.so
+ rm -f ${D}${base_libdir}/librt.so
+ rm -f ${D}${base_libdir}/libcrypt.so
+ rm -f ${D}${base_libdir}/libnss_nis.so
+ rm -f ${D}${base_libdir}/libresolv.so
+ rm -f ${D}${base_libdir}/libnss_dns.so
+ rm -f ${D}${base_libdir}/libnss_hesiod.so
+ rm -f ${D}${base_libdir}/libutil.so
+ rm -f ${D}${base_libdir}/libnss_files.so
+ rm -f ${D}${base_libdir}/libnss_compat.so
+# rm -f ${D}${base_libdir}/libcidn.so
+ rm -f ${D}${base_libdir}/libBrokenLocale.so
+ rm -f ${D}${base_libdir}/libthread_db.so
+ rm -f ${D}${base_libdir}/libanl.so
+ rm -f ${D}${base_libdir}/libdl.so
+ rm -f ${D}${base_libdir}/libnss_nisplus.so
+ rm -f ${D}${base_libdir}/libnss_db.so
+ rm -f ${D}${base_libdir}/libm.so
+ rm -f ${D}${base_libdir}/libasan.so
+ rm -f ${D}${base_libdir}/libatomic.so
+ rm -f ${D}${base_libdir}/libgomp.so
+ rm -f ${D}${base_libdir}/libitm.so
+ rm -f ${D}${base_libdir}/libssp.so
+ rm -f ${D}${base_libdir}/libstdc++.so
+ rm -f ${D}${base_libdir}/libgfortran.so
+ rm -f ${D}${base_libdir}/libubsan.so
+
+ # Besides ld-${EAT_VER_LIBC}.so, other libs can have duplicates like lib*-${EAT_VER_LIBC}.so
+ # Only remove them if both are regular files and are identical
+ for i in ${D}${base_libdir}/lib*-${EAT_VER_LIBC}.so; do
+ f=$(echo $i | sed 's/-${EAT_VER_LIBC}//')
+ l=$(ls $f.*)
+ if [ $(readlink -f $i ) = $l ]; then
+ echo "$i is a symlink of $l, keep it"
+ elif [ $(readlink -f $l ) = $i ]; then
+ echo "$l is a symlink of $i, keep it"
+ else
+ cmp -s $i $l
+ if [ $? -eq 0 ]; then
+ echo "$i is a duplicate of $l, remove it"
+ rm $i
+ else
+ echo "$i and $l are different files, keep them both"
+ fi
+ fi
+ done
+
+ if [ -d ${D}${base_libdir}/arm-linux-gnueabi ]; then
+ rm -rf ${D}${base_libdir}/arm-linux-gnueabi
+ fi
+
+ if [ -d ${D}${base_libdir}/ldscripts ]; then
+ rm -rf ${D}${base_libdir}/ldscripts
+ fi
+
+ if [ -f ${D}${libdir}/libc.so ];then
+ sed -i -e "s# /lib64/${EAT_TARGET_SYS}# ../../lib64#g" -e "s# /usr/lib64/# /usr/lib/#g" -e "s# /usr/lib64/${EAT_TARGET_SYS}# .#g" -e "s# /lib64/ld-linux# ../../lib64/ld-linux#g" ${D}${libdir}/libc.so
+ sed -i -e "s# /lib64/libc.so.6# /lib/libc.so.6#g" ${D}${libdir}/libc.so
+ # cat kjasdkjasd
+ fi
+
+ if [ -f ${D}${base_libdir}/libc.so ];then
+ sed -i -e "s# /lib64/${EAT_TARGET_SYS}# ../../lib#g" -e "s# /usr/lib64/${EAT_TARGET_SYS}# .#g" "s# /lib64/# /lib/#g" ${D}${base_libdir}/libc.so
+ if [ -f ${D}${base_libdir}/libc.so.6 ]; then
+ sed -i -e "s# /usr/lib64/libc.so.6# /lib/libc.so.6#g" "s# /lib64/libc.so.6# /lib/libc.so.6#g" ${D}${base_libdir}/libc.so.6
+ fi
+ fi
+ if [ -f ${D}${base_libdir}/libpthread.so.0 ]; then
+ sed -i -e "s# /usr/lib64/libpthread.so.0# /lib/libpthread.so.0#g" ${D}${base_libdir}/libpthread.so.0
+ fi
+
+ # Remove if empty
+ rmdir ${D}${bindir} || true
+ rmdir ${D}${sbindir} || true
+}
+
+# PACKAGES is split up according to the 'source' recipes/includes in OE-core
+# Stylistic differences are kept to make copy/pasting easier.
+
+# From gcc-runtime.inc
+
+PACKAGES =+ "\
+ libstdc++ \
+ libstdc++-precompile-dev \
+ libstdc++-dbg \
+ libstdc++-dev \
+ libstdc++-staticdev \
+ libg2c \
+ libg2c-dev \
+ libssp \
+ libssp-dev \
+ libssp-staticdev \
+ libmudflap \
+ libmudflap-dev \
+ libmudflap-staticdev \
+ libquadmath \
+ libquadmath-dev \
+ libquadmath-staticdev \
+ libgomp \
+ libgomp-dev \
+ libgomp-staticdev \
+ libatomic \
+ libatomic-dev \
+ libatomic-staticdev \
+ libitm \
+ libitm-dev \
+ libitm-staticdev \
+ "
+
+# From gcc-sanitizers.inc
+
+PACKAGES += "libasan libubsan liblsan libtsan"
+PACKAGES += "libasan-dev libubsan-dev liblsan-dev libtsan-dev"
+PACKAGES += "libasan-staticdev libubsan-staticdev liblsan-staticdev libtsan-staticdev"
+
+# From libgfortran.inc:
+
+PACKAGES += "\
+ libgfortran \
+ libgfortran-dev \
+ libgfortran-staticdev \
+ "
+
+# libgcc.inc uses ${PN}, so replace that
+
+PACKAGES += "\
+ libgcc \
+ libgcc-dev \
+ libgcc-dbg \
+"
+
+# ... and the leftovers
+
+PACKAGES =+ "\
+ ${PN}-mtrace \
+ libgcov-dev \
+ linux-libc-headers \
+ linux-libc-headers-dev \
+"
+
+INSANE_SKIP_${PN}-dbg = "staticdev"
+INSANE_SKIP_${PN}-utils += "ldflags"
+INSANE_SKIP_libstdc++ += "ldflags"
+INSANE_SKIP_libgfortran += "ldflags"
+INSANE_SKIP_libgcc += "ldflags dev-deps"
+INSANE_SKIP_libgfortran += "ldflags dev-deps"
+INSANE_SKIP_libstdc++ += "ldflags dev-deps"
+INSANE_SKIP_libatomic += "ldflags"
+INSANE_SKIP_libasan += "ldflags"
+INSANE_SKIP_libubsan += "ldflags"
+INSANE_SKIP_libssp += "ldflags"
+INSANE_SKIP_libgomp += "ldflags"
+INSANE_SKIP_libitm += "ldflags"
+INSANE_SKIP_gdbserver += "ldflags"
+
+# OE-core has literally listed 'glibc' in LIBC_DEPENDENCIES :/
+RPROVIDES_${PN} = "glibc"
+# Add runtime provides for the other libc* packages as well
+RPROVIDES_${PN}-dev = "glibc-dev"
+RPROVIDES_${PN}-doc = "glibc-doc"
+RPROVIDES_${PN}-dbg = "glibc-dbg"
+RPROVIDES_${PN}-pic = "glibc-pic"
+RPROVIDES_${PN}-utils = "glibc-utils"
+RPROVIDES_${PN}-mtrace = "glibc-mtrace libc-mtrace"
+
+PKG_${PN} = "glibc"
+PKG_${PN}-dev = "glibc-dev"
+PKG_${PN}-doc = "glibc-doc"
+PKG_${PN}-dbg = "glibc-dbg"
+PKG_${PN}-pic = "glibc-pic"
+PKG_${PN}-utils = "glibc-utils"
+PKG_${PN}-mtrace = "glibc-mtrace"
+PKG_${PN}-gconv = "glibc-gconv"
+PKG_${PN}-extra-nss = "glibc-extra-nss"
+PKG_${PN}-thread-db = "glibc-thread-db"
+PKG_${PN}-pcprofile = "glibc-pcprofile"
+PKG_${PN}-staticdev = "glibc-staticdev"
+
+PKGV_${PN} = "${EAT_VER_LIBC}"
+PKGV_${PN}-dev = "${EAT_VER_LIBC}"
+PKGV_${PN}-doc = "${EAT_VER_LIBC}"
+PKGV_${PN}-dbg = "${EAT_VER_LIBC}"
+PKGV_${PN}-pic = "${EAT_VER_LIBC}"
+PKGV_${PN}-utils = "${EAT_VER_LIBC}"
+PKGV_${PN}-mtrace = "${EAT_VER_LIBC}"
+PKGV_${PN}-gconv = "${EAT_VER_LIBC}"
+PKGV_${PN}-extra-nss = "${EAT_VER_LIBC}"
+PKGV_${PN}-thread-db = "${EAT_VER_LIBC}"
+PKGV_${PN}-pcprofile = "${EAT_VER_LIBC}"
+PKGV_${PN}-staticdev = "${EAT_VER_LIBC}"
+PKGV_catchsegv = "${EAT_VER_LIBC}"
+PKGV_glibc-extra-nss = "${EAT_VER_LIBC}"
+PKGV_glibc-thread-db = "${EAT_VER_LIBC}"
+# PKGV_libcidn = "${EAT_VER_LIBC}"
+
+PKGV_libmemusage = "${EAT_VER_LIBC}"
+PKGV_libsegfault = "${EAT_VER_LIBC}"
+PKGV_libsotruss = "${EAT_VER_LIBC}"
+PKGV_sln = "${EAT_VER_LIBC}"
+PKGV_nscd = "${EAT_VER_LIBC}"
+PKGV_ldd = "${EAT_VER_LIBC}"
+
+PKGV_libasan-dev = "${EAT_VER_GCC}"
+PKGV_libasan = "${EAT_VER_GCC}"
+PKGV_libasan-staticdev = "${EAT_VER_GCC}"
+PKGV_libatomic-dev = "${EAT_VER_GCC}"
+PKGV_libatomic = "${EAT_VER_GCC}"
+PKGV_libatomic-staticdev = "${EAT_VER_GCC}"
+PKGV_libg2c-dev = "${EAT_VER_GCC}"
+PKGV_libg2c = "${EAT_VER_GCC}"
+PKGV_libgcc-dev = "${EAT_VER_GCC}"
+PKGV_libgcc = "${EAT_VER_GCC}"
+PKGV_libgfortran-dev = "${EAT_VER_GCC}"
+PKGV_libgfortran = "${EAT_VER_GCC}"
+PKGV_libgfortran-staticdev = "${EAT_VER_GCC}"
+PKGV_libgomp-dev = "${EAT_VER_GCC}"
+PKGV_libgomp = "${EAT_VER_GCC}"
+PKGV_libgomp-staticdev = "${EAT_VER_GCC}"
+PKGV_libitm-dev = "${EAT_VER_GCC}"
+PKGV_libitm = "${EAT_VER_GCC}"
+PKGV_libitm-staticdev = "${EAT_VER_GCC}"
+PKGV_liblsan-dev = "${EAT_VER_GCC}"
+PKGV_liblsan = "${EAT_VER_GCC}"
+PKGV_liblsan-staticdev = "${EAT_VER_GCC}"
+PKGV_libmudflap-dev = "${EAT_VER_GCC}"
+PKGV_libmudflap = "${EAT_VER_GCC}"
+PKGV_libmudflap-staticdev = "${EAT_VER_GCC}"
+PKGV_libquadmath-dev = "${EAT_VER_GCC}"
+PKGV_libquadmath = "${EAT_VER_GCC}"
+PKGV_libquadmath-staticdev = "${EAT_VER_GCC}"
+PKGV_libssp-dev = "${EAT_VER_GCC}"
+PKGV_libssp = "${EAT_VER_GCC}"
+PKGV_libssp-staticdev = "${EAT_VER_GCC}"
+PKGV_libstdc++-dbg = "${EAT_VER_GCC}"
+PKGV_libstdc++-dev = "${EAT_VER_GCC}"
+PKGV_libstdc++ = "${EAT_VER_GCC}"
+PKGV_libstdc++-precompile-dev = "${EAT_VER_GCC}"
+PKGV_libstdc++-staticdev = "${EAT_VER_GCC}"
+PKGV_libtsan-dev = "${EAT_VER_GCC}"
+PKGV_libtsan = "${EAT_VER_GCC}"
+PKGV_libtsan-staticdev = "${EAT_VER_GCC}"
+PKGV_libubsan-dev = "${EAT_VER_GCC}"
+PKGV_libubsan = "${EAT_VER_GCC}"
+PKGV_libubsan-staticdev = "${EAT_VER_GCC}"
+
+PKGV_linux-libc-headers-dev = "${EAT_VER_KERNEL}"
+PKGV_linux-libc-headers = "${EAT_VER_KERNEL}"
+
+PKGV_gdbserver = "${EAT_VER_GDBSERVER}"
+
+ALLOW_EMPTY_${PN}-mtrace = "1"
+FILES_${PN}-mtrace = "${bindir}/mtrace"
+
+FILES_libgcov-dev = "${libdir}/${TARGET_SYS}/${BINV}/libgcov.a"
+
+FILES_libsegfault = "${base_libdir}/libSegFault*"
+
+FILES_catchsegv = "${bindir}/catchsegv"
+RDEPENDS_catchsegv = "libsegfault"
+
+FILES_libquadmath = "${libdir}/libquadmath*.so.*"
+SUMMARY_libquadmath = "GNU quad-precision math library"
+FILES_libquadmath-dev = "\
+ ${base_libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
+ ${base_libdir}/libquadmath*.so \
+ ${base_libdir}/libquadmath.la \
+"
+SUMMARY_libquadmath-dev = "GNU quad-precision math library - development files"
+FILES_libquadmath-staticdev = "${base_libdir}/libquadmath.a"
+SUMMARY_libquadmath-staticdev = "GNU quad-precision math library - static development files"
+
+FILES_libatomic = "${base_libdir}/libatomic.so.*"
+FILES_libatomic-dev = "\
+ ${base_libdir}/libatomic.so \
+ ${base_libdir}/libatomic.la \
+"
+FILES_libatomic-staticdev = "${base_libdir}/libatomic.a"
+
+FILES_libasan = "${base_libdir}/libasan.so.*"
+FILES_libasan-dev = "\
+ ${base_libdir}/libasan.so \
+ ${base_libdir}/libasan.la \
+ ${base_libdir}/libsanitizer.spec \
+"
+FILES_libasan-staticdev = "${base_libdir}/libasan.a"
+
+FILES_libubsan = "${base_libdir}/libubsan.so.*"
+FILES_libubsan-dev = "\
+ ${base_libdir}/libubsan.so \
+ ${base_libdir}/libubsan.la \
+"
+FILES_libubsan-staticdev = "${base_libdir}/libubsan.a"
+
+FILES_liblsan = "${base_libdir}/liblsan.so.*"
+FILES_liblsan-dev = "\
+ ${base_libdir}/liblsan.so \
+ ${base_libdir}/liblsan.la \
+"
+FILES_libtsan-staticdev = "${base_libdir}/libtsan.a"
+
+FILES_libtsan = "${base_libdir}/libtsan.so.*"
+FILES_libtsan-dev = "\
+ ${base_libdir}/libtsan.so \
+ ${base_libdir}/libtsan.la \
+"
+FILES_libtsan-staticdev = "${base_libdir}/libtsan.a"
+
+FILES_libgcc = "${base_libdir}/libgcc_s.so.1"
+FILES_libgcc-dev = "${libdir}/libgcc_s.so"
+
+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}/libmemusage.so \
+ ${base_libdir}/libm-*.so \
+ ${base_libdir}/ld*.so.* \
+ ${base_libdir}/ld-*.so \
+ ${base_libdir}/libpthread*.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}/libthread_db*.so.* \
+ ${base_libdir}/libthread_db-*.so \
+ ${base_libdir}/libmemusage.so \
+ ${base_libdir}/libSegFault.so \
+ ${base_libdir}/libpcprofile.so \
+ "
+# ${base_libdir}/libcidn*.so.*
+
+FILES_${PN}-dbg += "${base_libdir}/debug"
+
+FILES_libstdc++ = "${base_libdir}/libstdc++.so.*"
+FILES_libstdc++-dev = "\
+ ${includedir}/c++/ \
+ ${base_libdir}/libstdc++.so \
+ ${base_libdir}/libstdc++.la \
+ ${base_libdir}/libsupc++.la"
+FILES_libstdc++-staticdev = "\
+ ${base_libdir}/libstdc++.a \
+ ${base_libdir}/libsupc++.a"
+FILES_libstdc++-dbg = "\
+ ${base_libdir}/debug/libstdc++.*"
+
+FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
+
+FILES_libssp = "${base_libdir}/libssp.so.*"
+FILES_libssp-dev = " \
+ ${base_libdir}/libssp*.so \
+ ${base_libdir}/libssp*_nonshared.a \
+ ${base_libdir}/libssp*.la \
+ ${base_libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp"
+FILES_libssp-staticdev = " \
+ ${base_libdir}/libssp*.a"
+
+FILES_libgfortran = "${base_libdir}/libgfortran.so.*"
+FILES_libgfortran-dev = " \
+ ${base_libdir}/libgfortran.so \
+ ${base_libdir}/libgfortran.spec"
+FILES_libgfortran-staticdev = " \
+ ${base_libdir}/libgfortran.a \
+ ${base_libdir}/libgfortranbegin.a"
+
+FILES_libmudflap = "${base_libdir}/libmudflap*.so.*"
+FILES_libmudflap-dev = "\
+ ${base_libdir}/libmudflap*.so \
+ ${base_libdir}/libmudflap*.a \
+ ${base_libdir}/libmudflap*.la"
+
+FILES_libitm = "${base_libdir}/libitm*${SOLIBS}"
+FILES_libitm-dev = "\
+ ${base_libdir}/libitm*${SOLIBSDEV} \
+ ${base_libdir}/libitm*.la \
+ ${base_libdir}/libitm.spec \
+ "
+FILES_libitm-staticdev = "\
+ ${base_libdir}/libitm*.a \
+ "
+
+FILES_libgomp = "${base_libdir}/libgomp*${SOLIBS}"
+FILES_libgomp-dev = "\
+ ${base_libdir}/libgomp*${SOLIBSDEV} \
+ ${base_libdir}/libgomp*.la \
+ ${base_libdir}/libgomp.spec \
+ ${base_libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
+ "
+FILES_libgomp-staticdev = "\
+ ${base_libdir}/libgomp*.a \
+ "
+EAT_VER_MAIN ??= ""
+
+
+python () {
+ if not d.getVar("EAT_VER_MAIN", False):
+ raise bb.parse.SkipPackage("External ARM toolchain not configured (EAT_VER_MAIN not set).")
+ import re
+ notglibc = (re.match('.*uclibc$', d.getVar('TARGET_OS', True)) != None) or (re.match('.*musl$', d.getVar('TARGET_OS', True)) != None)
+ if notglibc:
+ raise bb.parse.SkipPackage("incompatible with target %s" %
+ d.getVar('TARGET_OS', True))
+}
diff --git a/meta-linaro-toolchain/recipes-devtools/external-arm-toolchain/files/SUPPORTED b/meta-linaro-toolchain/recipes-devtools/external-arm-toolchain/files/SUPPORTED
new file mode 100644
index 00000000..9615075e
--- /dev/null
+++ b/meta-linaro-toolchain/recipes-devtools/external-arm-toolchain/files/SUPPORTED
@@ -0,0 +1 @@
+POSIX