mirror of
https://github.com/thead-yocto-mirror/meta-external-toolchain
synced 2026-09-06 07:54:37 +02:00
tcmode: go back to non-ConfigParsed set of sysroot var
BitBake doesn't run event handlers in registration order, which means there's
no way to know if a given bit of code (e.g. the tcmode set of
EXTERNAL_TOOLCHAIN_SYSROOT) has been set, from a different event handler. So
go back to using ${@}.
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
This commit is contained in:
@@ -49,6 +49,20 @@ ENABLE_BINARY_LOCALE_GENERATION = ""
|
||||
|
||||
TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_HOST}"
|
||||
|
||||
def sourcery_get_sysroot(d):
|
||||
import subprocess
|
||||
sysroot_cmd = "${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} -print-sysroot"
|
||||
try:
|
||||
toolchain_sysroot = bb.process.run(bb.data.expand(sysroot_cmd, d),
|
||||
stderr=subprocess.PIPE,
|
||||
env={"PATH": d.getVar('PATH', True)})[0].rstrip()
|
||||
except bb.process.CmdError as exc:
|
||||
bb.fatal(str(exc))
|
||||
else:
|
||||
return toolchain_sysroot
|
||||
|
||||
EXTERNAL_TOOLCHAIN_SYSROOT = "${@sourcery_get_sysroot(d)}"
|
||||
|
||||
CSL_IS_PRO = "${@'1' if os.path.exists('${EXTERNAL_TOOLCHAIN}/license') else '0'}"
|
||||
|
||||
TUNE_CCARGS_append_x86 = " ${@'-msgxx-glibc' if CSL_IS_PRO == '1' else ''}"
|
||||
@@ -71,16 +85,6 @@ python toolchain_metadata_setup () {
|
||||
l.finalize()
|
||||
oe_import(l)
|
||||
|
||||
sysroot_cmd = "${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} -print-sysroot"
|
||||
try:
|
||||
toolchain_sysroot = bb.process.run(bb.data.expand(sysroot_cmd, l),
|
||||
stderr=subprocess.PIPE,
|
||||
env={"PATH": l.getVar('PATH', True)})[0].rstrip()
|
||||
except bb.process.CmdError as exc:
|
||||
bb.fatal(str(exc))
|
||||
|
||||
d.setVar('EXTERNAL_TOOLCHAIN_SYSROOT', toolchain_sysroot)
|
||||
|
||||
if os.path.exists(bb.data.expand('${EXTERNAL_TOOLCHAIN}/bin/gcc', l)):
|
||||
d.setVar('TOOLCHAIN_PATH_ADD', '')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user