diff options
author | Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com> | 2022-03-07 05:13:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-07 11:13:06 +0100 |
commit | aa516e36dfad8bcd77f4d413df7d1212eb7527e1 (patch) | |
tree | 137d8eab6fbaf82583f64281ff4fe75ec4077615 /lib/compilers | |
parent | 6c57dcebcaeeef55f96087341f8ad9a70c5c7338 (diff) | |
download | compiler-explorer-aa516e36dfad8bcd77f4d413df7d1212eb7527e1.tar.gz compiler-explorer-aa516e36dfad8bcd77f4d413df7d1212eb7527e1.zip |
Add llvm-symbolizer to ASAN_SYMBOLIZER_PATH (#3425)gh-2162
Diffstat (limited to 'lib/compilers')
-rw-r--r-- | lib/compilers/clang.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/compilers/clang.js b/lib/compilers/clang.js index 2e1a6b89b..4465b2a28 100644 --- a/lib/compilers/clang.js +++ b/lib/compilers/clang.js @@ -23,6 +23,7 @@ // POSSIBILITY OF SUCH DAMAGE. import path from 'path'; +import fs from 'fs'; import { BaseCompiler } from '../base-compiler'; import { AmdgpuAsmParser } from '../parsers/asm-parser-amdgpu'; @@ -38,6 +39,20 @@ export class ClangCompiler extends BaseCompiler { constructor(info, env) { super(info, env); this.compiler.supportsDeviceAsmView = true; + const asanSymbolizerPath = path.dirname(this.compiler.exe) + '/llvm-symbolizer'; + if (fs.existsSync(asanSymbolizerPath)) { + this.asanSymbolizerPath = asanSymbolizerPath; + } + } + + runExecutable(executable, executeParameters, homeDir) { + if(this.asanSymbolizerPath) { + executeParameters.env = { + ASAN_SYMBOLIZER_PATH: this.asanSymbolizerPath, + ...executeParameters.env, + }; + } + return super.runExecutable(executable, executeParameters, homeDir); } runCompiler(compiler, options, inputFilename, execOptions) { |