Files
rt-thread/components/lwp/vdso/SConscript
bernard e00143904f
Some checks failed
pkgs_test / change (push) Has been skipped
ToolsCI / Tools (push) Has been cancelled
AutoTestCI / components/cpp11 (push) Has been cancelled
AutoTestCI / kernel/atomic (push) Has been cancelled
AutoTestCI / kernel/atomic/riscv64 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11/riscv64 (push) Has been cancelled
AutoTestCI / kernel/device (push) Has been cancelled
AutoTestCI / kernel/ipc (push) Has been cancelled
AutoTestCI / kernel/irq (push) Has been cancelled
AutoTestCI / kernel/mem (push) Has been cancelled
AutoTestCI / kernel/mem/riscv64 (push) Has been cancelled
AutoTestCI / kernel/thread (push) Has been cancelled
AutoTestCI / kernel/timer (push) Has been cancelled
AutoTestCI / rtsmart/aarch64 (push) Has been cancelled
AutoTestCI / rtsmart/arm (push) Has been cancelled
AutoTestCI / rtsmart/riscv64 (push) Has been cancelled
AutoTestCI / components/utest (push) Has been cancelled
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
[smart] Optimize error handling after command execution
2025-07-07 09:44:37 +08:00

52 lines
1.7 KiB
Python

import os
import rtconfig
import subprocess
from building import *
group = []
cwd = GetCurrentDir()
CPPPATH = [cwd, cwd + "/kernel"]
list = os.listdir(cwd)
src = Glob('kernel/*.c') + Glob('kernel/*.S')
if not GetDepend(['RT_USING_VDSO']):
Return('group')
if rtconfig.ARCH != "aarch64" and rtconfig.ARCH != "risc-v":
# not supported arch
src = []
else:
if not hasattr(rtconfig, 'CPP') or rtconfig.CPP is None:
rtconfig.CPP = rtconfig.PREFIX + 'cpp'
if not hasattr(rtconfig, 'CPPFLAGS') or rtconfig.CPPFLAGS is None:
rtconfig.CPPFLAGS = ' -E -P -x assembler-with-cpp'
if not os.path.exists(cwd + "/user" + "/arch" +"/" + rtconfig.ARCH + "/vdso.lds"):
Preprocessing("user/arch/" + rtconfig.ARCH + "/vdso.lds.S", ".lds", CPPPATH=[cwd])
vdso_arch = os.path.join(cwd, 'user',"arch", rtconfig.ARCH)
process_env = os.environ.copy()
if hasattr(rtconfig, 'EXEC_PATH') and rtconfig.EXEC_PATH is not None:
process_env['RTT_EXEC_PATH'] = rtconfig.EXEC_PATH
if hasattr(rtconfig, 'PREFIX') and rtconfig.PREFIX is not None:
process_env['RTT_CC_PREFIX'] = rtconfig.PREFIX
if hasattr(rtconfig, 'DEVICE') and rtconfig.DEVICE is not None:
process_env['RTT_DEVICE'] = rtconfig.DEVICE
command = ["scons", "-C", vdso_arch]
if GetOption('clean'):
command = ["scons", "-C", vdso_arch, "--clean"]
try:
result = subprocess.run(command, env=process_env, check=True)
# generic error handle
except :
print('exec command: "%s" failed.' % ' '.join(command))
exit(1)
print("Command executed successfully")
group = DefineGroup('lwProcess', src, depend = ['RT_USING_SMART','RT_USING_VDSO'], CPPPATH = CPPPATH)
Return('group')