-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add .rlib as an allowed extension for static libraries for C++ rules
With this change we can directly link Rust static libraries into C++ binaries. Without this change we would have to register a symlink action that "renames" the extension from .rlib to .a. What exactly is rlib? From https://doc.rust-lang.org/reference/linkage.html: ``` This [rlib] is used as an intermediate artifact and can be thought of as a "static Rust library". These rlib files, unlike staticlib files, are interpreted by the compiler in future linkage. This essentially means that rustc will look for metadata in rlib files like it looks for metadata in dynamic libraries. This form of output is used to produce statically linked executables as well as staticlib outputs. ``` This file is an ar archive, just like regular .a archives. This file can actually be used by linkers directly. Rlib contains an additional metadata file that is ignored by linkers but used by rustc compilations. From the high level, rlib can be thought of as a Clang module + object files in an ar archive. RELNOTES: None. PiperOrigin-RevId: 385139708
- Loading branch information
1 parent
01c10e0
commit ad03823
Showing
4 changed files
with
33 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters