From 35bdab1cb97f0be0ebea7cc93b977759f51d976c Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 17 May 2022 19:16:47 -0400 Subject: configure: Check CC_STAGE0 for --target support We previously only checked the stage 1/2 compiler for --target support. We got away with this for quite a while but it eventually caught up with us in #21579, where `bytestring`'s new NEON implementation was unbuildable on Darwin due to Rosetta's seemingly random logic for determining which executable image to execute. This lead to a confusing failure to build `bytestring`'s cbits, when `clang` tried to compile NEON builtins while targetting x86-64. Fix this by checking CC_STAGE0 for --target support. Fixes #21579. --- configure.ac | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 9f673ba2d8..9bcfae04c6 100644 --- a/configure.ac +++ b/configure.ac @@ -667,8 +667,10 @@ LLVMTarget_CPP=` echo "$LlvmTarget"` AC_SUBST(LLVMTarget_CPP) dnl ** See whether cc supports --target= and set -dnl CONF_CC_OPTS_STAGE[12] accordingly. -FP_CC_SUPPORTS_TARGET +dnl CONF_CC_OPTS_STAGE[012] accordingly. +FP_CC_SUPPORTS_TARGET([$CC_STAGE0], [CONF_CC_OPTS_STAGE0], [CONF_CXX_OPTS_STAGE0], [CONF_GCC_LINKER_OPTS_STAGE0]) +FP_CC_SUPPORTS_TARGET([$CC], [CONF_CC_OPTS_STAGE1], [CONF_CXX_OPTS_STAGE1], [CONF_GCC_LINKER_OPTS_STAGE1]) +FP_CC_SUPPORTS_TARGET([$CC], [CONF_CC_OPTS_STAGE2], [CONF_CXX_OPTS_STAGE2], [CONF_GCC_LINKER_OPTS_STAGE2]) # See rules/distdir-way-opts.mk for details. # Flags passed to the C compiler -- cgit v1.2.1