Skip to content

Commit 98b3c68

Browse files
committed
尝试修复k230找不到工具链的问题
1 parent 22d801d commit 98b3c68

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

components/lwp/vdso/SConscript

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,19 @@ if not os.path.exists(cwd + "/user" + "/arch" +"/" + rtconfig.ARCH + "/vdso.lds"
3636
# clean = ["xmake", "clean"]
3737

3838
vdso_file = os.path.join(cwd, 'user',"arch", rtconfig.ARCH, 'SConstruct')
39-
EXEC_PATH_PASS = "EXEC_PATH=" + rtconfig.EXEC_PATH
40-
command = ["scons", "-f", vdso_file, EXEC_PATH_PASS]
41-
clean = ["scons", "-f", vdso_file, "--clean"]
4239

43-
if not GetOption('clean'):
44-
result = subprocess.run(command)
40+
process_env = os.environ.copy()
41+
if hasattr(rtconfig, 'EXEC_PATH') and rtconfig.EXEC_PATH is not None:
42+
process_env['EXEC_PATH'] = rtconfig.EXEC_PATH
43+
if hasattr(rtconfig, 'PREFIX') and rtconfig.PREFIX is not None:
44+
process_env['CC_PREFIX'] = rtconfig.PREFIX
45+
command = ["scons", "-f", vdso_file]
46+
clean_command = ["scons", "-f", vdso_file, "--clean"]
47+
48+
if not GetOption('clean'):
49+
result = subprocess.run(command, env=process_env, check=True)
4550
else:
46-
result = subprocess.run(clean)
51+
result = subprocess.run(clean_command, env=process_env, check=True)
4752

4853
if result.returncode == 0:
4954
print("Command executed successfully")

components/lwp/vdso/user/arch/risc-v/SConstruct

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import sys
33
import subprocess
4+
from PIL.SpiderImagePlugin import iforms
45

56
arguments = sys.argv[2]
67
vdso_usr = os.path.dirname(arguments)
@@ -11,11 +12,12 @@ rt_root_path = os.path.abspath(os.path.join(vdso_usr, "../../../../../../"))
1112
include_path = os.path.join(rt_root_path, "include")
1213
rtconfig_path = os.path.join(rt_root_path, "bsp", "qemu-virt64-riscv")
1314

14-
EXEC_PATH = ARGUMENTS.get('EXEC_PATH')
15+
EXEC_PATH = os.getenv('EXEC_PATH')
1516
if not EXEC_PATH:
1617
EXEC_PATH = os.getenv('RTT_EXEC_PATH') or '/usr/bin'
17-
PREFIX = os.getenv('RTT_CC_PREFIX') or 'riscv64-unknown-linux-gnu-'
18-
18+
PREFIX = os.getenv('CC_PREFIX')
19+
if not PREFIX:
20+
PREFIX = os.getenv('RTT_CC_PREFIX') or 'riscv64-unknown-linux-gnu-'
1921
CC = PREFIX + 'gcc'
2022
CXX = PREFIX + 'g++'
2123
CPP = PREFIX + 'cpp'

0 commit comments

Comments
 (0)