Open Bug 1490603 Opened 7 years ago Updated 3 years ago

Make the linker remove code that's exported via FFI from gkrust but never called by the rest of libxul

Categories

(Firefox Build System :: Toolchains, enhancement)

63 Branch
enhancement

Tracking

(Not tracked)

People

(Reporter: hsivonen, Unassigned)

References

Details

According to the thread at https://groups.google.com/forum/#!topic/mozilla.dev.platform/9WAMvihnx6I we don't yet have dead code removal for the case where gkrust exposes FFI functions that no one calls. Having this dead code removal would be useful to enable importing C bindings for Rust crates in a "pay only for what you use" manner when we don't need to use the full C API but only a subset. (OTOH, it makes sense for a C binding on crates.io to be complete instead of an ad hoc subset that happens to match what Gecko happens to need at the moment.)
Keywords: in-triage
Component: General → Toolchains
Keywords: in-triage
Per discussion in that thread it sounds like this needs Rust compiler changes to be actionable. We build our Rust code with LTO on most platforms, but rustc has no way to know that some exported symbols should not be kept.
Blocks: 1523352
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.