Skip to content

Commit

Permalink
Auto merge of rust-lang#83412 - pnkfelix:stable-revert-effect-of-pr-7…
Browse files Browse the repository at this point in the history
…7885-for-issue-83139, r=nagisa

[stable] probe-stack=call everywhere again, for now.

To buy time on issue 83139, revert effect of PR 77885: We will not conditionally
enable probe-stack=inline-asm on LLVM 11+ anymore on any of our targets that
opted into doing so on PR rust-lang#77885 (and were subsequently configured to do so in a
fine grained manner on PR rust-lang#80838).

After we resolve 83139 (potentially by backporting a fix to LLVM, or potentially
by deciding that one cannot rely on the quality of our DWARF output in the
manner described in issue 83139), we can change this back.

cc rust-lang#83139
  • Loading branch information
bors committed Mar 23, 2021
2 parents 9bb6d54 + b75894e commit 2fd73fa
Show file tree
Hide file tree
Showing 33 changed files with 64 additions and 75 deletions.
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/i386_apple_ios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ pub fn target() -> Target {
arch: "x86".to_string(),
options: TargetOptions {
max_atomic_width: Some(64),
stack_probes: StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) },
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
stack_probes: StackProbeType::Call,
..base
},
}
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/i686_apple_darwin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ pub fn target() -> Target {
base.max_atomic_width = Some(64);
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m32".to_string()]);
base.link_env_remove.extend(super::apple_base::macos_link_env_remove());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;
base.eliminate_frame_pointer = false;

// Clang automatically chooses a more specific target based on
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/i686_linux_android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ pub fn target() -> Target {
// http://developer.android.com/ndk/guides/abis.html#x86
base.cpu = "pentiumpro".to_string();
base.features = "+mmx,+sse,+sse2,+sse3,+ssse3".to_string();
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "i686-linux-android".to_string(),
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_target/src/spec/i686_unknown_freebsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ pub fn target() -> Target {
let pre_link_args = base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap();
pre_link_args.push("-m32".to_string());
pre_link_args.push("-Wl,-znotext".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };

// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "i686-unknown-freebsd".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/i686_unknown_haiku.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> Target {
base.cpu = "pentium4".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m32".to_string()]);
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "i686-unknown-haiku".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/i686_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> Target {
base.cpu = "pentium4".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "i686-unknown-linux-gnu".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/i686_unknown_linux_musl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ pub fn target() -> Target {
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-Wl,-melf_i386".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

// The unwinder used by i686-unknown-linux-musl, the LLVM libunwind
// implementation, apparently relies on frame pointers existing... somehow.
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/i686_unknown_netbsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> Target {
base.cpu = "pentium4".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "i686-unknown-netbsdelf".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/i686_unknown_openbsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ pub fn target() -> Target {
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-fuse-ld=lld".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "i686-unknown-openbsd".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/i686_wrs_vxworks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> Target {
base.cpu = "pentium4".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "i686-unknown-linux-gnu".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/linux_kernel_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ pub fn opts() -> TargetOptions {
env: "gnu".to_string(),
disable_redzone: true,
panic_strategy: PanicStrategy::Abort,
stack_probes: StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) },
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
stack_probes: StackProbeType::Call,
eliminate_frame_pointer: false,
linker_is_gnu: true,
position_independent_executables: true,
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_apple_darwin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ pub fn target() -> Target {
vec!["-m64".to_string(), "-arch".to_string(), "x86_64".to_string()],
);
base.link_env_remove.extend(super::apple_base::macos_link_env_remove());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

// Clang automatically chooses a more specific target based on
// MACOSX_DEPLOYMENT_TARGET. To enable cross-language LTO to work
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_apple_ios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ pub fn target() -> Target {
arch: "x86_64".to_string(),
options: TargetOptions {
max_atomic_width: Some(64),
stack_probes: StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) },
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
stack_probes: StackProbeType::Call,
..base
},
}
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_apple_ios_macabi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ pub fn target() -> Target {
arch: "x86_64".to_string(),
options: TargetOptions {
max_atomic_width: Some(64),
stack_probes: StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) },
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
stack_probes: StackProbeType::Call,
..base
},
}
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_apple_tvos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ pub fn target() -> Target {
arch: "x86_64".to_string(),
options: TargetOptions {
max_atomic_width: Some(64),
stack_probes: StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) },
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
stack_probes: StackProbeType::Call,
..base
},
}
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_fuchsia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ pub fn target() -> Target {
let mut base = super::fuchsia_base::opts();
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "x86_64-fuchsia".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_linux_android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ pub fn target() -> Target {
base.features = "+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "x86_64-linux-android".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_rumprun_netbsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ pub fn target() -> Target {
base.has_rpath = false;
base.position_independent_executables = false;
base.disable_redzone = true;
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "x86_64-rumprun-netbsd".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_sun_solaris.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> Target {
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "x86_64-pc-solaris".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_unknown_dragonfly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> Target {
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "x86_64-unknown-dragonfly".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_unknown_freebsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> Target {
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "x86_64-unknown-freebsd".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_unknown_haiku.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> Target {
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;
// This option is required to build executables on Haiku x86_64
base.position_independent_executables = true;

Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_unknown_hermit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> Target {
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.features = "+rdrnd,+rdseed".to_string();
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "x86_64-unknown-hermit".to_string(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ pub fn target() -> Target {
base.features =
"-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float"
.to_string();
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "x86_64-unknown-hermit".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> Target {
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "x86_64-unknown-linux-gnu".to_string(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> Target {
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mx32".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;
base.has_elf_tls = false;
// BUG(GabrielMajeri): disabling the PLT on x86_64 Linux with x32 ABI
// breaks code gen. See LLVM bug 36743
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_unknown_linux_musl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ pub fn target() -> Target {
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

base.static_position_independent_executables = true;

Target {
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_unknown_netbsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> Target {
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "x86_64-unknown-netbsd".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_unknown_openbsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> Target {
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "x86_64-unknown-openbsd".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_unknown_redox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> Target {
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;

Target {
llvm_target: "x86_64-unknown-redox".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/x86_64_wrs_vxworks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> Target {
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
// don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
base.stack_probes = StackProbeType::Call;
base.disable_redzone = true;

Target {
Expand Down
42 changes: 0 additions & 42 deletions src/test/assembly/stack-probes.rs

This file was deleted.

2 changes: 0 additions & 2 deletions src/test/codegen/stack-probes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
// ignore-emscripten
// ignore-windows
// compile-flags: -C no-prepopulate-passes
// min-llvm-version: 11.0.1

#![crate_type = "lib"]

#[no_mangle]
pub fn foo() {
// CHECK: @foo() unnamed_addr #0
// CHECK: attributes #0 = { {{.*}}"probe-stack"="inline-asm"{{.*}} }
}

0 comments on commit 2fd73fa

Please sign in to comment.