From 8b8654d04dcbb7f0a5947bc21efc5b9c60b3b6c6 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 11 Sep 2023 10:50:00 +0200 Subject: [PATCH] libffi: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] Similar to commit fb5d27be272b71fb9026224535fc73f125ce3be7 "libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951]", this is commit a0b48358cb1e70e161a87ec5deb7a4b25defba6b "libffi/test: Fix compilation for build sysroot" done differently, avoiding build-tree testing use of any random gunk that may appear in build-time 'CC', 'CXX'. PR testsuite/109951 libffi/ * configure.ac: 'AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)'. : Don't set 'CC_FOR_TARGET', 'CXX_FOR_TARGET', instead set 'SYSROOT_CFLAGS_FOR_TARGET'. * Makefile.in: Regenerate. * configure: Likewise. * include/Makefile.in: Likewise. * man/Makefile.in: Likewise. * testsuite/Makefile.in: Likewise. * testsuite/lib/libffi.exp (libffi_target_compile): If '--with-build-sysroot=[...]' was specified, use it for build-tree testing. --- libffi/Makefile.in | 1 + libffi/configure | 10 ++++++---- libffi/configure.ac | 5 +++-- libffi/include/Makefile.in | 1 + libffi/man/Makefile.in | 1 + libffi/testsuite/Makefile.in | 1 + libffi/testsuite/lib/libffi.exp | 7 +++++++ 7 files changed, 20 insertions(+), 6 deletions(-) diff --git a/libffi/Makefile.in b/libffi/Makefile.in index 1d936b5c8a5..3a55212cc00 100644 --- a/libffi/Makefile.in +++ b/libffi/Makefile.in @@ -383,6 +383,7 @@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ TARGET = @TARGET@ TARGETDIR = @TARGETDIR@ TARGET_OBJ = @TARGET_OBJ@ diff --git a/libffi/configure b/libffi/configure index 9eac9c907bf..f1efd6987a3 100755 --- a/libffi/configure +++ b/libffi/configure @@ -666,6 +666,7 @@ TESTSUBDIR_TRUE MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE +SYSROOT_CFLAGS_FOR_TARGET READELF CXXCPP CPP @@ -11634,7 +11635,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11637 "configure" +#line 11638 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11740,7 +11741,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11743 "configure" +#line 11744 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15137,9 +15138,10 @@ _ACEOF + + cat > local.exp < local.exp <