Skip to content

Commit ee54be3

Browse files
Add Solaris as recognized ostype
Add cputype recognition for Solaris Fixes rust-lang#39729
1 parent 912bc14 commit ee54be3

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

src/bootstrap/bootstrap.py

+15
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,21 @@ def build_triple(self):
345345
ostype = 'unknown-openbsd'
346346
elif ostype == 'NetBSD':
347347
ostype = 'unknown-netbsd'
348+
elif ostype == 'SunOS':
349+
ostype = 'sun-solaris'
350+
# On Solaris, uname -m will return a machine classification instead
351+
# of a cpu type, so uname -p is recommended instead. However, the
352+
# output from that option is too generic for our purposes (it will
353+
# always emit 'i386' on x86/amd64 systems). As such, isainfo -k
354+
# must be used instead.
355+
try:
356+
cputype = subprocess.check_output(['isainfo',
357+
'-k']).strip().decode(default_encoding)
358+
except (subprocess.CalledProcessError, WindowsError):
359+
err = "isainfo not found"
360+
if self.verbose:
361+
raise Exception(err)
362+
sys.exit(err)
348363
elif ostype == 'Darwin':
349364
ostype = 'apple-darwin'
350365
elif ostype.startswith('MINGW'):

src/libstd/build.rs

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ fn main() {
4646
} else if target.contains("dragonfly") || target.contains("bitrig") ||
4747
target.contains("netbsd") || target.contains("openbsd") {
4848
println!("cargo:rustc-link-lib=pthread");
49+
} else if target.contains("solaris") {
50+
println!("cargo:rustc-link-lib=gcc_s");
4951
} else if target.contains("apple-darwin") {
5052
println!("cargo:rustc-link-lib=System");
5153
} else if target.contains("apple-ios") {

src/libunwind/build.rs

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ fn main() {
2727
println!("cargo:rustc-link-lib=gcc_s");
2828
} else if target.contains("openbsd") {
2929
println!("cargo:rustc-link-lib=gcc");
30+
} else if target.contains("solaris") {
31+
println!("cargo:rustc-link-lib=gcc_s");
3032
} else if target.contains("bitrig") {
3133
println!("cargo:rustc-link-lib=c++abi");
3234
} else if target.contains("dragonfly") {

0 commit comments

Comments
 (0)