Explain why libatomic is not needed on FreeBSD riscv64
From Jessica Clarke (jrtc27@)
This commit is contained in:
parent
47474f1055
commit
e24045e587
2 changed files with 11 additions and 3 deletions
|
@ -276,7 +276,10 @@ fn main() {
|
||||||
"stdc++"
|
"stdc++"
|
||||||
};
|
};
|
||||||
|
|
||||||
// RISC-V requires libatomic for sub-word atomic operations
|
// RISC-V GCC erroneously requires libatomic for sub-word
|
||||||
|
// atomic operations. FreeBSD uses Clang as its system
|
||||||
|
// compiler and provides no libatomic in its base system so
|
||||||
|
// does not want this.
|
||||||
if !target.contains("freebsd") && target.starts_with("riscv") {
|
if !target.contains("freebsd") && target.starts_with("riscv") {
|
||||||
println!("cargo:rustc-link-lib=atomic");
|
println!("cargo:rustc-link-lib=atomic");
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,8 +250,13 @@ impl Step for Llvm {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !target.contains("freebsd") && target.starts_with("riscv") {
|
if !target.contains("freebsd") && target.starts_with("riscv") {
|
||||||
// In RISC-V, using C++ atomics require linking to `libatomic` but the LLVM build
|
// RISC-V GCC erroneously requires linking against
|
||||||
// system check cannot detect this. Therefore it is set manually here.
|
// `libatomic` when using 1-byte and 2-byte C++
|
||||||
|
// atomics but the LLVM build system check cannot
|
||||||
|
// detect this. Therefore it is set manually here.
|
||||||
|
// FreeBSD uses Clang as its system compiler and
|
||||||
|
// provides no libatomic in its base system so does
|
||||||
|
// not want this.
|
||||||
if !builder.config.llvm_tools_enabled {
|
if !builder.config.llvm_tools_enabled {
|
||||||
cfg.define("CMAKE_EXE_LINKER_FLAGS", "-latomic");
|
cfg.define("CMAKE_EXE_LINKER_FLAGS", "-latomic");
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue