-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
base: main
Are you sure you want to change the base?
Conversation
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
@@ -23,6 +23,7 @@ | |||
('lib', 'lsan'), | |||
('lib', 'ubsan'), | |||
('lib', 'ubsan_minimal'), | |||
('lib', 'profile'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make sure you copy these files from compiler-rt at the same revision as the existing file?
Based on system/lib/compiler-rt/readme.txt it looks like they should be copied from https://github.com/llvm/llvm-project/compare/llvmorg-19.1.6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbc100 I was under the impression i need to sync with https://github.com/emscripten-core/llvm-project/tree/main/compiler-rt/lib/profile
Version 19 will not work, as this requires llvm/llvm-project#111332 + a few more commits. Basically we need compiler-rt profile 20+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is required or triggers a creation of emscripten-lib-20 branch? We will need both compiler-rt source based on 20+ along with version 20+ of llvm-profdata
and llvm-cov
for the tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is rather complex process that we have to perform each time a new LLVM release is made. I opened #24182 to get it done.
f1a383d
to
10bbd61
Compare
@@ -23,6 +23,7 @@ | |||
('lib', 'lsan'), | |||
('lib', 'ubsan'), | |||
('lib', 'ubsan_minimal'), | |||
('lib', 'profile'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbc100 I was under the impression i need to sync with https://github.com/emscripten-core/llvm-project/tree/main/compiler-rt/lib/profile
Version 19 will not work, as this requires llvm/llvm-project#111332 + a few more commits. Basically we need compiler-rt profile 20+
@@ -754,6 +754,8 @@ class OFormat(Enum): | |||
LLVM_OBJCOPY = os.path.expanduser(build_llvm_tool_path(exe_suffix('llvm-objcopy'))) | |||
LLVM_STRIP = os.path.expanduser(build_llvm_tool_path(exe_suffix('llvm-strip'))) | |||
WASM_LD = os.path.expanduser(build_llvm_tool_path(exe_suffix('wasm-ld'))) | |||
LLVM_PROFDATA = 'llvm-profdata-20'#os.path.expanduser(build_llvm_tool_path(exe_suffix('llvm-profdata'))) | |||
LLVM_COV = 'llvm-cov-20'#os.path.expanduser(build_llvm_tool_path(exe_suffix('llvm-cov'))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do we get these included?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 binaryerror: failed to load coverage: 'my.wasm': no coverage data found