Skip to content

Commit

Permalink
Don't try to statically link libstdc++ on FreeBSD
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ScottAbbey committed Dec 22, 2017
1 parent f7a0dff commit b989428
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/bootstrap/compile.rs
Expand Up @@ -550,6 +550,7 @@ pub fn rustc_cargo(build: &Build,
// Building with a static libstdc++ is only supported on linux right now,
// not for MSVC or macOS
if build.config.llvm_static_stdcpp &&
!target.contains("freebsd") &&
!target.contains("windows") &&
!target.contains("apple") {
cargo.env("LLVM_STATIC_STDCPP",
Expand Down

0 comments on commit b989428

Please sign in to comment.