From ba1954bc854b571667c0559968d914589139c1f4 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 21 Jul 2015 12:45:42 -0700 Subject: [PATCH 1/2] Split out blacklist_dynamic.bbclass Signed-off-by: Christopher Larson --- classes/blacklist_dynamic.bbclass | 41 +++++++++++++++++++ .../include/tcmode-external-sourcery.inc | 35 +++------------- 2 files changed, 47 insertions(+), 29 deletions(-) create mode 100644 classes/blacklist_dynamic.bbclass diff --git a/classes/blacklist_dynamic.bbclass b/classes/blacklist_dynamic.bbclass new file mode 100644 index 0000000..8a780c3 --- /dev/null +++ b/classes/blacklist_dynamic.bbclass @@ -0,0 +1,41 @@ +# Blacklist recipe names which include variable references, handling +# multilibs. +# +# Ex. PNBLACKLIST_DYNAMIC += "${MLPREFIX}gcc-cross-${TARGET_ARCH}" + +PNBLACKLIST_DYNAMIC ?= "" + +inherit blacklist + +python pnblacklist_dynamic_setup () { + d = e.data + + blacklisted = d.getVar('PNBLACKLIST_DYNAMIC', False) + if not blacklisted.strip(): + return + + multilibs = d.getVar('MULTILIBS', True) or '' + + # this block has been copied from base.bbclass so keep it in sync + prefixes = [] + for ext in multilibs.split(): + eext = ext.split(':') + if len(eext) > 1 and eext[0] == 'multilib': + prefixes.append(eext[1]) + + to_blacklist = set() + for prefix in [''] + prefixes: + localdata = bb.data.createCopy(d) + if prefix: + localdata.setVar('MLPREFIX', prefix + '-') + override = ':virtclass-multilib-' + prefix + localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override) + bb.data.update_data(localdata) + + to_blacklist |= set(filter(None, localdata.expand(blacklisted).split())) + + for blrecipe in to_blacklist: + d.setVarFlag('PNBLACKLIST', blrecipe, 'blacklisted by PNBLACKLIST_DYNAMIC') +} +pnblacklist_dynamic_setup[eventmask] = "bb.event.ConfigParsed" +addhandler pnblacklist_dynamic_setup diff --git a/conf/distro/include/tcmode-external-sourcery.inc b/conf/distro/include/tcmode-external-sourcery.inc index 4192e91..6c7a1e4 100644 --- a/conf/distro/include/tcmode-external-sourcery.inc +++ b/conf/distro/include/tcmode-external-sourcery.inc @@ -45,7 +45,7 @@ PREFERRED_PROVIDER_libgcc = "libgcc-external" PREFERRED_PROVIDER_linux-libc-headers = "linux-libc-headers-external" # Ensure that we don't pull in any internal toolchain recipes -INHERIT += "blacklist" +INHERIT += "blacklist blacklist_dynamic" PNBLACKLIST[uclibc] = "not building with an external toolchain" PNBLACKLIST[uclibc-initial] = "not building with an external toolchain" PNBLACKLIST[glibc] = "not building with an external toolchain" @@ -58,12 +58,12 @@ PNBLACKLIST[libgcc] = "not building with an external toolchain" PNBLACKLIST[linux-libc-headers] = "not building with an external toolchain" PNBLACKLIST[linux-libc-headers-yocto] = "not building with an external toolchain" PNBLACKLIST[external-sourcery-toolchain] = "using meta-sourcery, not poky's external toolchain" -EXTERNAL_PNBLACKLIST_MULTILIB += "\ - gcc-cross-${TARGET_ARCH} \ - gcc-cross-initial-${TARGET_ARCH} \ - binutils-cross-${TARGET_ARCH} \ + +PNBLACKLIST_DYNAMIC += "\ + ${MLPREFIX}gcc-cross-${TARGET_ARCH} \ + ${MLPREFIX}gcc-cross-initial-${TARGET_ARCH} \ + ${MLPREFIX}binutils-cross-${TARGET_ARCH} \ " -EXTERNAL_PNBLACKLIST_MULTILIB[doc] = "List of recipes to blacklist whose names vary in more than just prefix between multilib variants." # Determine the prefixes to check for based on the target architecture (before # any classes alter TARGET_ARCH) @@ -155,29 +155,6 @@ python toolchain_metadata_setup () { pass else: d.appendVar('TUNE_CCARGS', ' -msgxx-glibc') - - blacklisted = d.getVar('EXTERNAL_PNBLACKLIST_MULTILIB', False) - for var in d.expand(blacklisted).split(): - d.setVarFlag('PNBLACKLIST', var, 'not building with an external toolchain') - - multilibs = d.getVar('MULTILIBS', True) - if not multilibs: - return - - # this block has been copied from base.bbclass so keep it in sync - prefixes = [] - for ext in multilibs.split(): - eext = ext.split(':') - if len(eext) > 1 and eext[0] == 'multilib': - prefixes.append(eext[1]) - - for prefix in prefixes: - localdata = bb.data.createCopy(d) - override = ':virtclass-multilib-' + prefix - localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override) - bb.data.update_data(localdata) - for var in localdata.expand(blacklisted).split(): - e.data.setVarFlag('PNBLACKLIST', prefix + '-' + var, 'not building with an external toolchain') } toolchain_metadata_setup[eventmask] = "bb.event.ConfigParsed" addhandler toolchain_metadata_setup From bae98b2af6f47211854d0f8304dd2639df0b1024 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 21 Jul 2015 12:46:11 -0700 Subject: [PATCH 2/2] tcmode: blacklist gcc-source Signed-off-by: Christopher Larson --- conf/distro/include/tcmode-external-sourcery.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf/distro/include/tcmode-external-sourcery.inc b/conf/distro/include/tcmode-external-sourcery.inc index 6c7a1e4..f25aaeb 100644 --- a/conf/distro/include/tcmode-external-sourcery.inc +++ b/conf/distro/include/tcmode-external-sourcery.inc @@ -53,6 +53,7 @@ PNBLACKLIST[glibc-initial] = "not building with an external toolchain" PNBLACKLIST[glibc-intermediate] = "not building with an external toolchain" PNBLACKLIST[gcc-runtime] = "not building with an external toolchain" PNBLACKLIST[gcc-sanitizers] = "not building with an external toolchain" +PNBLACKLIST[gcc-source] = "not building with an external toolchain" PNBLACKLIST[libgcc-initial] = "not building with an external toolchain" PNBLACKLIST[libgcc] = "not building with an external toolchain" PNBLACKLIST[linux-libc-headers] = "not building with an external toolchain" @@ -63,6 +64,8 @@ PNBLACKLIST_DYNAMIC += "\ ${MLPREFIX}gcc-cross-${TARGET_ARCH} \ ${MLPREFIX}gcc-cross-initial-${TARGET_ARCH} \ ${MLPREFIX}binutils-cross-${TARGET_ARCH} \ + \ + gcc-source-${@'${GCCVERSION}'.replace('%', '')} \ " # Determine the prefixes to check for based on the target architecture (before @@ -188,6 +191,7 @@ addhandler toolchain_sanity_check require conf/distro/include/external-run.inc +GCCVERSION ?= "${@'.'.join('${GCC_VERSION}'.split('.')[:2])}%" GCC_VERSION = "${@external_run(d, 'gcc', '-dumpversion').rstrip()}" GCC_VERSION_allarch = "" GCC_VERSION[vardepvalue] = "${GCC_VERSION}"