Skip to content

Commit

Permalink
Rollup merge of #123359 - bzEq:aix-libc++abi, r=cuviper
Browse files Browse the repository at this point in the history
Link against libc++abi and libunwind as well when building LLVM wrappers on AIX

Unlike `libc++.so` on Linux which is a linker script
```ld
INPUT(libc++.so.1 -lc++abi -lunwind)
```
AIX linker doesn't support such script, so `c++abi` and `unwind` have to be specified explicitly.
  • Loading branch information
workingjubilee authored Apr 3, 2024
2 parents f700fb2 + 00f7f57 commit 04a7a55
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/rustc_llvm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,12 @@ fn main() {
}
}

// libc++abi and libunwind have to be specified explicitly on AIX.
if target.contains("aix") {
println!("cargo:rustc-link-lib=c++abi");
println!("cargo:rustc-link-lib=unwind");
}

// Libstdc++ depends on pthread which Rust doesn't link on MinGW
// since nothing else requires it.
if target.ends_with("windows-gnu") {
Expand Down

0 comments on commit 04a7a55

Please sign in to comment.