diff options
author | Marc Poulhiès <dkm@kataplop.net> | 2024-02-28 19:54:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-28 19:54:31 +0100 |
commit | 52bd0644e1a8b93c75cea6337c9ffe0849deb77e (patch) | |
tree | ecb30b7baaf941eb913df41357c67faf781696c1 | |
parent | 8e6c90d1370e051d18eeb7f705527d3d97a6cd1c (diff) | |
download | compiler-explorer-gh-10812.tar.gz compiler-explorer-gh-10812.zip |
fix pythran wrt ldpath (#6202)gh-10812
refs #6079
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
-rw-r--r-- | lib/compilers/pythran.ts | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/compilers/pythran.ts b/lib/compilers/pythran.ts index 33fb7d981..32504d449 100644 --- a/lib/compilers/pythran.ts +++ b/lib/compilers/pythran.ts @@ -1,4 +1,7 @@ import path from 'path'; + +import {CompileChildLibraries} from '../../types/compilation/compilation.interfaces.js'; + import {BaseCompiler} from '../base-compiler.js'; import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js'; import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js'; @@ -15,15 +18,22 @@ export class PythranCompiler extends BaseCompiler { this.cpp_compiler_root = this.compilerProps<string>(`compiler.${this.compiler.id}.cpp_compiler_root`); } - override getDefaultExecOptions() { - const execOptions = super.getDefaultExecOptions(); + override getSharedLibraryPaths(libraries: CompileChildLibraries[], dirPath?: string): string[] { + let ldpath = super.getSharedLibraryPaths(libraries, dirPath); if (this.cpp_compiler_root) { - execOptions.env.PATH = path.join(this.cpp_compiler_root, 'bin'); - const ld_library_path = [ + ldpath = ldpath.concat( path.join(this.cpp_compiler_root, 'lib'), path.join(this.cpp_compiler_root, 'lib64'), - ]; - execOptions.env.LD_LIBRARY_PATH = ld_library_path.join(':'); + ); + } + return ldpath; + } + + override getDefaultExecOptions() { + const execOptions = super.getDefaultExecOptions(); + + if (this.cpp_compiler_root) { + execOptions.env.PATH = execOptions.env.PATH + ':' + path.join(this.cpp_compiler_root, 'bin'); } return execOptions; |