summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2026-10-15 09:14:48 -0300
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2026-10-15 18:16:02 +0000
commit6c1571ce3991629064f6ab0415f8b4114660f597 (patch)
tree61caa612138e67a9b87e80c24a177e346b6e874d
parent452dba532c30dad43ab6c537fb8ea9fa8cb8bf7c (diff)
downloadmeta-freescale-backport-2822-to-blacksail.tar.gz
fsl-dynamic-packagearch: Share the SoC architecture listbackport-2822-to-blacksail
The anonymous function and fsl_dynamic_packagearch_sstate_archs() each built the list of SoC architectures, so a change to one could leave SSTATE_ARCHS out of step with PACKAGE_EXTRA_ARCHS. Move the list into fsl_dynamic_packagearch_extra_archs(): the anonymous function appends its result to PACKAGE_EXTRA_ARCHS, as before, and fsl_dynamic_packagearch_sstate_archs() adds the ones not yet in PACKAGE_ARCHS to SSTATE_ARCHS. PACKAGE_EXTRA_ARCHS, PACKAGE_ARCHS and SSTATE_ARCHS are unchanged, in the configuration and for busybox (with ARM_INSTRUCTION_SET "arm") and libdrm, on imx6qdlsabresd, imx8mp-lpddr4-evk, imx8mn-lpddr4-evk, t2080rdb and ls1046ardb, and with a lib32 multilib on imx8mp-lpddr4-evk. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> (cherry picked from commit b066c37416acb14c016fec83baf4c540c7a4ee99)
-rw-r--r--classes/fsl-dynamic-packagearch.bbclass48
1 files changed, 23 insertions, 25 deletions
diff --git a/classes/fsl-dynamic-packagearch.bbclass b/classes/fsl-dynamic-packagearch.bbclass
index f16c1bfdb..0e6999a58 100644
--- a/classes/fsl-dynamic-packagearch.bbclass
+++ b/classes/fsl-dynamic-packagearch.bbclass
@@ -53,10 +53,27 @@ python __anonymous () {
53 bb.debug(1, "Use '%s' as package architecture for '%s'" % (package_arch, PN)) 53 bb.debug(1, "Use '%s' as package architecture for '%s'" % (package_arch, PN))
54 d.setVar("PACKAGE_ARCH", package_arch) 54 d.setVar("PACKAGE_ARCH", package_arch)
55 55
56 for arch in fsl_dynamic_packagearch_extra_archs(d):
57 d.appendVar("PACKAGE_EXTRA_ARCHS", " %s" % arch)
58}
59
60MACHINE_SOCARCH = "${TUNE_PKGARCH}${MACHINE_SOCARCH_SUFFIX}"
61
62ARM_EXTRA_SOCARCH = "${ARMPKGARCH}${ARMPKGSFX_DSP}${ARMPKGSFX_EABI}${ARMPKGSFX_ENDIAN}${ARMPKGSFX_FPU}${MACHINE_SOCARCH_SUFFIX}"
63THUMB_EXTRA_SOCARCH = "${ARMPKGARCH}${ARM_THUMB_SUFFIX}${ARMPKGSFX_DSP}${ARMPKGSFX_EABI}${ARMPKGSFX_ENDIAN}${ARMPKGSFX_FPU}${MACHINE_SOCARCH_SUFFIX}"
64
65# The SoC architectures are added per recipe, so list them here too: OE-core
66# only removes stale sysroot manifests for the architectures in SSTATE_ARCHS.
67SSTATE_ARCHS:append = " ${@fsl_dynamic_packagearch_sstate_archs(d)}"
68
69# The SoC architectures to add to PACKAGE_EXTRA_ARCHS, in order
70def fsl_dynamic_packagearch_extra_archs(d):
56 cur_package_archs = (d.getVar("PACKAGE_ARCHS") or "").split() 71 cur_package_archs = (d.getVar("PACKAGE_ARCHS") or "").split()
72 archs = []
73
57 machine_socarch = (d.getVar("MACHINE_SOCARCH") or "") 74 machine_socarch = (d.getVar("MACHINE_SOCARCH") or "")
58 if not machine_socarch in cur_package_archs: 75 if not machine_socarch in cur_package_archs:
59 d.appendVar("PACKAGE_EXTRA_ARCHS", " %s" % machine_socarch) 76 archs.append(machine_socarch)
60 77
61 multilib_variants = (d.getVar("MULTILIB_VARIANTS") or "").split() 78 multilib_variants = (d.getVar("MULTILIB_VARIANTS") or "").split()
62 for variant in multilib_variants: 79 for variant in multilib_variants:
@@ -67,39 +84,20 @@ python __anonymous () {
67 for arch in package_extra_archs_tune_archs: 84 for arch in package_extra_archs_tune_archs:
68 socarch = arch + arch_suffix 85 socarch = arch + arch_suffix
69 if not socarch in cur_package_archs: 86 if not socarch in cur_package_archs:
70 d.appendVar("PACKAGE_EXTRA_ARCHS", " %s" % socarch ) 87 archs.append(socarch)
71 88
72 if d.getVar("TUNE_ARCH") == "arm": 89 if d.getVar("TUNE_ARCH") == "arm":
73 # For ARM we have two possible machine_socarch values, one for the arm and one for the thumb instruction set 90 # For ARM we have two possible machine_socarch values, one for the arm and one for the thumb instruction set
74 # add the other value to extra archs also, so that a image recipe searches both for packages. 91 # add the other value to extra archs also, so that a image recipe searches both for packages.
75 if d.getVar("ARM_INSTRUCTION_SET") == "thumb": 92 if d.getVar("ARM_INSTRUCTION_SET") == "thumb":
76 d.appendVar("PACKAGE_EXTRA_ARCHS", " %s" % d.getVar("ARM_EXTRA_SOCARCH")) 93 archs.append(d.getVar("ARM_EXTRA_SOCARCH"))
77 else: 94 else:
78 d.appendVar("PACKAGE_EXTRA_ARCHS", " %s" % d.getVar("THUMB_EXTRA_SOCARCH")) 95 archs.append(d.getVar("THUMB_EXTRA_SOCARCH"))
79}
80 96
81MACHINE_SOCARCH = "${TUNE_PKGARCH}${MACHINE_SOCARCH_SUFFIX}" 97 return archs
82
83ARM_EXTRA_SOCARCH = "${ARMPKGARCH}${ARMPKGSFX_DSP}${ARMPKGSFX_EABI}${ARMPKGSFX_ENDIAN}${ARMPKGSFX_FPU}${MACHINE_SOCARCH_SUFFIX}"
84THUMB_EXTRA_SOCARCH = "${ARMPKGARCH}${ARM_THUMB_SUFFIX}${ARMPKGSFX_DSP}${ARMPKGSFX_EABI}${ARMPKGSFX_ENDIAN}${ARMPKGSFX_FPU}${MACHINE_SOCARCH_SUFFIX}"
85
86# The SoC architectures are added per recipe, so list them here too: OE-core
87# only removes stale sysroot manifests for the architectures in SSTATE_ARCHS.
88SSTATE_ARCHS:append = " ${@fsl_dynamic_packagearch_sstate_archs(d)}"
89 98
90def fsl_dynamic_packagearch_sstate_archs(d): 99def fsl_dynamic_packagearch_sstate_archs(d):
91 arch_suffix = d.getVar("MACHINE_SOCARCH_SUFFIX") or ""
92 archs = [d.getVar("MACHINE_SOCARCH")]
93
94 for variant in (d.getVar("MULTILIB_VARIANTS") or "").split():
95 defaulttune = d.getVar("DEFAULTTUNE:virtclass-multilib-" + variant)
96 if defaulttune:
97 for arch in (d.getVar("PACKAGE_EXTRA_ARCHS:tune-" + defaulttune) or "").split():
98 archs.append(arch + arch_suffix)
99
100 if d.getVar("TUNE_ARCH") == "arm":
101 archs += [d.getVar("ARM_EXTRA_SOCARCH"), d.getVar("THUMB_EXTRA_SOCARCH")]
102
103 # Within a recipe the anonymous function has already added them 100 # Within a recipe the anonymous function has already added them
104 cur_package_archs = (d.getVar("PACKAGE_ARCHS") or "").split() 101 cur_package_archs = (d.getVar("PACKAGE_ARCHS") or "").split()
102 archs = fsl_dynamic_packagearch_extra_archs(d)
105 return " ".join(arch for arch in dict.fromkeys(archs) if arch and arch not in cur_package_archs) 103 return " ".join(arch for arch in dict.fromkeys(archs) if arch and arch not in cur_package_archs)