-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
rustc-1.24.0-src: cannot find -lstdc++ on FreeBSD 11.1 #48578
Copy link
Copy link
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I am trying to build lang/rust for FreeBSD using the pkgsrc framework.
The clang++ check fails during LLVM build since ld cannot find -lstdc++. Actually -lc++ should be used.
This dirty hack solves the problem but there probably is a better way to do that:
--- src/bootstrap/native.rs.orig 2018-02-12 18:51:18.000000000 +0000
+++ src/bootstrap/native.rs
@@ -223,7 +223,11 @@ impl Step for Llvm {
cfg.build_arg("-j").build_arg(build.jobs().to_string());
cfg.define("CMAKE_C_FLAGS", build.cflags(target).join(" "));
- cfg.define("CMAKE_CXX_FLAGS", build.cflags(target).join(" "));
+ if target.contains("freebsd") {
+ cfg.define("CMAKE_CXX_FLAGS", build.cflags(target).join(" ") + " -stdlib=libc++");
+ } else {
+ cfg.define("CMAKE_CXX_FLAGS", build.cflags(target).join(" "));
+ }
if let Some(ar) = build.ar(target) {
if ar.is_absolute() {
// LLVM build breaks if `CMAKE_AR` is a relative path, for some reason it
The build trace is attached in the following file:
rust.log
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.