Skip to content

Commit b989428

Browse files
committed
Don't try to statically link libstdc++ on FreeBSD
The code inside this conditional will not work on FreeBSD 10+ because those versions use clang and libc++ rather than libstdc++. Since FreeBSD comes with libc++ in the base, presumably all 10+ systems will have it present. Searching for libstdc++.a will not work if it is not present. As a result, this would previously have set `LLVM_STATIC_STDCPP=libstdc++.a`, which isn't a valid path and caused problems later on when building `librustc_llvm`. This could possibly be updated in the future to look for `libc++.a` on FreeBSD, by expanding the code inside the conditional. In one attempt to run this on x86_64-freebsd, I found that libc++ was not compiled with PIC, so it failed anyway.
1 parent f7a0dff commit b989428

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/bootstrap/compile.rs

+1
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ pub fn rustc_cargo(build: &Build,
550550
// Building with a static libstdc++ is only supported on linux right now,
551551
// not for MSVC or macOS
552552
if build.config.llvm_static_stdcpp &&
553+
!target.contains("freebsd") &&
553554
!target.contains("windows") &&
554555
!target.contains("apple") {
555556
cargo.env("LLVM_STATIC_STDCPP",

0 commit comments

Comments
 (0)