Skip to content

Commit ef76026

Browse files
[clang][WebAssembly] Link with profile runtime libraries if requested
This patch teaches the WebAssembly toolchain to link with the profile runtime libraries if profile instrumentation is requested. With this change, the following command will work with profile rt installed: ``` $ clang -target wasm32-unknown-wasi -fprofile-instr-generate \ -lwasi-emulated-getpid -lwasi-emulated-mman -o foo.wasm foo.c ```
1 parent 3e00614 commit ef76026

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang/lib/Driver/ToolChains/WebAssembly.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA,
163163
AddRunTimeLibs(ToolChain, ToolChain.getDriver(), CmdArgs, Args);
164164
}
165165

166+
ToolChain.addProfileRTLibs(Args, CmdArgs);
167+
166168
CmdArgs.push_back("-o");
167169
CmdArgs.push_back(Output.getFilename());
168170

0 commit comments

Comments
 (0)