emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

Add initial support -fcoverage-mapping support

Open sbc100 opened this issue 4 years ago • 6 comments

This is enought make it work up until llvm-cov tries to read the named data sections in the binary and can't find them. For this final part to work we probably need to switch the object format to using multiple code and data sections: https://github.com/WebAssembly/tool-conventions/issues/138

Not sure if its worth submitting this part in isolation without a fully working solution?

See #13046

sbc100 avatar Dec 18 '20 16:12 sbc100

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

stale[bot] avatar Apr 16 '22 12:04 stale[bot]

emcc -fprofile-instr-generate -fcoverage-mapping demo.cpp

wasm-ld: error: /var/folders/61/x35v93n50_5g1dfjrtprr2dw0000gn/T/emscripten_temp_xjrzk63_/demo_0.o: undefined symbol: __llvm_profile_runtime

need help, emcc seems not support -fcoverage-mapping?

AnnieXia avatar Oct 17 '22 01:10 AnnieXia

emcc -fprofile-instr-generate -fcoverage-mapping demo.cpp

wasm-ld: error: /var/folders/61/x35v93n50_5g1dfjrtprr2dw0000gn/T/emscripten_temp_xjrzk63_/demo_0.o: undefined symbol: __llvm_profile_runtime

need help, emcc seems not support -fcoverage-mapping?

No, emcc doesn't support this yet. This PR would be a start, but more work would be needed.

sbc100 avatar Oct 17 '22 16:10 sbc100

Any news on this?

3d4m-volodymyr avatar Mar 09 '23 14:03 3d4m-volodymyr

@sbc100 Any update here? Do the original shortcoming still exists? Is there value in including without support for named data sections?

Currently going to look at getting -fprofile-instr-generate -fcoverage-mapping working by manually building then linking to libclang_rt.profile.a Which seemed to be the spirit here

arsnyder16 avatar Apr 15 '25 20:04 arsnyder16

No update I'm afraid. Let is know if you manage to get stuff working.

sbc100 avatar Apr 15 '25 20:04 sbc100

Closing in favor of #13072

sbc100 avatar Jun 16 '25 18:06 sbc100