Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions compiler/rustc_target/src/spec/base/windows_gnullvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ pub(crate) fn opts() -> TargetOptions {
// but LLVM maintainers rejected it: https://reviews.llvm.org/D51440
let pre_link_args = TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
&["-nolibc", "--unwindlib=none"],
&["-nolibc", "--unwindlib=libunwind", "-static-libgcc"],
);
// Order of `late_link_args*` does not matter with LLD.
let mingw_libs = &["-lmingw32", "-lmingwex", "-lmsvcrt", "-lkernel32", "-luser32"];

let mut late_link_args =
TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), mingw_libs);
add_link_args(&mut late_link_args, LinkerFlavor::Gnu(Cc::No, Lld::No), &["-l:libunwind.a"]);
add_link_args(&mut late_link_args, LinkerFlavor::Gnu(Cc::Yes, Lld::No), mingw_libs);

TargetOptions {
Expand All @@ -46,8 +47,6 @@ pub(crate) fn opts() -> TargetOptions {
eh_frame_header: false,
no_default_libraries: false,
has_thread_local: true,
crt_static_allows_dylibs: true,
crt_static_respected: true,
debuginfo_kind: DebuginfoKind::Dwarf,
// FIXME(davidtwco): Support Split DWARF on Windows GNU - may require LLVM changes to
// output DWO, despite using DWARF, doesn't use ELF..
Expand Down
5 changes: 0 additions & 5 deletions library/unwind/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,3 @@ cfg_select! {
#[cfg(target_os = "hurd")]
#[link(name = "gcc_s")]
unsafe extern "C" {}

#[cfg(all(target_os = "windows", target_env = "gnu", target_abi = "llvm"))]
#[link(name = "unwind", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
#[link(name = "unwind", cfg(not(target_feature = "crt-static")))]
unsafe extern "C" {}
1 change: 0 additions & 1 deletion src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ fn make_win_llvm_dist(plat_root: &Path, target: TargetSelection, builder: &Build
let target_libs = [
// MinGW libs
"libunwind.a",
"libunwind.dll.a",
"libmingw32.a",
"libmingwex.a",
"libmsvcrt.a",
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc/src/platform-support/windows-gnullvm.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Target triples available so far:
## Requirements

Building those targets requires an LLVM-based C toolchain, for example, [llvm-mingw][1] or [MSYS2][2] with CLANG*
environment.
environment, with static libunwind library available.

Binaries for this target should be at least on par with `*-windows-gnu` in terms of requirements and functionality,
except for implicit self-contained mode (explained in [the section below](#building-rust-programs)).
Expand Down
Loading