File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -276,7 +276,10 @@ fn main() {
276276 "stdc++"
277277 } ;
278278
279- // RISC-V requires libatomic for sub-word atomic operations
279+ // RISC-V GCC erroneously requires libatomic for sub-word
280+ // atomic operations. FreeBSD uses Clang as its system
281+ // compiler and provides no libatomic in its base system so
282+ // does not want this.
280283 if !target. contains ( "freebsd" ) && target. starts_with ( "riscv" ) {
281284 println ! ( "cargo:rustc-link-lib=atomic" ) ;
282285 }
Original file line number Diff line number Diff line change @@ -250,8 +250,13 @@ impl Step for Llvm {
250250 }
251251
252252 if !target. contains ( "freebsd" ) && target. starts_with ( "riscv" ) {
253- // In RISC-V, using C++ atomics require linking to `libatomic` but the LLVM build
254- // system check cannot detect this. Therefore it is set manually here.
253+ // RISC-V GCC erroneously requires linking against
254+ // `libatomic` when using 1-byte and 2-byte C++
255+ // atomics but the LLVM build system check cannot
256+ // detect this. Therefore it is set manually here.
257+ // FreeBSD uses Clang as its system compiler and
258+ // provides no libatomic in its base system so does
259+ // not want this.
255260 if !builder. config . llvm_tools_enabled {
256261 cfg. define ( "CMAKE_EXE_LINKER_FLAGS" , "-latomic" ) ;
257262 } else {
You can’t perform that action at this time.
0 commit comments