Complete Yocto mirror with license table for TQMa6UL (2038-compliance)
- 264 license table entries with exact download URLs (224/264 resolved) - Complete sources/ directory with all BitBake recipes - Build configuration: tqma6ul-multi-mba6ulx, spaetzle (musl) - Full traceability for Softwarefreigabeantrag - GCC 13.4.0, Linux 6.6.102, U-Boot 2023.04, musl 1.2.4 - License distribution: GPL-2.0 (24), MIT (23), GPL-2.0+ (18), BSD-3 (16)
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
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 or release 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] == '(Arm':
|
||||
# gcc version 11.3.1 20220712 (Arm GNU Toolchain 11.3.Rel1)
|
||||
return version.split()[7].split(')')[0]
|
||||
elif version.split()[4] == '(GNU':
|
||||
# gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))
|
||||
# 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]
|
||||
elif version.split()[3] == '(GNU':
|
||||
# gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))
|
||||
return version.split()[9].split('-')[1]
|
||||
else:
|
||||
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
|
||||
import subprocess
|
||||
|
||||
syspath = bb.data.expand('${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}', d)
|
||||
if not syspath:
|
||||
return 'UNKNOWN'
|
||||
|
||||
topdir = d.getVar('TOPDIR', True)
|
||||
lddpath = syspath + '/libc/usr/bin/ldd'
|
||||
|
||||
if os.path.exists(lddpath):
|
||||
cmd = '/bin/sh ' + lddpath + ' --version'
|
||||
try:
|
||||
stdout, stderr = bb.process.run(cmd, cwd=topdir, stderr=subprocess.PIPE)
|
||||
except bb.process.CmdError as exc:
|
||||
bb.error('Failed to obtain external Arm libc version: %s' % exc)
|
||||
return 'UNKNOWN'
|
||||
else:
|
||||
first_line = stdout.splitlines()[0]
|
||||
return first_line.split()[2]
|
||||
|
||||
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]
|
||||
|
||||
def eat_get_bfd_version(d):
|
||||
try:
|
||||
stdout, stderr = eat_run(d, 'as', '--version')
|
||||
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()
|
||||
|
||||
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))
|
||||
d.setVar('EAT_VER_BFD', eat_get_bfd_version(ld))
|
||||
}
|
||||
addhandler external_arm_toolchain_version_handler
|
||||
@@ -0,0 +1,129 @@
|
||||
#
|
||||
# Configuration to use an external Arm binary toolchain
|
||||
#
|
||||
|
||||
EXTERNAL_TOOLCHAIN ?= "/usr/local/arm-binary-toolchain/${TARGET_ARCH}"
|
||||
|
||||
# oe-core passes this by default because it assumes GCC 13. This can be removed when Arm GCC is 13.1+.
|
||||
DEBUG_PREFIX_MAP:remove = "-fcanon-prefix-map"
|
||||
|
||||
TOOLCHAIN_PATH_ADD = "${EXTERNAL_TOOLCHAIN}/bin:"
|
||||
PATH =. "${TOOLCHAIN_PATH_ADD}"
|
||||
|
||||
EAT_TARGET_SYS:arm ?= "${@ 'arm-none-linux-gnueabihf' if os.path.exists('${EXTERNAL_TOOLCHAIN}/bin/arm-none-linux-gnueabihf-gcc') else 'arm-linux-gnueabihf'}"
|
||||
EAT_TARGET_SYS:aarch64 ?= "${@ 'aarch64-none-linux-gnu' if os.path.exists('${EXTERNAL_TOOLCHAIN}/bin/aarch64-none-linux-gnu-gcc') else 'aarch64-linux-gnu'}"
|
||||
EAT_TARGET_SYS = "${TARGET_SYS}"
|
||||
TARGET_PREFIX = "${EAT_TARGET_SYS}-"
|
||||
|
||||
EXTERNAL_TOOLCHAIN_LIBDIR = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/usr/lib', '/lib', d)}"
|
||||
EXTERNAL_TOOLCHAIN_DYN_LINKER_PATH:arm ?= " -Wl,--dynamic-linker=${EXTERNAL_TOOLCHAIN_LIBDIR}/ld-linux-armhf.so.3"
|
||||
EXTERNAL_TOOLCHAIN_DYN_LINKER_PATH:aarch64 ?= " -Wl,--dynamic-linker=${EXTERNAL_TOOLCHAIN_LIBDIR}/ld-linux-aarch64.so.1"
|
||||
TARGET_LDFLAGS:append:class-target = "${EXTERNAL_TOOLCHAIN_DYN_LINKER_PATH}"
|
||||
|
||||
EAT_LIBDIR:arm = "lib"
|
||||
EAT_LIBDIR:aarch64 = "lib64"
|
||||
|
||||
GCCMULTILIB:forcevariable = "--disable-multilib"
|
||||
IMAGE_LINGUAS:forcevariable = ""
|
||||
|
||||
# Blacklist toolchain recipes as a belt-and-suspenders way to use the external toolchain
|
||||
SKIP_RECIPE[glibc] = "Using external toolchain"
|
||||
SKIP_RECIPE[libgcc] = "Using external toolchain"
|
||||
SKIP_RECIPE[gcc-cross] = "Using external toolchain"
|
||||
SKIP_RECIPE[gcc-cross-aarch64] = "Using external toolchain"
|
||||
SKIP_RECIPE[gcc-cross-arm] = "Using external toolchain"
|
||||
SKIP_RECIPE[gcc-runtime] = "Using external toolchain"
|
||||
SKIP_RECIPE[gcc-sanitizers] = "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/libc-locale = "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"
|
||||
|
||||
PREFERRED_PROVIDER_gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "external-arm-sdk-toolchain-${TRANSLATED_TARGET_ARCH}"
|
||||
PREFERRED_PROVIDER_binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "external-arm-sdk-toolchain-${TRANSLATED_TARGET_ARCH}"
|
||||
PREFERRED_PROVIDER_gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "external-arm-sdk-toolchain-${TRANSLATED_TARGET_ARCH}"
|
||||
|
||||
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-locales libc-locale-code libc-charsets \
|
||||
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"
|
||||
LIBCOVERRIDE = ":libc-glibc"
|
||||
LIBC_DEPENDENCIES:remove = "glibc-gconv-cp1252 glibc-gconv-ibm850 glibc-gconv-iso8859-1 glibc-gconv-iso8859-15 glibc-localedata-i18n"
|
||||
|
||||
ERROR_QA[type] ?= "list"
|
||||
python toolchain_metadata_setup () {
|
||||
import subprocess
|
||||
if not isinstance(e, bb.event.ConfigParsed):
|
||||
return
|
||||
|
||||
d = e.data
|
||||
l = d.createCopy()
|
||||
|
||||
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.isabs(external_toolchain):
|
||||
bb.fatal("Error: EXTERNAL_TOOLCHAIN path '%s' must be absolute path" % external_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()
|
||||
|
||||
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
|
||||
12
sources/meta-arm/meta-arm-toolchain/conf/layer.conf
Normal file
12
sources/meta-arm/meta-arm-toolchain/conf/layer.conf
Normal file
@@ -0,0 +1,12 @@
|
||||
BBPATH .= ":${LAYERDIR}"
|
||||
BBFILES += "\
|
||||
${LAYERDIR}/recipes-*/*/*.bb \
|
||||
${LAYERDIR}/recipes-*/*/*.bbappend \
|
||||
"
|
||||
|
||||
BBFILE_COLLECTIONS += "arm-toolchain"
|
||||
BBFILE_PATTERN_arm-toolchain := "^${LAYERDIR}/"
|
||||
BBFILE_PRIORITY_arm-toolchain = "5"
|
||||
|
||||
LAYERDEPENDS_arm-toolchain = "core"
|
||||
LAYERSERIES_COMPAT_arm-toolchain = "nanbield scarthgap"
|
||||
Reference in New Issue
Block a user