rust/src
bors f9e0239a7b Auto merge of #135695 - Noratrieb:elf-raw-dylib, r=bjorn3
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.

I was inspired by Björn's comments in https://internals.rust-lang.org/t/bundle-zig-cc-in-rustup-by-default/22096/27
Tracking issue: #135694

r? bjorn3

try-job: aarch64-apple
try-job: x86_64-msvc-1
try-job: x86_64-msvc-2
try-job: test-various
2025-03-04 15:39:44 +00:00
..
bootstrap Rollup merge of #137882 - onur-ozkan:remove-extra-compiler-stage, r=Kobzol 2025-03-03 20:47:12 +01:00
build_helper revert accidental change in get_closest_merge_commit 2025-02-26 13:35:51 +01:00
ci Rollup merge of #137946 - ehuss:ci-docker-readme, r=Kobzol 2025-03-03 20:47:16 +01:00
doc Auto merge of #135695 - Noratrieb:elf-raw-dylib, r=bjorn3 2025-03-04 15:39:44 +00:00
etc Auto merge of #137927 - matthiaskrgr:rollup-yj463ns, r=matthiaskrgr 2025-03-03 22:57:01 +00:00
gcc@48664a6cab Update gcc submodule 2025-02-26 09:23:52 +01:00
librustdoc Auto merge of #137959 - matthiaskrgr:rollup-62vjvwr, r=matthiaskrgr 2025-03-04 02:27:56 +00:00
llvm-project@1c3bb96fdb Update to LLVM 20 rc 3 2025-02-27 09:34:19 +01:00
rustc-std-workspace update rustc-std-workspace crates 2024-11-04 07:45:15 +01:00
rustdoc-json-types Fix rustdoc and clippy 2025-02-24 14:31:19 +01:00
tools Auto merge of #135695 - Noratrieb:elf-raw-dylib, r=bjorn3 2025-03-04 15:39:44 +00:00
README.md
stage0 bump stage0 2025-02-18 08:51:01 -08:00
version Bump to version 1.87.0 2025-02-14 09:55:45 -08:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.