Redefine MIDL names to be unique to work around a clang-cl bug
Categories
(Firefox Build System :: Toolchains, defect)
Tracking
(firefox74 fixed)
| Tracking | Status | |
|---|---|---|
| firefox74 | --- | fixed |
People
(Reporter: away, Assigned: away)
Details
Attachments
(1 file)
https://llvm.org/pr41817 has prevented us from building MIDL code with clang-cl for some time now. The bug causes some static globals to lose their static-ness and leak the symbols to the outside world, so we get duplicate symbol errors when we link multiple MIDL TUs together.
We've been working around it by carrying a local LLVM patch that reverts the change where the bug was introduced. This has two downsides that have been increasingly annoying me: (1) we have to rebase that patch when we update LLVM, and (2) you have to remember to apply this patch locally when building your own LLVM, or else it'll fail to build Firefox.
An alternative workaround is to use the preprocessor to give the problematic objects unique names. Then we can drop the LLVM patch. The change is super ugly, but given the problems above I'm starting to see it as the lesser of evils.
This is an alternative to carrying a revert of the offending changeset, since the bug doesn't show hope of a fix anytime soon, or maybe ever. This way we don't have to keep rebasing the patch as we pick up new clangs, and developers don't have to remember to apply the patch when building a local compiler.
Updated•6 years ago
|
Comment 3•6 years ago
|
||
| bugherder | ||
Description
•