diff --git a/Misc/NEWS.d/next/Build/2025-05-30-11-19-19.gh-issue-117888.-4okIx.rst b/Misc/NEWS.d/next/Build/2025-05-30-11-19-19.gh-issue-117888.-4okIx.rst new file mode 100644 index 00000000000000..1fd1af6b654ea1 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2025-05-30-11-19-19.gh-issue-117888.-4okIx.rst @@ -0,0 +1 @@ +Report error if platform triplet detection fails. diff --git a/configure b/configure index c9ce9b4a73527d..b4e36d1b1af040 100755 --- a/configure +++ b/configure @@ -7161,14 +7161,14 @@ fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5 printf %s "checking for the platform triplet based on compiler characteristics... " >&6; } -if $CPP $CPPFLAGS $srcdir/Misc/platform_triplet.c >conftest.out 2>/dev/null; then +if $CPP $CPPFLAGS $srcdir/Misc/platform_triplet.c >conftest.out 2>conftest.err; then PLATFORM_TRIPLET=`grep '^PLATFORM_TRIPLET=' conftest.out | tr -d ' '` PLATFORM_TRIPLET="${PLATFORM_TRIPLET#PLATFORM_TRIPLET=}" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PLATFORM_TRIPLET" >&5 printf "%s\n" "$PLATFORM_TRIPLET" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 -printf "%s\n" "none" >&6; } + cat conftest.err >&2 + as_fn_error $? "platform triplet detection failed, see error output above" "$LINENO" 5 fi rm -f conftest.out diff --git a/configure.ac b/configure.ac index eb52365d95be21..22e10b5e8d4fd2 100644 --- a/configure.ac +++ b/configure.ac @@ -1151,12 +1151,13 @@ fi AC_MSG_CHECKING([for the platform triplet based on compiler characteristics]) -if $CPP $CPPFLAGS $srcdir/Misc/platform_triplet.c >conftest.out 2>/dev/null; then +if $CPP $CPPFLAGS $srcdir/Misc/platform_triplet.c >conftest.out 2>conftest.err; then PLATFORM_TRIPLET=`grep '^PLATFORM_TRIPLET=' conftest.out | tr -d ' '` PLATFORM_TRIPLET="${PLATFORM_TRIPLET@%:@PLATFORM_TRIPLET=}" AC_MSG_RESULT([$PLATFORM_TRIPLET]) else - AC_MSG_RESULT([none]) + cat conftest.err >&2 + AC_MSG_ERROR([platform triplet detection failed, see error output above]) fi rm -f conftest.out