From b56f5e1b568a1c143cead036304f640b19152bbd Mon Sep 17 00:00:00 2001 From: Yingchi Long Date: Wed, 9 Jul 2025 13:24:13 +0800 Subject: [PATCH] bin/runcpu: eliminate hardcoded sysroot --- src/bin/runcpu.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/runcpu.ts b/src/bin/runcpu.ts index 329a53f..57f1b85 100644 --- a/src/bin/runcpu.ts +++ b/src/bin/runcpu.ts @@ -128,7 +128,7 @@ const specProc = await spawnSPECWithID( ...optimizeFlags, ...argv.allowMisaligned ? ["-mllvm", sw64UnalignedFlag] : [], ...sw64TargetOptions({ simd: argv.simd }), - ...["--sysroot", "/usr/sw/swgcc1030_native_tools"], + ...["--sysroot", sysroot], ...argv.compilerSuite == "llvm" ? [sunway.mcpu(sunwayGeneration)] : [], // Only add -mcpu for llvm ], ldflags: [ @@ -136,7 +136,7 @@ const specProc = await spawnSPECWithID( `-L${path.resolve(prefix, 'lib')}`, ...optimizeFlags, "-fuse-ld=lld", - ...["--sysroot", "/usr/sw/swgcc1030_native_tools"], + ...["--sysroot", sysroot], ...argv.optimizeProfile === "base" ? [ ...argv.simd ? ["-Wl,-plugin-opt,-mattr=+simd"] : [], ...argv.allowMisaligned ? [`-Wl,-plugin-opt,${sw64UnalignedFlag}`] : [],