summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbernard <[email protected]>2025-06-25 23:33:22 +0800
committerRbb666 <[email protected]>2025-06-30 09:52:09 +0800
commitcb1a58cf37bb7dc077a847216cd528d24bc1fb10 (patch)
treeae6936ce8818bffbf28e3783df012892c4d06c95
parenta5359b7223f164a3b11f96637742c7c0a97ad2b8 (diff)
[vdso] fix the arch/abi flag issue.
-rw-r--r--components/lwp/vdso/user/arch/risc-v/SConstruct11
1 files 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