Cannot build Firefox with Clang with code coverage enabled
Categories
(Firefox Build System :: General, defect)
Tracking
(firefox65 wontfix, firefox74 fixed)
People
(Reporter: calixte, Assigned: marco)
References
Details
Attachments
(1 file)
Comment 1•7 years ago
|
||
Assignee | ||
Comment 2•7 years ago
|
||
![]() |
||
Comment 3•7 years ago
|
||
Updated•6 years ago
|
Comment 4•6 years ago
|
||
I've seen this too locally, and I've tried to track down the issue myself, but the chain from mozconfig to makefiles to cargo to linkers with half of everything passed through environment variables has proven difficult to actually narrow down the issue.
So far as I can tell (my analysis may be wrong!), the linking issue starts with the libloading crate. This crate includes a .c file that is compiled via the cc crate in the build.rs, which is happily built with the --coverage flag as requested by the CFLAGS. When the final linking for the gkrust-shared crate occurs, this pulls in libclang_rt.profile-x86_64.a symbols for gcov tracing. This requires the c library to be linked against for atexit, but the -nodefaultlibs prevents the c library from being used to resolve the symbol.
Assignee | ||
Comment 5•6 years ago
|
||
I still can't reproduce locally, but I was able to reproduce on CI: https://treeherder.mozilla.org/#/jobs?repo=try&revision=5af34468f4dbe660640e994b703e87df603b903a.
Comment 6•6 years ago
|
||
I got a bit closer modifying the rust.mk file to further support clang when coverage is enabled. Now it fails in testSymbolstore
during make check
. Perhaps that's enough for you to proceed?
Assignee | ||
Comment 7•6 years ago
|
||
I wonder why that's not needed in the fuzzing ccov builds which use Clang.
![]() |
||
Comment 8•6 years ago
|
||
(In reply to Marco Castelluccio [:marco] from comment #7)
I wonder why that's not needed in the fuzzing ccov builds which use Clang.
Because in those builds, we triggering the FUZZING_INTERFACES
part of this condition:
Reporter | ||
Comment 9•6 years ago
|
||
:erahm, I just tryed your patch locally and it works.
Assignee | ||
Comment 10•6 years ago
|
||
(In reply to Eric Rahm [:erahm] from comment #6)
I got a bit closer modifying the rust.mk file to further support clang when coverage is enabled. Now it fails in
testSymbolstore
duringmake check
. Perhaps that's enough for you to proceed?
I've filed bug 1608146 for this.
Assignee | ||
Comment 11•6 years ago
|
||
Updated•6 years ago
|
Comment 12•6 years ago
|
||
Comment 13•6 years ago
|
||
bugherder |
Updated•6 years ago
|
Description
•