Skip to content

Add support for -fcoverage-mapping support #24160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Jun 16, 2025

Conversation

arsnyder16
Copy link
Contributor

@arsnyder16 arsnyder16 commented Apr 21, 2025

Main introduction is porting llvm-project/compiler_rt/lib/profile into system/lib/compiler_rt/lib/profile

Related
#13072
llvm/llvm-project#111332

No modifications were required for what was ported. llvm-cov worked fine for me with simple project.

  • -g is required to produce a properly instrumented binary error: failed to load coverage: 'my.wasm': no coverage data found

sbc100 and others added 12 commits December 26, 2020 13:23
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:
WebAssembly/tool-conventions#138

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

See emscripten-core#13046
# Conflicts:
#	emcc.py
#	tests/test_core.py
#	tools/shared.py
#	tools/system_libs.py
@arsnyder16 arsnyder16 force-pushed the arsnyder16-fcoverage branch from f1a383d to 10bbd61 Compare April 21, 2025 20:46
@arsnyder16 arsnyder16 marked this pull request as ready for review April 23, 2025 18:17
@arsnyder16 arsnyder16 force-pushed the arsnyder16-fcoverage branch from 7c189ff to 56a1d3a Compare May 30, 2025 16:50
@arsnyder16
Copy link
Contributor Author

@sbc100 I think this is ready, not sure why some of the test failures, seems unrelated.

Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks for working on this.

Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this to the ChangeLog?

@arsnyder16
Copy link
Contributor Author

Can you add this to the ChangeLog?

Added. Let me know if there is anything else i should specifically call out

@sbc100
Copy link
Collaborator

sbc100 commented Jun 16, 2025

Just to confirm, the new files are taken from the emscripten-libs-20 branch in llvm?

@arsnyder16
Copy link
Contributor Author

Just to confirm, the new files are taken from the emscripten-libs-20 branch in llvm?

Correct, i used ./update_compiler_rt.py ~/em-llvm-project with a local clone of that branch

@sbc100 sbc100 merged commit 645f5b1 into emscripten-core:main Jun 16, 2025
26 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants