diff mbox series

[2/2] arch-riscv.inc: fix TUNE_CCARGS:tune-<name> being ignored

Message ID 20261117193439.3120583-2-tgamblin@baylibre.com
State New
Headers show
Series [1/2] lib/oe/tune.py: fix typo in abbreviation example | expand

Commit Message

Trevor Gamblin Nov. 17, 2026, 7:34 p.m. UTC
When a tune set TUNE_CCARGS:tune-<name>, TUNE_CCARGS evaluated to the
literal string 'TUNE_CCARGS:tune-<name>' rather than to the expected
value. Use d.getVar() for it, falling back to the '-march' and '-mabi'
options generated from TUNE_FEATURES as before. Update the README to
match.

TUNE_CCARGS doesn't change for tunes that don't set
TUNE_CCARGS:tune-<name>.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
---
 meta/conf/machine/include/riscv/README         | 2 +-
 meta/conf/machine/include/riscv/arch-riscv.inc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/conf/machine/include/riscv/README b/meta/conf/machine/include/riscv/README
index beef68f523..4f043eb355 100644
--- a/meta/conf/machine/include/riscv/README
+++ b/meta/conf/machine/include/riscv/README
@@ -91,7 +91,7 @@  TUNE_RISCV_PKGARCH - This is the generated PKGARCH value.
 
 The standard variables are defined as:
 
-TUNE_CCARGS = "${@ '-march=${TUNE_RISCV_MARCH} -mabi=${TUNE_RISCV_ABI}' if not d.getVar('TUNE_CCARGS:tune-${DEFAULTTUNE}') else 'TUNE_CCARGS:tune-${DEFAULTTUNE}'}"
+TUNE_CCARGS = "${@d.getVar('TUNE_CCARGS:tune-${DEFAULTTUNE}') or '-march=${TUNE_RISCV_MARCH} -mabi=${TUNE_RISCV_ABI}'}"
 
 The above will allow the user to specify an implementation specific
 TUNE_CCARGS for a given processor tune if the default implementtion is
diff --git a/meta/conf/machine/include/riscv/arch-riscv.inc b/meta/conf/machine/include/riscv/arch-riscv.inc
index 6f9b74974d..625b60a7b8 100644
--- a/meta/conf/machine/include/riscv/arch-riscv.inc
+++ b/meta/conf/machine/include/riscv/arch-riscv.inc
@@ -113,7 +113,7 @@  TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbs", "_zbs"
 # Construct TUNE_CCARGS
 # This should result in a CCARG similar to:
 #   -march=rv32imac -mabi=ilp32
-TUNE_CCARGS = "${@ '-march=${TUNE_RISCV_MARCH} -mabi=${TUNE_RISCV_ABI}' if not d.getVar('TUNE_CCARGS:tune-${DEFAULTTUNE}') else 'TUNE_CCARGS:tune-${DEFAULTTUNE}'}"
+TUNE_CCARGS = "${@d.getVar('TUNE_CCARGS:tune-${DEFAULTTUNE}') or '-march=${TUNE_RISCV_MARCH} -mabi=${TUNE_RISCV_ABI}'}"
 
 # Construct TUNE_ARCH
 # This should result in an arch string similar to: