public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH: Add x32 support to config.guess
@ 2012-08-16 17:27 H.J. Lu
  2012-08-18 12:49 ` Ben Elliston
  0 siblings, 1 reply; 7+ messages in thread
From: H.J. Lu @ 2012-08-16 17:27 UTC (permalink / raw)
  To: config-patches, gcc-patches, binutils

Hi,

GCC on Linux/x86-64 may be configured for x32:

https://sites.google.com/site/x32abi/

by default and the Linux/x32 target should be x86_64-VENDOR-linux-gnux32.
This patch adds x32 support to config.guess.  OK to install?

Thanks.


H.J.
---
2012-08-16  H.J. Lu  <hongjiu.lu@intel.com>

	* config.guess (x86_64:Linux:*:*): Append x32 if compiler is
	configured for 32-bit  objects.

diff --git a/config.guess b/config.guess
index b02565c..4b0f7c2 100755
--- a/config.guess
+++ b/config.guess
@@ -984,7 +984,18 @@ EOF
 	echo ${UNAME_MACHINE}-dec-linux-gnu
 	exit ;;
     x86_64:Linux:*:*)
-	echo x86_64-unknown-linux-gnu
+	eval $set_cc_for_build
+	X86_64_ABI=
+	# If there is a compiler, see if it is configured for 32-bit objects.
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_X32 >/dev/null
+	    then
+		X86_64_ABI=x32
+	    fi
+	fi
+	echo x86_64-unknown-linux-gnu${X86_64_ABI}
 	exit ;;
     xtensa*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-08-18 18:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-16 17:27 PATCH: Add x32 support to config.guess H.J. Lu
2012-08-18 12:49 ` Ben Elliston
2012-08-18 13:52   ` H.J. Lu
2012-08-18 17:34     ` Mike Stump
2012-08-18 17:41       ` Mike Frysinger
2012-08-18 18:02         ` H.J. Lu
2012-08-18 18:53           ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).