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) {