about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-11 15:08:03 +0000
committerbors <bors@rust-lang.org>2024-08-11 15:08:03 +0000
commit9cb1998ea15e179482504e07cad8fa121e169a32 (patch)
tree454444fcc1b594c3459165812fd7b34c4a136138 /compiler/rustc_codegen_llvm
parent5e5ec8af1b34a71fbf0063586a70bae7460a892a (diff)
parentb22253c45489716a27164b3584a580140afa6967 (diff)
downloadrust-9cb1998ea15e179482504e07cad8fa121e169a32.tar.gz
rust-9cb1998ea15e179482504e07cad8fa121e169a32.zip
Auto merge of #122362 - Zoxc:rustc_driver_static_std, r=oli-obk,lqd,bjorn3,Kobzol
Link `std` statically in `rustc_driver`

This makes `rustc_driver` statically link to `std`. This is done by not passing `-C prefer-dynamic` when building `rustc_driver`. However building `rustc-main` won't work currently as it tries to dynamically link to both `rustc_driver` and `std` resulting in a crate graph with `std` duplicated. To fix that new command line option `-Z prefer_deps_of_dynamic` is added which prevents linking to a dylib if there's a static variant of it already statically linked into another dylib dependency.

The main motivation for this change is to enable `#[global_allocator]` to be used in `rustc_driver` allowing overriding the allocator used in rustc on all platforms.

---

Instead of adding `-Z prefer_deps_of_dynamic`, this PR is changed to crate opt-in to the linking change via the `rustc_private` feature instead, as that would be typically needed to link to `rustc_driver` anyway.

---

try-job: aarch64-apple
try-job: x86_64-msvc
try-job: i686-mingw
try-job: dist-x86_64-msvc
try-job: aarch64-gnu
Diffstat (limited to 'compiler/rustc_codegen_llvm')
0 files changed, 0 insertions, 0 deletions