Add Solaris as recognized ostype
Add cputype recognition for Solaris Fixes #39729
This commit is contained in:
parent
912bc14a6b
commit
ee54be3c9a
3 changed files with 19 additions and 0 deletions
|
@ -345,6 +345,21 @@ class RustBuild(object):
|
||||||
ostype = 'unknown-openbsd'
|
ostype = 'unknown-openbsd'
|
||||||
elif ostype == 'NetBSD':
|
elif ostype == 'NetBSD':
|
||||||
ostype = 'unknown-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':
|
elif ostype == 'Darwin':
|
||||||
ostype = 'apple-darwin'
|
ostype = 'apple-darwin'
|
||||||
elif ostype.startswith('MINGW'):
|
elif ostype.startswith('MINGW'):
|
||||||
|
|
|
@ -46,6 +46,8 @@ fn main() {
|
||||||
} else if target.contains("dragonfly") || target.contains("bitrig") ||
|
} else if target.contains("dragonfly") || target.contains("bitrig") ||
|
||||||
target.contains("netbsd") || target.contains("openbsd") {
|
target.contains("netbsd") || target.contains("openbsd") {
|
||||||
println!("cargo:rustc-link-lib=pthread");
|
println!("cargo:rustc-link-lib=pthread");
|
||||||
|
} else if target.contains("solaris") {
|
||||||
|
println!("cargo:rustc-link-lib=gcc_s");
|
||||||
} else if target.contains("apple-darwin") {
|
} else if target.contains("apple-darwin") {
|
||||||
println!("cargo:rustc-link-lib=System");
|
println!("cargo:rustc-link-lib=System");
|
||||||
} else if target.contains("apple-ios") {
|
} else if target.contains("apple-ios") {
|
||||||
|
|
|
@ -27,6 +27,8 @@ fn main() {
|
||||||
println!("cargo:rustc-link-lib=gcc_s");
|
println!("cargo:rustc-link-lib=gcc_s");
|
||||||
} else if target.contains("openbsd") {
|
} else if target.contains("openbsd") {
|
||||||
println!("cargo:rustc-link-lib=gcc");
|
println!("cargo:rustc-link-lib=gcc");
|
||||||
|
} else if target.contains("solaris") {
|
||||||
|
println!("cargo:rustc-link-lib=gcc_s");
|
||||||
} else if target.contains("bitrig") {
|
} else if target.contains("bitrig") {
|
||||||
println!("cargo:rustc-link-lib=c++abi");
|
println!("cargo:rustc-link-lib=c++abi");
|
||||||
} else if target.contains("dragonfly") {
|
} else if target.contains("dragonfly") {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue