From e084bb2abc7f318955f3d0b20b1398c5b393926f Mon Sep 17 00:00:00 2001 From: Nikita Baksalyar Date: Fri, 7 Jul 2017 08:32:18 +0300 Subject: [PATCH] Fix Rustbuild linking on Illumos 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. --- src/libstd/build.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libstd/build.rs b/src/libstd/build.rs index f84662c3f86..2abd47ab8df 100644 --- a/src/libstd/build.rs +++ b/src/libstd/build.rs @@ -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");