@@ -497,7 +497,7 @@ impl TargetTriple {
497497 let mut sys_info;
498498 let ( sysname, machine) = unsafe {
499499 sys_info = mem:: zeroed ( ) ;
500- if libc:: uname ( & mut sys_info) != 0 {
500+ if libc:: uname ( & mut sys_info) == - 1 {
501501 return None ;
502502 }
503503
@@ -507,7 +507,7 @@ impl TargetTriple {
507507 )
508508 } ;
509509
510- #[ cfg( not( target_os = "android" ) ) ]
510+ #[ cfg( not( any ( target_os = "android" , target_os = "illumos" , target_os = "solaris" ) ) ) ]
511511 let host_triple = match ( sysname, machine) {
512512 ( b"Linux" , b"x86_64" ) => Some ( TRIPLE_X86_64_UNKNOWN_LINUX ) ,
513513 ( b"Linux" , b"i686" ) => Some ( "i686-unknown-linux-gnu" ) ,
@@ -532,7 +532,6 @@ impl TargetTriple {
532532 ( b"NetBSD" , b"x86_64" ) => Some ( "x86_64-unknown-netbsd" ) ,
533533 ( b"NetBSD" , b"i686" ) => Some ( "i686-unknown-netbsd" ) ,
534534 ( b"DragonFly" , b"x86_64" ) => Some ( "x86_64-unknown-dragonfly" ) ,
535- ( b"SunOS" , b"i86pc" ) => Some ( "x86_64-unknown-illumos" ) ,
536535 _ => None ,
537536 } ;
538537
@@ -547,6 +546,19 @@ impl TargetTriple {
547546 _ => None ,
548547 } ;
549548
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+
550562 host_triple. map ( TargetTriple :: new)
551563 }
552564
0 commit comments