From 10096bd1479b2f01912d4f80c8a0d8e77ea9878f Mon Sep 17 00:00:00 2001 From: Yingchi Long Date: Wed, 19 Jun 2024 21:20:22 +0800 Subject: [PATCH] mix-objects: inline linkenv --- mix-object.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mix-object.ts b/mix-object.ts index 1767b9b..507d482 100644 --- a/mix-object.ts +++ b/mix-object.ts @@ -27,13 +27,6 @@ function mkPop2Bench(spec: SPEC): Bench & Linkable { async link(objectPath) { // Set up environment variables. // FIXME: use -rpath or -rpath-link after I find out why. - const linkenv = { ...process.env }; - linkenv.LD_LIBRARY_PATH = [ - path.join(PREFIX, 'lib'), - path.join(SYSROOT_PREFIX, 'lib'), - path.join(SYSROOT_PREFIX, 'usr', 'lib') - ].join(':'); - const objects = objectPath(base.benchData().objectNames); const options = [ @@ -51,7 +44,14 @@ function mkPop2Bench(spec: SPEC): Bench & Linkable { // Execute the link command const proc = checkedSpawnSync(FLANG, options, { stdio: "inherit", - env: linkenv, + env: { + ...process.env, + LD_LIBRARY_PATH: [ + path.join(PREFIX, 'lib'), + path.join(SYSROOT_PREFIX, 'lib'), + path.join(SYSROOT_PREFIX, 'usr', 'lib') + ].join(':') + }, }); if (proc.error) {