[PATCH] D82428: [clang][driver] allow `-arch arm64` to be used to build for mac when on Apple Silicon Mac without explicit `-target`

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 23 21:35:52 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG050ed9720f84: [cmake] configure the host triple on an Apple Silicon machine correctly (authored by arphaman).

Changed prior to commit:
  https://reviews.llvm.org/D82428?vs=272891&id=272908#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82428/new/

https://reviews.llvm.org/D82428

Files:
  llvm/cmake/config.guess


Index: llvm/cmake/config.guess
===================================================================
--- llvm/cmake/config.guess
+++ llvm/cmake/config.guess
@@ -1263,6 +1263,23 @@
 		      UNAME_PROCESSOR="x86_64"
 		  fi
 		fi ;;
+		arm)
+		eval $set_cc_for_build
+		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+			if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+				(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+				grep IS_64BIT_ARCH >/dev/null
+			then
+				if (echo '#ifdef __PTRAUTH_INTRINSICS__'; echo HAS_AUTH; echo '#endif') | \
+					(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+					grep HAS_AUTH >/dev/null
+				then
+					UNAME_PROCESSOR="arm64e"
+				else
+					UNAME_PROCESSOR="arm64"
+				fi
+			fi
+		fi ;;
 	    unknown) UNAME_PROCESSOR=powerpc ;;
 	esac
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82428.272908.patch
Type: text/x-patch
Size: 855 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200624/91eb49f7/attachment.bin>


More information about the cfe-commits mailing list