config-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Detect 32-bit userland on sparc64 linux kernel as sparc-unknown-


From: James Y Knight
Subject: [PATCH] Detect 32-bit userland on sparc64 linux kernel as sparc-unknown-linux.
Date: Tue, 2 Jun 2015 15:56:51 -0400

Similar to the situation on x86-64, a sparc64 linux kernel can run a 32-bit 
userspace, and when doing so, the triple should be the 32-bit variant not the 
64-bit variant.



From 2a1c9ec7c2f651244c9e48676eaba68dd9d0e248 Mon Sep 17 00:00:00 2001
From: James Y Knight <address@hidden>
Date: Tue, 2 Jun 2015 15:36:24 -0400
Subject: [PATCH]        * config.guess (sparc64:Linux:*:*): Detect 32-bit
 userland on    sparc64 linux kernel as sparc-unknown-linux.

---
 ChangeLog    |  5 +++++
 config.guess | 17 +++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0181c40..5f34276 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-02  James Y Knight  <address@hidden>
+
+       * config.guess (sparc64:Linux:*:*): Detect 32-bit userland on
+       sparc64 linux kernel as sparc-unknown-linux.
+
 2015-03-08  Brion Vibber  <address@hidden>
 
        * config.sub (asmjs): Recognize.
diff --git a/config.guess b/config.guess
index f7eb141..25ef2d1 100755
--- a/config.guess
+++ b/config.guess
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2015 Free Software Foundation, Inc.
 
-timestamp='2015-03-04'
+timestamp='2015-06-02'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -1028,9 +1028,22 @@ EOF
     sh*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
-    sparc:Linux:*:* | sparc64:Linux:*:*)
+    sparc:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
+    sparc64:Linux:*:*)
+       # A sparc64 kernel can be used with both 32bit and 64bit
+       # userspaces.  Figure out which we have.
+       eval $set_cc_for_build
+       if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+         grep -q __LP64__
+       then
+         SPARC_ARCH="sparc"
+       else
+         SPARC_ARCH="sparc64"
+       fi
+       echo ${SPARC_ARCH}-unknown-linux-${LIBC}
+       exit ;;
     tile*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
-- 
2.2.0.rc0.207.ga3a616c




reply via email to

[Prev in Thread] Current Thread [Next in Thread]