@@ -93,7 +93,8 @@ RISCVPKGARCH - This is the package arch actually used. As with ARMPKGARCH
on arm, each tune sets it as a literal in
RISCVPKGARCH:tune-<name>, so that it only changes when
deliberately changed. Tunes that don't set it fall back to
- TUNE_RISCV_PKGARCH.
+ TUNE_RISCV_PKGARCH, which is an error if that is longer
+ than 64 characters.
The standard variables are defined as:
@@ -301,7 +301,13 @@ TUNE_ARCH = "${TUNE_RISCV_ARCH}"
# Tunes that don't set it fall back to TUNE_RISCV_PKGARCH, which is built from
# TUNE_FEATURES above, e.g.:
# riscv32imac
-RISCVPKGARCH = "${@d.getVar('RISCVPKGARCH:tune-${DEFAULTTUNE}') or d.getVar('TUNE_RISCV_PKGARCH')}"
+# However, TUNE_RISCV_PKGARCH grows with every extension the tune enables, so to
+# keep build and sstate paths manageable, RISCVPKGARCH:tune-<name> should be set
+# for a custom tune. For TUNE_RISCV_PKGARCH longer than 64 characters, throw an
+# error.
+RISCVPKGARCH = "${@d.getVar('RISCVPKGARCH:tune-${DEFAULTTUNE}') or \
+ ('${TUNE_RISCV_PKGARCH}' if len('${TUNE_RISCV_PKGARCH}') <= 64 else \
+ bb.fatal('The package arch for tune ${DEFAULTTUNE} would be ${TUNE_RISCV_PKGARCH}, which is longer than 64 characters. Set RISCVPKGARCH:tune-${DEFAULTTUNE} to a shorter name.'))}"
TUNE_PKGARCH = "${RISCVPKGARCH}"
# Misc settings
Tunes that don't set RISCVPKGARCH:tune-<name> fall back to TUNE_RISCV_PKGARCH, which grows with every extension enabled. This can easily exceed allowable maximums for build and sstate paths, so make it a fatal error when it's longer than 64 characters and inform the user to set RISCVPKGARCH:tune-<name> instead. Existing tunes already set RISCVPKGARCH:tune-<name>, so they are unaffected. The longest known fallback is currently Microblaze-V's riscv64imafdc_zicsr_zifencei_zba_zbb_zbs at 41 characters, which is well under the set limit. Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> --- meta/conf/machine/include/riscv/README | 3 ++- meta/conf/machine/include/riscv/arch-riscv.inc | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-)