uninative/utils: Drop workarounds for gcc 4.8/4.9

We require at least gcc 8.0 in sanity.bbclass so drop the 4.8/4.9
special case handling in uninative.

(From OE-Core rev: 552e037bf598ac523f35b69d2dafc99e5ba59c5f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2025-07-01 20:38:24 +01:00
parent 243d54fd46
commit 204653a519
5 changed files with 3 additions and 42 deletions

View File

@ -142,7 +142,7 @@ def enable_uninative(d):
loader = d.getVar("UNINATIVE_LOADER")
if os.path.exists(loader):
bb.debug(2, "Enabling uninative")
d.setVar("NATIVELSBSTRING", "universal%s" % oe.utils.host_gcc_version(d))
d.setVar("NATIVELSBSTRING", "universal")
d.appendVar("SSTATEPOSTUNPACKFUNCS", " uninative_changeinterp")
d.appendVarFlag("SSTATEPOSTUNPACKFUNCS", "vardepvalueexclude", "| uninative_changeinterp")
d.appendVar("BUILD_LDFLAGS", " -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=${UNINATIVE_LOADER} -pthread")

View File

@ -373,7 +373,6 @@ EOF
-e 's#@SDK_VERSION@#${SDK_VERSION}#g' \
-e '/@SDK_PRE_INSTALL_COMMAND@/d' \
-e '/@SDK_POST_INSTALL_COMMAND@/d' \
-e 's#@SDK_GCC_VER@#${@oe.utils.host_gcc_version(d, taskcontextonly=True)}#g' \
-e 's#@SDK_ARCHIVE_TYPE@#${SDK_ARCHIVE_TYPE}#g' \
${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.sh

View File

@ -150,7 +150,6 @@ def create_filtered_tasklist(d, sdkbasepath, tasklistfile, conf_initpath):
with open(sdkbasepath + '/conf/local.conf', 'a') as f:
# Force the use of sstate from the build system
f.write('\nSSTATE_DIR:forcevariable = "%s"\n' % d.getVar('SSTATE_DIR'))
f.write('SSTATE_MIRRORS:forcevariable = "file://universal/(.*) file://universal-4.9/\\1 file://universal-4.9/(.*) file://universal-4.8/\\1"\n')
# Ensure TMPDIR is the default so that clean_esdk_builddir() can delete it
f.write('TMPDIR:forcevariable = "${TOPDIR}/tmp"\n')
# Drop uninative if the build isn't using it (or else NATIVELSBSTRING will
@ -380,9 +379,6 @@ def write_local_conf(d, baseoutpath, derivative, core_meta_subdir, uninative_che
f.write('# Provide a flag to indicate we are in the EXT_SDK Context\n')
f.write('WITHIN_EXT_SDK = "1"\n\n')
# Map gcc-dependent uninative sstate cache for installer usage
f.write('SSTATE_MIRRORS += " file://universal/(.*) file://universal-4.9/\\1 file://universal-4.9/(.*) file://universal-4.8/\\1"\n\n')
if d.getVar("PRSERV_HOST"):
# Override this, we now include PR data, so it should only point ot the local database
f.write('PRSERV_HOST = "localhost:0"\n\n')
@ -491,8 +487,8 @@ def prepare_locked_cache(d, baseoutpath, derivative, conf_initpath):
sstate_out = baseoutpath + '/sstate-cache'
bb.utils.remove(sstate_out, True)
# uninative.bbclass sets NATIVELSBSTRING to 'universal%s' % oe.utils.host_gcc_version(d)
fixedlsbstring = "universal%s" % oe.utils.host_gcc_version(d) if bb.data.inherits_class('uninative', d) else ""
# uninative.bbclass sets NATIVELSBSTRING to 'universal'
fixedlsbstring = "universal" if bb.data.inherits_class('uninative', d) else ""
sdk_include_toolchain = (d.getVar('SDK_INCLUDE_TOOLCHAIN') == '1')
sdk_ext_type = d.getVar('SDK_EXT_TYPE')

View File

@ -31,9 +31,6 @@ tweakpath /sbin
INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
INST_GCC_VER=$(gcc --version 2>/dev/null | sed -ne 's/.* \([0-9]\+\.[0-9]\+\)\.[0-9]\+.*/\1/p')
SDK_GCC_VER='@SDK_GCC_VER@'
verlte () {
[ "$1" = "`printf "$1\n$2" | sort -V | head -n1`" ]
}
@ -145,11 +142,6 @@ fi
# SDK_EXTENSIBLE is exposed from the SDK_PRE_INSTALL_COMMAND above
if [ "$SDK_EXTENSIBLE" = "1" ]; then
DEFAULT_INSTALL_DIR="@SDKEXTPATH@"
if [ "$INST_GCC_VER" = '4.8' -a "$SDK_GCC_VER" = '4.9' ] || [ "$INST_GCC_VER" = '4.8' -a "$SDK_GCC_VER" = '' ] || \
[ "$INST_GCC_VER" = '4.9' -a "$SDK_GCC_VER" = '' ]; then
echo "Error: Incompatible SDK installer! Your host gcc version is $INST_GCC_VER and this SDK was built by gcc higher version."
exit 1
fi
fi
if [ "$target_sdk_dir" = "" ]; then

View File

@ -444,32 +444,6 @@ def get_host_compiler_version(d, taskcontextonly=False):
version = match.group(1)
return compiler, version
def host_gcc_version(d, taskcontextonly=False):
import re, subprocess
if taskcontextonly and d.getVar('BB_WORKERCONTEXT') != '1':
return
compiler = d.getVar("BUILD_CC")
# Get rid of ccache since it is not present when parsing.
if compiler.startswith('ccache '):
compiler = compiler[7:]
try:
env = os.environ.copy()
env["PATH"] = d.getVar("PATH")
output = subprocess.check_output("%s --version" % compiler, \
shell=True, env=env, stderr=subprocess.STDOUT).decode("utf-8")
except subprocess.CalledProcessError as e:
bb.fatal("Error running %s --version: %s" % (compiler, e.output.decode("utf-8")))
match = re.match(r".* (\d+\.\d+)\.\d+.*", output.split('\n')[0])
if not match:
bb.fatal("Can't get compiler version from %s --version output" % compiler)
version = match.group(1)
return "-%s" % version if version in ("4.8", "4.9") else ""
@bb.parse.vardepsexclude("DEFAULTTUNE_MULTILIB_ORIGINAL", "OVERRIDES")
def get_multilib_datastore(variant, d):
localdata = bb.data.createCopy(d)