File tree 1 file changed +6
-9
lines changed
compiler/rustc_target/src/spec
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -22,18 +22,15 @@ pub fn target() -> Target {
22
22
23
23
// See https://github.com/espressif/rust-esp32-example/issues/3#issuecomment-861054477
24
24
//
25
- // Unlike the original ESP32 chip, ESP32-S2 does not really support atomics.
26
- // If the missing hardware instruction ends up being emulated in ESP-IDF, we might want to revert
27
- // this change and claim that atomics are supported "in hardware" (even though they would be emulated
28
- // by actually trapping the illegal instruction exception handler and calling into an ESP-IDF C emulation code).
25
+ // While the ESP32-S2 chip does not natively support atomics, ESP-IDF does support
26
+ // the __atomic* and __sync* compiler builtins. Setting `max_atomic_width` and `atomic_cas`
27
+ // and `atomic_cas: true` will cause the compiler to emit libcalls to these builtins.
29
28
//
30
- // However, for now we simultaneously claim "max_atomic_width: Some(64)" **and** atomic_cas: true,
31
- // which should force the compiler to generate libcalls to functions that emulate atomics
32
- // and which are already implemented in the ESP-IDF main branch anyway.
33
- max_atomic_width : Some ( 64 ) ,
29
+ // Support for atomics is necessary for the Rust STD library, which is supported by ESP-IDF.
30
+ max_atomic_width : Some ( 32 ) ,
34
31
atomic_cas : true ,
35
32
36
33
..super :: xtensa_base:: opts ( )
37
34
} ,
38
35
}
39
- }
36
+ }
You can’t perform that action at this time.
0 commit comments