Skip to content

Commit a93be6d

Browse files
authored
Rollup merge of #94292 - esp-rs:riscv32imc-esp-espidf-64bit-atomics, r=petrochenkov
riscv32imc_esp_espidf: set max_atomic_width to 64 For espidf targets without native atomics, there is atomic emulation inside [the newlib component of espidf](https://github.com/espressif/esp-idf/blob/master/components/newlib/stdatomic.c), this has been extended to support emulation up to 64bits therefore we are safe to increase the atomic width for the `riscv32imc_esp_espidf` target. Closes esp-rs#107 cc: `@ivmarkov`
2 parents ae27c4a + 65614e9 commit a93be6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_target/src/spec/riscv32imc_esp_espidf.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ pub fn target() -> Target {
1818
cpu: "generic-rv32".to_string(),
1919

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

2828
features: "+m,+c".to_string(),

0 commit comments

Comments
 (0)