This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Add x32 support to config.guess
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: config-patches at gnu dot org, gcc-patches at gcc dot gnu dot org, binutils at sourceware dot org
- Date: Thu, 16 Aug 2012 10:26:48 -0700
- Subject: PATCH: Add x32 support to config.guess
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
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