Skip to contentSkip to conversation

tune-octeonx2: Do not use -mcpu=octeontx2 with clang

PATCH New Khem Raj 1 participant 1 message Jul 29, 2025

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/1 tune-octeonx2: Do not use -mcpu=octeontx2 with clang

-mcpu=octeontx2 is not implemented in clang, therefore replace it with -march option denoting underlying armv8 architecture revision.

Fixes:

    |   error: unsupported argument 'octeontx2+crypto' to option '-mcpu='
    |   error: unknown target CPU 'octeontx2'

---
v2: Use CPU_TUNE_OCTEONTX2 instead of CPU_TUNE_ARG for uniqueness

 meta/conf/machine/include/arm/armv8-2a/tune-octeontx2.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/conf/machine/include/arm/armv8-2a/tune-octeontx2.inc +3 -1
index e9d7a59c511..5eed3e5d15f 100644
@@ -1,7 +1,9 @@
 DEFAULTTUNE ?= "octeontx2"
 
 TUNEVALID[octeontx2] = "Enable Marvell octeontx2 specific processor optimizations"
-TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'octeontx2', ' -mcpu=octeontx2', '', d)}"
+CPU_TUNE_OCTEONTX2 ?= "-mcpu=octeontx2"
+CPU_TUNE_OCTEONTX2:toolchain-clang = "-march=armv8.2-a"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'octeontx2', ' ${CPU_TUNE_OCTEONTX2}', '', d)}"
 
 require conf/machine/include/arm/arch-armv8-2a.inc