1
Fork 0

Fix flags when using clang as linker for Fuchsia

Don't add C runtime or set dynamic linker when linking with clang for
Fuchsia. Clang already does this for us.
This commit is contained in:
Tyler Mandry 2022-07-20 02:30:29 -07:00
parent 03d488b48a
commit 55d5dcb1aa
2 changed files with 21 additions and 4 deletions

View file

@ -1,6 +1,11 @@
use crate::spec::{crt_objects, cvs, LinkOutputKind, LinkerFlavor, LldFlavor, TargetOptions};
pub fn opts() -> TargetOptions {
// This mirrors the linker options provided by clang. We presume lld for
// now. When using clang as the linker it will supply these options for us,
// so we only list them for ld/lld.
//
// https://github.com/llvm/llvm-project/blob/db9322b2066c55254e7691efeab863f43bfcc084/clang/lib/Driver/ToolChains/Fuchsia.cpp#L31
let pre_link_args = TargetOptions::link_args(
LinkerFlavor::Ld,
&[