Skip to content

Commit ecefd4e

Browse files
committed
Set max_atomic_width for riscv32*-esp-espidf to 32
1 parent 3050938 commit ecefd4e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_target/src/spec/riscv32imac_esp_espidf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub fn target() -> Target {
1717

1818
// As RiscV32IMAC architecture does natively support atomics,
1919
// automatically enable the support for the Rust STD library.
20-
max_atomic_width: Some(64),
20+
max_atomic_width: Some(32),
2121
atomic_cas: true,
2222

2323
features: "+m,+a,+c".into(),

compiler/rustc_target/src/spec/riscv32imc_esp_espidf.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ pub fn target() -> Target {
1616
cpu: "generic-rv32".into(),
1717

1818
// While the RiscV32IMC architecture does not natively support atomics, ESP-IDF does support
19-
// the __atomic* and __sync* GCC builtins, so setting `max_atomic_width` to `Some(64)`
19+
// the __atomic* and __sync* GCC builtins, so setting `max_atomic_width` to `Some(32)`
2020
// and `atomic_cas` to `true` will cause the compiler to emit libcalls to these builtins.
2121
//
2222
// Support for atomics is necessary for the Rust STD library, which is supported by the ESP-IDF framework.
23-
max_atomic_width: Some(64),
23+
max_atomic_width: Some(32),
2424
atomic_cas: true,
2525

2626
features: "+m,+c".into(),

0 commit comments

Comments
 (0)