From cb1a58cf37bb7dc077a847216cd528d24bc1fb10 Mon Sep 17 00:00:00 2001 From: bernard Date: Wed, 25 Jun 2025 23:33:22 +0800 Subject: [PATCH] [vdso] fix the arch/abi flag issue. --- components/lwp/vdso/user/arch/risc-v/SConstruct | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/components/lwp/vdso/user/arch/risc-v/SConstruct b/components/lwp/vdso/user/arch/risc-v/SConstruct index 2f0838eead..4680384ca0 100644 --- a/components/lwp/vdso/user/arch/risc-v/SConstruct +++ b/components/lwp/vdso/user/arch/risc-v/SConstruct @@ -18,10 +18,11 @@ def get_riscv64_default_arch_abi(gcc_bin): arch = None abi = None for line in result.splitlines(): - if '-march=' in line and '[default]' in line: - arch = line.strip().split()[0] - if '-mabi=' in line and '[default]' in line: - abi = line.strip().split()[0] + if '-march=' in line: + arch = line.strip().split()[1] + arch = arch.split('_')[0] # Get the base architecture, e.g., rv64imafdc + if '-mabi=' in line and 'option' not in line: + abi = line.strip().split()[1] return arch, abi except Exception as e: print("Error getting arch/abi:", e) @@ -31,7 +32,7 @@ def get_riscv64_default_arch_abi(gcc_bin): CC_BIN = PREFIX + 'gcc' arch, abi = get_riscv64_default_arch_abi(CC_BIN) if arch and abi: - DEVICE = f' {arch} {abi} ' + DEVICE = f' -march={arch} -mabi={abi} ' else: DEVICE = ' -march=rv64imafdc -mabi=lp64' # fallback