Skip to content

Commit

Permalink
Fix Rustbuild linking on Illumos
Browse files Browse the repository at this point in the history
Illumos (an OpenSolaris fork) expects to get several
extra library references for some system functions used
by Rust standard library. This commit adds required linker
options to rustbuild, which is currently doesn't work on
Illumos-based operating systems.
  • Loading branch information
nbaksalyar committed Jul 7, 2017
1 parent b80b659 commit e084bb2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libstd/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ fn main() {
} else if target.contains("dragonfly") || target.contains("bitrig") ||
target.contains("netbsd") || target.contains("openbsd") {
println!("cargo:rustc-link-lib=pthread");
} else if target.contains("solaris") {
println!("cargo:rustc-link-lib=socket");
println!("cargo:rustc-link-lib=posix4");
println!("cargo:rustc-link-lib=pthread");
} else if target.contains("apple-darwin") {
println!("cargo:rustc-link-lib=System");

Expand Down

0 comments on commit e084bb2

Please sign in to comment.