File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
components/lwp/vdso/user/arch/risc-v Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,11 @@ def get_riscv64_default_arch_abi(gcc_bin):
18
18
arch = None
19
19
abi = None
20
20
for line in result .splitlines ():
21
- if '-march=' in line and '[default]' in line :
22
- arch = line .strip ().split ()[0 ]
23
- if '-mabi=' in line and '[default]' in line :
24
- abi = line .strip ().split ()[0 ]
21
+ if '-march=' in line :
22
+ arch = line .strip ().split ()[1 ]
23
+ arch = arch .split ('_' )[0 ] # Get the base architecture, e.g., rv64imafdc
24
+ if '-mabi=' in line and 'option' not in line :
25
+ abi = line .strip ().split ()[1 ]
25
26
return arch , abi
26
27
except Exception as e :
27
28
print ("Error getting arch/abi:" , e )
@@ -31,7 +32,7 @@ def get_riscv64_default_arch_abi(gcc_bin):
31
32
CC_BIN = PREFIX + 'gcc'
32
33
arch , abi = get_riscv64_default_arch_abi (CC_BIN )
33
34
if arch and abi :
34
- DEVICE = f' { arch } { abi } '
35
+ DEVICE = f' -march= { arch } -mabi= { abi } '
35
36
else :
36
37
DEVICE = ' -march=rv64imafdc -mabi=lp64' # fallback
37
38
You can’t perform that action at this time.
0 commit comments