[PATCH 1/2] newlib: fix preprocessor checks

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Restore the call to AC_NO_EXECUTABLES -- I naively assumed in commit
2e9aa5f56cc26a411014a7f788423c670cfb5646 ("newlib: update preprocessor
configure checks") that checking for a preprocessor would not involve
linking code.  Unfortunately, autoconf will implicitly check that the
compiler "works" before allowing it to be used, and that involves a
link test, and that fails because newlib provides the C library which
is needed to pass a link test.

There is some code in NEWLIB_CONFIGURE specifically to help mitigate
these, but it's not kicking in here for some reason, so let's just add
the AC_NO_EXECUTABLES call back until we can unwind that custom logic.

Additionally, we have to call AC_PROG_CPP explicitly.  This was being
invoked later on, but only in the use_libtool=yes codepath, and that
is almost never enabled.
---
 newlib/libc/configure    | 1206 +++++++++++++++++++++-----------------
 newlib/libc/configure.ac |    2 +
 newlib/libm/configure    | 1128 +++++++++++++++++++----------------
 newlib/libm/configure.ac |    2 +
 4 files changed, 1285 insertions(+), 1053 deletions(-)

diff --git a/newlib/libc/configure.ac b/newlib/libc/configure.ac
index 5d4dc7bf5600..4a0160a57d80 100644
--- a/newlib/libc/configure.ac
+++ b/newlib/libc/configure.ac
@@ -45,7 +45,9 @@ AC_ARG_ENABLE(newlib-retargetable-locking,
  esac],[newlib_retargetable_locking=no])
 AM_CONDITIONAL(NEWLIB_RETARGETABLE_LOCKING, test x$newlib_retargetable_locking = xyes)
 
+AC_NO_EXECUTABLES
 NEWLIB_CONFIGURE(..)
+AC_PROG_CPP
 
 AM_CONDITIONAL(NEWLIB_NANO_MALLOC, test x$newlib_nano_malloc = xyes)
 
diff --git a/newlib/libm/configure.ac b/newlib/libm/configure.ac
index e4611ed846dd..a03ea3872bd5 100644
--- a/newlib/libm/configure.ac
+++ b/newlib/libm/configure.ac
@@ -16,7 +16,9 @@ AM_CONDITIONAL(NEWLIB_HW_FP, test x$newlib_hw_fp = xtrue)
 dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. 
 AC_CONFIG_AUX_DIR(../..)
 
+AC_NO_EXECUTABLES
 NEWLIB_CONFIGURE(..)
+AC_PROG_CPP
 
 dnl We have to enable libtool after NEWLIB_CONFIGURE because if we try and
 dnl add it into NEWLIB_CONFIGURE, executable tests are made before the first
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.