Skip to content

Commit e5bf8b0

Browse files
committed
Make x86_64-unknown-linux-gno panic=abort and mark as no_std
Without a standard library, we cannot unwind, so it should be panic=abort by default. Additionally, it does not have std because while it is Linux, it cannot use libc, which std uses today for Linux.
1 parent 32c8a9f commit e5bf8b0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_none.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base};
1+
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, StackProbeType, Target, base};
22

33
pub(crate) fn target() -> Target {
44
let mut base = base::linux::opts();
@@ -7,14 +7,15 @@ pub(crate) fn target() -> Target {
77
base.stack_probes = StackProbeType::Inline;
88
base.linker_flavor = LinkerFlavor::Gnu(Cc::No, Lld::Yes);
99
base.linker = Some("rust-lld".into());
10+
base.panic_strategy = PanicStrategy::Abort;
1011

1112
Target {
1213
llvm_target: "x86_64-unknown-linux-none".into(),
1314
metadata: crate::spec::TargetMetadata {
1415
description: None,
1516
tier: None,
1617
host_tools: None,
17-
std: Some(true),
18+
std: Some(false),
1819
},
1920
pointer_width: 64,
2021
data_layout:

0 commit comments

Comments
 (0)