about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-09-29 11:03:59 -0700
committerAlex Crichton <alex@alexcrichton.com>2018-09-29 11:03:59 -0700
commit6f4b378e840209561f0ea1c013f9725b584a53e8 (patch)
tree1b64dd8088918109091f22c9f02a3a08feab8428 /src/rustllvm/RustWrapper.cpp
parent9653f790333d1270f36f1614e85d8a7b54193e75 (diff)
downloadrust-6f4b378e840209561f0ea1c013f9725b584a53e8.tar.gz
rust-6f4b378e840209561f0ea1c013f9725b584a53e8.zip
rust: Add a `-C default-linker-libraries` option
This commit adds a new codegen option for the compiler which disables
rustc's passing of `-nodefaultlibs` by default on relevant platforms.
Sometimes Rust is linked with C code which fails to link with
`-nodefaultlibs` and is unnecessarily onerous to get linking correctly
with `-nodefaultlibs`.

An example of this is that when you compile C code with sanitizers and
then pass `-fsanitize=address` to the linker, it's incompatible with
`-nodefaultlibs` also being passed to the linker.

In these situations it's easiest to turn off Rust's default passing of
`-nodefaultlibs`, which was more ideological to start with than
anything! Preserving the default is somewhat important but having this
be opt-in shouldn't cause any breakage.

Closes #54237
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions