about summary refs log tree commit diff
diff options
context:
space:
mode:
authorShawn Walker-Salas <shawn.walker@oracle.com>2017-02-11 09:24:33 -0800
committerShawn Walker-Salas <shawn.walker@oracle.com>2017-02-11 20:28:44 -0800
commitee54be3c9a8099d45d64764f0e50c315d5256a4c (patch)
treec9b0519b87d54d4b7550dfa05efb83871bfeb041
parent912bc14a6b25bac66822766b09dcfb3c6263757d (diff)
downloadrust-ee54be3c9a8099d45d64764f0e50c315d5256a4c.tar.gz
rust-ee54be3c9a8099d45d64764f0e50c315d5256a4c.zip
Add Solaris as recognized ostype
Add cputype recognition for Solaris

Fixes #39729
-rw-r--r--src/bootstrap/bootstrap.py15
-rw-r--r--src/libstd/build.rs2
-rw-r--r--src/libunwind/build.rs2
3 files changed, 19 insertions, 0 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index 27255b69100..9593e3f0793 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -345,6 +345,21 @@ class RustBuild(object):
             ostype = 'unknown-openbsd'
         elif ostype == 'NetBSD':
             ostype = 'unknown-netbsd'
+        elif ostype == 'SunOS':
+            ostype = 'sun-solaris'
+            # On Solaris, uname -m will return a machine classification instead
+            # of a cpu type, so uname -p is recommended instead.  However, the
+            # output from that option is too generic for our purposes (it will
+            # always emit 'i386' on x86/amd64 systems).  As such, isainfo -k
+            # must be used instead.
+            try:
+                cputype = subprocess.check_output(['isainfo',
+                  '-k']).strip().decode(default_encoding)
+            except (subprocess.CalledProcessError, WindowsError):
+                err = "isainfo not found"
+                if self.verbose:
+                    raise Exception(err)
+                sys.exit(err)
         elif ostype == 'Darwin':
             ostype = 'apple-darwin'
         elif ostype.startswith('MINGW'):
diff --git a/src/libstd/build.rs b/src/libstd/build.rs
index 0fca374f6e6..790cd5b65ba 100644
--- a/src/libstd/build.rs
+++ b/src/libstd/build.rs
@@ -46,6 +46,8 @@ 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=gcc_s");
     } else if target.contains("apple-darwin") {
         println!("cargo:rustc-link-lib=System");
     } else if target.contains("apple-ios") {
diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs
index f18b694d3d0..ea0d7697833 100644
--- a/src/libunwind/build.rs
+++ b/src/libunwind/build.rs
@@ -27,6 +27,8 @@ fn main() {
         println!("cargo:rustc-link-lib=gcc_s");
     } else if target.contains("openbsd") {
         println!("cargo:rustc-link-lib=gcc");
+    } else if target.contains("solaris") {
+        println!("cargo:rustc-link-lib=gcc_s");
     } else if target.contains("bitrig") {
         println!("cargo:rustc-link-lib=c++abi");
     } else if target.contains("dragonfly") {