Commit 7a22222
committed
Support raw-dylib link kind on ELF
raw-dylib is a link kind that allows rustc to link against a library
without having any library files present.
This currently only exists on Windows. rustc will take all the symbols
from raw-dylib link blocks and put them in an import library, where they
can then be resolved by the linker.
While import libraries don't exist on ELF, it would still be convenient
to have this same functionality. Not having the libraries present at
build-time can be convenient for several reasons, especially
cross-compilation. With raw-dylib, code linking against a library can be
cross-compiled without needing to have these libraries available on the
build machine. If the libc crate makes use of this, it would allow
cross-compilation without having any libc available on the build
machine. This is not yet possible with this implementation, at least
against libc's like glibc that use symbol versioning.
The raw-dylib kind could be extended with support for symbol versioning
in the future.
This implementation is very experimental and I have not tested it very
well. I have tested it for a toy example and the lz4-sys crate, where it
was able to successfully link a binary despite not having a
corresponding library at build-time.1 parent 8e59cf9 commit 7a22222
File tree
68 files changed
+669
-116
lines changed- compiler
- rustc_codegen_ssa
- src/back
- rustc_feature/src
- rustc_metadata
- src
- rustc_session/src
- rustc_span/src
- rustc_target/src/spec
- src
- doc/rustc-dev-guide/src/tests
- tools/compiletest/src
- header
- tests
- run-make
- raw-dylib-elf-verbatim-absolute
- raw-dylib-elf-verbatim
- raw-dylib-elf
- reproducible-build
- ui
- feature-gates
- linkage-attr/raw-dylib
- elf
- windows
- rfcs/rfc-2627-raw-dylib
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
68 files changed
+669
-116
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3542 | 3542 | | |
3543 | 3543 | | |
3544 | 3544 | | |
| 3545 | + | |
3545 | 3546 | | |
3546 | 3547 | | |
3547 | 3548 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
0 commit comments