Skip to content

Commit 9f1fad6

Browse files
committed
Auto merge of #148331 - matthiaskrgr:rollup-9wn6x3b, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #139310 (add first HelenOS compilation targets) - #144420 (smart pointer (try_)map) - #145974 (Stabilize -Zno-jump-tables into -Cjump-tables=bool) - #147161 (implement VecDeque extend_from_within and prepend_from_within) - #147780 (Implement VecDeque::extract_if) - #148319 (docs: Fix argument names for `carrying_mul_add`) - #148322 (Enable file locking support in illumos) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 51f5892 + bfbd722 commit 9f1fad6

File tree

40 files changed

+1929
-48
lines changed

40 files changed

+1929
-48
lines changed

compiler/rustc_codegen_llvm/src/attributes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ fn instrument_function_attr<'ll>(
229229
}
230230

231231
fn nojumptables_attr<'ll>(cx: &SimpleCx<'ll>, sess: &Session) -> Option<&'ll Attribute> {
232-
if !sess.opts.unstable_opts.no_jump_tables {
232+
if sess.opts.cg.jump_tables {
233233
return None;
234234
}
235235

compiler/rustc_interface/src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ fn test_codegen_options_tracking_hash() {
620620
tracked!(force_frame_pointers, FramePointer::Always);
621621
tracked!(force_unwind_tables, Some(true));
622622
tracked!(instrument_coverage, InstrumentCoverage::Yes);
623+
tracked!(jump_tables, false);
623624
tracked!(link_dead_code, Some(true));
624625
tracked!(linker_plugin_lto, LinkerPluginLto::LinkerPluginAuto);
625626
tracked!(llvm_args, vec![String::from("1"), String::from("2")]);
@@ -831,7 +832,6 @@ fn test_unstable_options_tracking_hash() {
831832
tracked!(mutable_noalias, false);
832833
tracked!(next_solver, NextSolverConfig { coherence: true, globally: true });
833834
tracked!(no_generate_arange_section, true);
834-
tracked!(no_jump_tables, true);
835835
tracked!(no_link, true);
836836
tracked!(no_profiler_runtime, true);
837837
tracked!(no_trait_vptr, true);

compiler/rustc_session/src/options.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,6 +2093,8 @@ options! {
20932093
"instrument the generated code to support LLVM source-based code coverage reports \
20942094
(note, the compiler build config must include `profiler = true`); \
20952095
implies `-C symbol-mangling-version=v0`"),
2096+
jump_tables: bool = (true, parse_bool, [TRACKED],
2097+
"allow jump table and lookup table generation from switch case lowering (default: yes)"),
20962098
link_arg: (/* redirected to link_args */) = ((), parse_string_push, [UNTRACKED],
20972099
"a single extra argument to append to the linker invocation (can be used several times)"),
20982100
link_args: Vec<String> = (Vec::new(), parse_list, [UNTRACKED],
@@ -2475,8 +2477,6 @@ options! {
24752477
"omit DWARF address ranges that give faster lookups"),
24762478
no_implied_bounds_compat: bool = (false, parse_bool, [TRACKED],
24772479
"disable the compatibility version of the `implied_bounds_ty` query"),
2478-
no_jump_tables: bool = (false, parse_no_value, [TRACKED],
2479-
"disable the jump tables and lookup tables that can be generated from a switch case lowering"),
24802480
no_leak_check: bool = (false, parse_no_value, [UNTRACKED],
24812481
"disable the 'leak check' for subtyping; unsound, but useful for tests"),
24822482
no_link: bool = (false, parse_no_value, [TRACKED],
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
use crate::spec::{PanicStrategy, RelroLevel, StackProbeType, TargetOptions};
2+
3+
pub(crate) fn opts() -> TargetOptions {
4+
TargetOptions {
5+
os: "helenos".into(),
6+
7+
dynamic_linking: true,
8+
// we need the linker to keep libgcc and friends
9+
no_default_libraries: false,
10+
has_rpath: true,
11+
relro_level: RelroLevel::Full,
12+
panic_strategy: PanicStrategy::Abort,
13+
stack_probes: StackProbeType::Inline,
14+
15+
..Default::default()
16+
}
17+
}

compiler/rustc_target/src/spec/base/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pub(crate) mod dragonfly;
88
pub(crate) mod freebsd;
99
pub(crate) mod fuchsia;
1010
pub(crate) mod haiku;
11+
pub(crate) mod helenos;
1112
pub(crate) mod hermit;
1213
pub(crate) mod hurd;
1314
pub(crate) mod hurd_gnu;

compiler/rustc_target/src/spec/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,6 +1534,12 @@ supported_targets! {
15341534
("i686-unknown-haiku", i686_unknown_haiku),
15351535
("x86_64-unknown-haiku", x86_64_unknown_haiku),
15361536

1537+
("aarch64-unknown-helenos", aarch64_unknown_helenos),
1538+
("i686-unknown-helenos", i686_unknown_helenos),
1539+
("powerpc-unknown-helenos", powerpc_unknown_helenos),
1540+
("sparc64-unknown-helenos", sparc64_unknown_helenos),
1541+
("x86_64-unknown-helenos", x86_64_unknown_helenos),
1542+
15371543
("i686-unknown-hurd-gnu", i686_unknown_hurd_gnu),
15381544
("x86_64-unknown-hurd-gnu", x86_64_unknown_hurd_gnu),
15391545

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
use crate::spec::{Target, base};
2+
3+
pub(crate) fn target() -> Target {
4+
let mut base = base::helenos::opts();
5+
base.max_atomic_width = Some(128);
6+
base.features = "+v8a".into();
7+
base.linker = Some("aarch64-helenos-gcc".into());
8+
9+
Target {
10+
llvm_target: "aarch64-unknown-helenos".into(),
11+
metadata: crate::spec::TargetMetadata {
12+
description: Some("ARM64 HelenOS".into()),
13+
tier: Some(3),
14+
host_tools: Some(false),
15+
std: Some(true),
16+
},
17+
pointer_width: 64,
18+
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
19+
arch: "aarch64".into(),
20+
options: base,
21+
}
22+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use crate::spec::{Cc, LinkerFlavor, Lld, RustcAbi, Target, base};
2+
3+
pub(crate) fn target() -> Target {
4+
let mut base = base::helenos::opts();
5+
base.cpu = "pentium4".into();
6+
base.max_atomic_width = Some(64);
7+
base.linker = Some("i686-helenos-gcc".into());
8+
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32"]);
9+
base.rustc_abi = Some(RustcAbi::X86Sse2);
10+
11+
Target {
12+
llvm_target: "i686-unknown-helenos".into(),
13+
metadata: crate::spec::TargetMetadata {
14+
description: Some("IA-32 (i686) HelenOS".into()),
15+
tier: Some(3),
16+
host_tools: Some(false),
17+
std: Some(true),
18+
},
19+
pointer_width: 32,
20+
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
21+
i128:128-f64:32:64-f80:32-n8:16:32-S128"
22+
.into(),
23+
arch: "x86".into(),
24+
options: base,
25+
}
26+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
use rustc_abi::Endian;
2+
3+
use crate::spec::{Target, TargetMetadata, base};
4+
5+
pub(crate) fn target() -> Target {
6+
let mut base = base::helenos::opts();
7+
base.endian = Endian::Big;
8+
base.max_atomic_width = Some(32);
9+
base.linker = Some("ppc-helenos-gcc".into());
10+
11+
Target {
12+
llvm_target: "powerpc-unknown-helenos".into(),
13+
metadata: TargetMetadata {
14+
description: Some("PowerPC HelenOS".into()),
15+
tier: Some(3),
16+
host_tools: Some(false),
17+
std: Some(true),
18+
},
19+
pointer_width: 32,
20+
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
21+
arch: "powerpc".into(),
22+
options: base,
23+
}
24+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use rustc_abi::Endian;
2+
3+
use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetMetadata, base};
4+
5+
pub(crate) fn target() -> Target {
6+
let mut base = base::helenos::opts();
7+
base.endian = Endian::Big;
8+
base.cpu = "v9".into();
9+
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
10+
base.max_atomic_width = Some(64);
11+
base.linker = Some("sparc64-helenos-gcc".into());
12+
13+
Target {
14+
llvm_target: "sparc64-unknown-helenos".into(),
15+
metadata: TargetMetadata {
16+
description: Some("SPARC HelenOS".into()),
17+
tier: Some(3),
18+
host_tools: Some(false),
19+
std: Some(true),
20+
},
21+
pointer_width: 64,
22+
data_layout: "E-m:e-i64:64-i128:128-n32:64-S128".into(),
23+
arch: "sparc64".into(),
24+
options: base,
25+
}
26+
}

0 commit comments

Comments
 (0)