diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-02-24 07:48:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-24 07:48:10 +0100 |
| commit | a93be6def910757c262251ecb2c9acd045aec945 (patch) | |
| tree | fca6974cf067582399cb03b70e5de86153ad2b86 | |
| parent | ae27c4ab1f3c59eb81728425fbad4386e0a558bc (diff) | |
| parent | 65614e91ad847e3d2941e1308bb2b1d916eba25f (diff) | |
| download | rust-a93be6def910757c262251ecb2c9acd045aec945.tar.gz rust-a93be6def910757c262251ecb2c9acd045aec945.zip | |
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 https://github.com/esp-rs/rust/issues/107 cc: `@ivmarkov`
| -rw-r--r-- | compiler/rustc_target/src/spec/riscv32imc_esp_espidf.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_target/src/spec/riscv32imc_esp_espidf.rs b/compiler/rustc_target/src/spec/riscv32imc_esp_espidf.rs index fb084afe960..d506e7f6aac 100644 --- a/compiler/rustc_target/src/spec/riscv32imc_esp_espidf.rs +++ b/compiler/rustc_target/src/spec/riscv32imc_esp_espidf.rs @@ -18,11 +18,11 @@ pub fn target() -> Target { cpu: "generic-rv32".to_string(), // While the RiscV32IMC architecture does not natively support atomics, ESP-IDF does support - // the __atomic* and __sync* GCC builtins, so setting `max_atomic_width` to `Some(32)` + // the __atomic* and __sync* GCC builtins, so setting `max_atomic_width` to `Some(64)` // and `atomic_cas` to `true` will cause the compiler to emit libcalls to these builtins. // // Support for atomics is necessary for the Rust STD library, which is supported by the ESP-IDF framework. - max_atomic_width: Some(32), + max_atomic_width: Some(64), atomic_cas: true, features: "+m,+c".to_string(), |
