Skip to content

Commit af8f75a

Browse files
committed
Included fixes from the built-in-llvm branch
1 parent b71f213 commit af8f75a

File tree

4 files changed

+5
-64
lines changed

4 files changed

+5
-64
lines changed

src/bootstrap/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ impl Config {
544544
set(&mut config.llvm_static_stdcpp, llvm.static_libstdcpp);
545545
set(&mut config.llvm_link_shared, llvm.link_shared);
546546
config.llvm_targets = llvm.targets.clone();
547-
config.llvm_experimental_targets = llvm.experimental_targets.clone();
547+
config.llvm_experimental_targets = Some(llvm.experimental_targets.clone().unwrap_or("Xtensa".to_string()));
548548
config.llvm_link_jobs = llvm.link_jobs;
549549
config.llvm_version_suffix = llvm.version_suffix.clone();
550550
config.llvm_clang_cl = llvm.clang_cl.clone();

src/librustc_target/spec/xtensa_esp32_none_elf.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
use crate::spec::{abi::Abi, LinkerFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
2-
// use crate::spec::abi::Abi;
32

43
pub fn target() -> TargetResult {
54
Ok(Target {
65
llvm_target: "xtensa-none-elf".to_string(),
76
target_endian: "little".to_string(),
87
target_pointer_width: "32".to_string(),
98
target_c_int_width: "32".to_string(),
10-
data_layout: "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-f64:64-a:0:32-n32".to_string(),
9+
data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32".to_string(),
1110
arch: "xtensa".to_string(),
1211
target_os: "none".to_string(),
1312
target_env: String::new(),
@@ -17,16 +16,9 @@ pub fn target() -> TargetResult {
1716
options: TargetOptions {
1817
executables: true,
1918
cpu: "esp32".to_string(),
20-
// The LLVM backend currently can't generate object files. To
21-
// workaround this LLVM generates assembly files which then we feed
22-
// to gcc to get object files. For this reason we have a hard
23-
// dependency on this specific gcc.
24-
// asm_args: vec!["-mcpu=esp32".to_string()],
2519
linker: Some("xtensa-esp32-elf-gcc".to_string()),
26-
no_integrated_as: true,
2720

2821
max_atomic_width: Some(32),
29-
atomic_cas: true,
3022

3123
// Because these devices have very little resources having an
3224
// unwinder is too onerous so we default to "abort" because the
@@ -37,17 +29,6 @@ pub fn target() -> TargetResult {
3729
// code because of the extra costs it involves.
3830
relocation_model: "static".to_string(),
3931

40-
// Right now we invoke an external assembler and this isn't
41-
// compatible with multiple codegen units, and plus we probably
42-
// don't want to invoke that many gcc instances.
43-
default_codegen_units: Some(1),
44-
45-
// Since MSP430 doesn't meaningfully support faulting on illegal
46-
// instructions, LLVM generates a call to abort() function instead
47-
// of a trap instruction. Such calls are 4 bytes long, and that is
48-
// too much overhead for such small target.
49-
trap_unreachable: false,
50-
5132
// See the thumb_base.rs file for an explanation of this value
5233
emit_debug_gdb_scripts: false,
5334

src/librustc_target/spec/xtensa_esp8266_none_elf.rs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,23 @@
11
use crate::spec::{abi::Abi, LinkerFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
2-
// use crate::spec::abi::Abi;
32

43
pub fn target() -> TargetResult {
54
Ok(Target {
65
llvm_target: "xtensa-none-elf".to_string(),
76
target_endian: "little".to_string(),
87
target_pointer_width: "32".to_string(),
98
target_c_int_width: "32".to_string(),
10-
data_layout: "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-f64:64-a:0:32-n32".to_string(),
9+
data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32".to_string(),
1110
arch: "xtensa".to_string(),
1211
target_os: "none".to_string(),
1312
target_env: String::new(),
1413
target_vendor: String::new(),
1514
linker_flavor: LinkerFlavor::Gcc,
1615

1716
options: TargetOptions {
18-
executables: true,
1917
cpu: "esp8266".to_string(),
20-
// The LLVM backend currently can't generate object files. To
21-
// workaround this LLVM generates assembly files which then we feed
22-
// to gcc to get object files. For this reason we have a hard
23-
// dependency on this specific gcc.
24-
// asm_args: vec!["-mcpu=esp8266".to_string()],
25-
linker: Some("xtensa-lx106-elf-gcc".to_string()),
26-
no_integrated_as: true,
18+
linker: Some("xtensa-esp32-elf-ld".to_string()),
2719

2820
max_atomic_width: Some(32),
29-
atomic_cas: true,
3021

3122
// Because these devices have very little resources having an
3223
// unwinder is too onerous so we default to "abort" because the
@@ -37,17 +28,6 @@ pub fn target() -> TargetResult {
3728
// code because of the extra costs it involves.
3829
relocation_model: "static".to_string(),
3930

40-
// Right now we invoke an external assembler and this isn't
41-
// compatible with multiple codegen units, and plus we probably
42-
// don't want to invoke that many gcc instances.
43-
default_codegen_units: Some(1),
44-
45-
// Since MSP430 doesn't meaningfully support faulting on illegal
46-
// instructions, LLVM generates a call to abort() function instead
47-
// of a trap instruction. Such calls are 4 bytes long, and that is
48-
// too much overhead for such small target.
49-
trap_unreachable: false,
50-
5131
// See the thumb_base.rs file for an explanation of this value
5232
emit_debug_gdb_scripts: false,
5333

src/librustc_target/spec/xtensa_none_elf.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
use crate::spec::{abi::Abi, LinkerFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
2-
// use crate::spec::abi::Abi;
32

43
pub fn target() -> TargetResult {
54
Ok(Target {
65
llvm_target: "xtensa-none-elf".to_string(),
76
target_endian: "little".to_string(),
87
target_pointer_width: "32".to_string(),
98
target_c_int_width: "32".to_string(),
10-
data_layout: "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-f64:64-a:0:32-n32".to_string(),
9+
data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32".to_string(),
1110
arch: "xtensa".to_string(),
1211
target_os: "none".to_string(),
1312
target_env: String::new(),
@@ -16,17 +15,9 @@ pub fn target() -> TargetResult {
1615

1716
options: TargetOptions {
1817
executables: true,
19-
20-
// The LLVM backend currently can't generate object files. To
21-
// workaround this LLVM generates assembly files which then we feed
22-
// to gcc to get object files. For this reason we have a hard
23-
// dependency on this specific gcc.
24-
// asm_args: vec!["-mcpu=generic".to_string()],
2518
linker: Some("xtensa-esp32-elf-gcc".to_string()),
26-
no_integrated_as: true,
2719

2820
max_atomic_width: Some(32),
29-
atomic_cas: true,
3021

3122
// Because these devices have very little resources having an
3223
// unwinder is too onerous so we default to "abort" because the
@@ -37,17 +28,6 @@ pub fn target() -> TargetResult {
3728
// code because of the extra costs it involves.
3829
relocation_model: "static".to_string(),
3930

40-
// Right now we invoke an external assembler and this isn't
41-
// compatible with multiple codegen units, and plus we probably
42-
// don't want to invoke that many gcc instances.
43-
default_codegen_units: Some(1),
44-
45-
// Since MSP430 doesn't meaningfully support faulting on illegal
46-
// instructions, LLVM generates a call to abort() function instead
47-
// of a trap instruction. Such calls are 4 bytes long, and that is
48-
// too much overhead for such small target.
49-
trap_unreachable: false,
50-
5131
// See the thumb_base.rs file for an explanation of this value
5232
emit_debug_gdb_scripts: false,
5333

0 commit comments

Comments
 (0)