@@ -497,7 +497,7 @@ impl TargetTriple {
497
497
let mut sys_info;
498
498
let ( sysname, machine) = unsafe {
499
499
sys_info = mem:: zeroed ( ) ;
500
- if libc:: uname ( & mut sys_info) != 0 {
500
+ if libc:: uname ( & mut sys_info) == - 1 {
501
501
return None ;
502
502
}
503
503
@@ -507,7 +507,7 @@ impl TargetTriple {
507
507
)
508
508
} ;
509
509
510
- #[ cfg( not( target_os = "android" ) ) ]
510
+ #[ cfg( not( any ( target_os = "android" , target_os = "illumos" , target_os = "solaris" ) ) ) ]
511
511
let host_triple = match ( sysname, machine) {
512
512
( b"Linux" , b"x86_64" ) => Some ( TRIPLE_X86_64_UNKNOWN_LINUX ) ,
513
513
( b"Linux" , b"i686" ) => Some ( "i686-unknown-linux-gnu" ) ,
@@ -532,7 +532,6 @@ impl TargetTriple {
532
532
( b"NetBSD" , b"x86_64" ) => Some ( "x86_64-unknown-netbsd" ) ,
533
533
( b"NetBSD" , b"i686" ) => Some ( "i686-unknown-netbsd" ) ,
534
534
( b"DragonFly" , b"x86_64" ) => Some ( "x86_64-unknown-dragonfly" ) ,
535
- ( b"SunOS" , b"i86pc" ) => Some ( "x86_64-unknown-illumos" ) ,
536
535
_ => None ,
537
536
} ;
538
537
@@ -547,6 +546,19 @@ impl TargetTriple {
547
546
_ => None ,
548
547
} ;
549
548
549
+ #[ cfg( target_os = "illumos" ) ]
550
+ let host_triple = match ( sysname, machine) {
551
+ ( b"SunOS" , b"i86pc" ) => Some ( "x86_64-unknown-illumos" ) ,
552
+ _ => None ,
553
+ } ;
554
+
555
+ #[ cfg( target_os = "solaris" ) ]
556
+ let host_triple = match ( sysname, machine) {
557
+ ( b"SunOS" , b"i86pc" ) => Some ( "x86_64-pc-solaris" ) ,
558
+ ( b"SunOS" , b"sun4v" ) => Some ( "sparcv9-sun-solaris" ) ,
559
+ _ => None ,
560
+ } ;
561
+
550
562
host_triple. map ( TargetTriple :: new)
551
563
}
552
564
0 commit comments