Description
This is a tracking issue for the fix for issue "Linking modifier whole-archive
and link time cfg
are not supported on bundled static libraries" (#99429).
The feature gate for the issue is #![feature(packed_bundled_libs)]
.
Currently to combine +bundle
native libraries with +whole-archive
or cfg
a new representation of bundled native libraries in a rlib used, in which the library is packed into the archive as a whole (and wrapped into an object file for technical reasons), and then unpacked when you need to link to it.
Other representations are also possible, e.g. keeping the bundled lib in the old "unpacked" format as a set of object files, and adding some description file telling which object files belong to which library, it would be more complex though.
It may be quite reasonable to support both packed and unpacked representations, both have their uses
- the packed representation minimizes differences with classic non-bundled (
-bundle
) static libraries - the unpacked representation is needed when the rlib actually provides missing symbols to the native static lib, not just depends on it, as can be seen from the breakage report in [WIP] Native library linking changes for crater testing #102832
Stabilizing the +bundle,+whole-archive
combination doesn't need specifying any of these details, we just need to promise that it somehow works.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
- Implement the RFC (cc @rust-lang/XXX -- can anyone write up mentoring
instructions?) - Adjust documentation (see instructions on rustc-dev-guide)
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
None yet.
Implementation history
- Implemented in Enable new rlib in non stable cases #105601.