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