Skip to content

Commit 2a6551e

Browse files
[WebAssembly] Link sanitizer runtimes if enabled
1 parent b69e201 commit 2a6551e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/lib/Driver/ToolChains/WebAssembly.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA,
156156
}
157157

158158
ToolChain.addProfileRTLibs(Args, CmdArgs);
159+
// Emscripten has its own libasan_rt.a but we use libclang_rt.asan-wasm32.a
160+
// for other platforms like WASI.
161+
if (!ToolChain.getTriple().isOSEmscripten()) {
162+
addSanitizerRuntimes(ToolChain, Args, CmdArgs);
163+
}
159164

160165
CmdArgs.push_back("-o");
161166
CmdArgs.push_back(Output.getFilename());

0 commit comments

Comments
 (0)