This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][Revised]PR41180 pt2: fix config.guess on darwin10


   The proper default triplet for darwin10 is misidentified by config.guess.
This is due to the fact that on darwin10 "uname -p" reports the architecture
of the running kernel rather than the default architecture of the
binaries created by the system gcc and executed by the OS. In the case of
EMT64-capable processors, the system gcc will execute and produce
x86_64 code (independent of whether the 32-bit or the 64-bit kernel is
in use). The attached patch uses the presence of the __LP64__ preprocessor
symbol generated in the system gcc to determine if x86_64 is the proper
processor for the triplet. Confirmed to work on i386-apple-darwin10.
Okay for gcc trunk and gcc 4.4 a week later?
                           Jack

2009-09-01  Jack Howarth  <howarth@bromo.med.uc.edu>

	PR bootstrap/41180
	* config.guess: Use system gcc to determine if processor is x86_64 on darwin

Index: config.guess
===================================================================
--- config.guess	(revision 151248)
+++ config.guess	(working copy)
@@ -1246,6 +1246,10 @@
 	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+	eval $set_cc_for_build
+	if $CC_FOR_BUILD -E -dM -x c /dev/null | grep __LP64__>/dev/null 2>&1 ; then
+	  UNAME_PROCESSOR=x86_64
+	fi
 	case $UNAME_PROCESSOR in
 	    unknown) UNAME_PROCESSOR=powerpc ;;
 	esac


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]