forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#99278 - Dylan-DPC:rollup-fcln6st, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - rust-lang#88991 (Add Nintendo Switch as tier 3 target) - rust-lang#98869 (Remove some usages of `guess_head_span`) - rust-lang#99119 (Refactor: remove a string matching about methods) - rust-lang#99209 (Correctly handle crate level page on docs.rs as well) - rust-lang#99246 (Update RLS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
54 changed files
with
468 additions
and
324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
compiler/rustc_target/src/spec/aarch64_nintendo_switch_freestanding.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelroLevel, Target, TargetOptions}; | ||
|
||
const LINKER_SCRIPT: &str = include_str!("./aarch64_nintendo_switch_freestanding_linker_script.ld"); | ||
|
||
/// A base target for Nintendo Switch devices using a pure LLVM toolchain. | ||
pub fn target() -> Target { | ||
Target { | ||
llvm_target: "aarch64-unknown-none".into(), | ||
pointer_width: 64, | ||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(), | ||
arch: "aarch64".into(), | ||
options: TargetOptions { | ||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld), | ||
linker: Some("rust-lld".into()), | ||
link_script: Some(LINKER_SCRIPT.into()), | ||
os: "horizon".into(), | ||
max_atomic_width: Some(128), | ||
panic_strategy: PanicStrategy::Abort, | ||
position_independent_executables: true, | ||
dynamic_linking: true, | ||
executables: true, | ||
relro_level: RelroLevel::Off, | ||
..Default::default() | ||
}, | ||
} | ||
} |
78 changes: 78 additions & 0 deletions
78
compiler/rustc_target/src/spec/aarch64_nintendo_switch_freestanding_linker_script.ld
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
OUTPUT_FORMAT(elf64-littleaarch64) | ||
OUTPUT_ARCH(aarch64) | ||
ENTRY(_start) | ||
|
||
PHDRS | ||
{ | ||
text PT_LOAD FLAGS(5); | ||
rodata PT_LOAD FLAGS(4); | ||
data PT_LOAD FLAGS(6); | ||
bss PT_LOAD FLAGS(6); | ||
dynamic PT_DYNAMIC; | ||
} | ||
|
||
SECTIONS | ||
{ | ||
. = 0; | ||
|
||
.text : ALIGN(0x1000) { | ||
HIDDEN(__text_start = .); | ||
KEEP(*(.text.jmp)) | ||
|
||
. = 0x80; | ||
|
||
*(.text .text.*) | ||
*(.plt .plt.*) | ||
} | ||
|
||
/* Read-only sections */ | ||
|
||
. = ALIGN(0x1000); | ||
|
||
.module_name : { *(.module_name) } :rodata | ||
|
||
.rodata : { *(.rodata .rodata.*) } :rodata | ||
.hash : { *(.hash) } | ||
.dynsym : { *(.dynsym .dynsym.*) } | ||
.dynstr : { *(.dynstr .dynstr.*) } | ||
.rela.dyn : { *(.rela.dyn) } | ||
|
||
.eh_frame : { | ||
HIDDEN(__eh_frame_start = .); | ||
*(.eh_frame .eh_frame.*) | ||
HIDDEN(__eh_frame_end = .); | ||
} | ||
|
||
.eh_frame_hdr : { | ||
HIDDEN(__eh_frame_hdr_start = .); | ||
*(.eh_frame_hdr .eh_frame_hdr.*) | ||
HIDDEN(__eh_frame_hdr_end = .); | ||
} | ||
|
||
/* Read-write sections */ | ||
|
||
. = ALIGN(0x1000); | ||
|
||
.data : { | ||
*(.data .data.*) | ||
*(.got .got.*) | ||
*(.got.plt .got.plt.*) | ||
} :data | ||
|
||
.dynamic : { | ||
HIDDEN(__dynamic_start = .); | ||
*(.dynamic) | ||
} | ||
|
||
/* BSS section */ | ||
|
||
. = ALIGN(0x1000); | ||
|
||
.bss : { | ||
HIDDEN(__bss_start = .); | ||
*(.bss .bss.*) | ||
*(COMMON) | ||
. = ALIGN(8); | ||
HIDDEN(__bss_end = .); | ||
} :bss | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.