diff options
| author | bors <bors@rust-lang.org> | 2022-08-11 21:30:07 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-08-11 21:30:07 +0000 |
| commit | 2ed0f29168f5bc116e747152be600519b5d78bfd (patch) | |
| tree | c90db3ddda1c65dc26527c7d60fc06f6f94040d2 /compiler/rustc_codegen_ssa/src | |
| parent | 20ffea6938b5839c390252e07940b99e3b6a889a (diff) | |
| parent | c7578b4e65df9ede839fe94063e09961b82e6ade (diff) | |
| download | rust-2ed0f29168f5bc116e747152be600519b5d78bfd.tar.gz rust-2ed0f29168f5bc116e747152be600519b5d78bfd.zip | |
Auto merge of #100426 - matthiaskrgr:rollup-0ks4dou, r=matthiaskrgr
Rollup of 13 pull requests Successful merges: - #93896 (rustdoc: make item-infos dimmer on dark theme) - #99337 (rustdoc: simplify highlight.rs) - #99421 (add crt-static for android) - #99500 (Fix flags when using clang as linker for Fuchsia) - #99511 (make raw_eq precondition more restrictive) - #99992 (Add `x.sh` and `x.ps1` shell scripts) - #100112 (Fix test: chunks_mut_are_send_and_sync) - #100203 (provide correct size hint for unsupported platform `CommandArgs`) - #100307 (Fix #96847) - #100350 (Stringify non-shorthand visibility correctly) - #100374 (Improve crate selection on rustdoc search results page) - #100392 (Simplify visitors) - #100418 (Add stability attributes to BacktraceStatus variants) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/link.rs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 468d034e635..953761a7820 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -1583,12 +1583,21 @@ fn crt_objects_fallback(sess: &Session, crate_type: CrateType) -> bool { fn add_pre_link_objects( cmd: &mut dyn Linker, sess: &Session, + flavor: LinkerFlavor, link_output_kind: LinkOutputKind, self_contained: bool, ) { + // FIXME: we are currently missing some infra here (per-linker-flavor CRT objects), + // so Fuchsia has to be special-cased. let opts = &sess.target; - let objects = - if self_contained { &opts.pre_link_objects_fallback } else { &opts.pre_link_objects }; + let empty = Default::default(); + let objects = if self_contained { + &opts.pre_link_objects_fallback + } else if !(sess.target.os == "fuchsia" && flavor == LinkerFlavor::Gcc) { + &opts.pre_link_objects + } else { + &empty + }; for obj in objects.get(&link_output_kind).iter().copied().flatten() { cmd.add_object(&get_object_file_path(sess, obj, self_contained)); } @@ -1914,7 +1923,7 @@ fn linker_with_args<'a>( // ------------ Object code and libraries, order-dependent ------------ // Pre-link CRT objects. - add_pre_link_objects(cmd, sess, link_output_kind, crt_objects_fallback); + add_pre_link_objects(cmd, sess, flavor, link_output_kind, crt_objects_fallback); add_linked_symbol_object( cmd, @@ -2070,7 +2079,10 @@ fn add_order_independent_options( add_link_script(cmd, sess, tmpdir, crate_type); - if sess.target.os == "fuchsia" && crate_type == CrateType::Executable { + if sess.target.os == "fuchsia" + && crate_type == CrateType::Executable + && flavor != LinkerFlavor::Gcc + { let prefix = if sess.opts.unstable_opts.sanitizer.contains(SanitizerSet::ADDRESS) { "asan/" } else { |
