From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) by sourceware.org (Postfix) with ESMTPS id 6B3A0385DC00 for ; Fri, 3 Apr 2020 23:01:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6B3A0385DC00 IronPort-SDR: UepcP67iKJBwB/x2iGacnHvZrFJhctmOIAx0wmmQPSor4tmKx70XOi857VMRPWnXuXzN6m0a71 CVrvaudqSjU+cSGhF/3CmtakWXiD1xEp8KIRZftELtfRyrhrwibNDmlIlnUMcOa1AZJ434TdAo eOj5BCJ7Z0C+lhE+MKSyWfcfhQ3+Ub0WAVPht2+Ch3D8dHz06SL3SS1vKCwmb3uyV2xwNqN+rg AD+L1gfF1WrsbL8uxHvxGWmf3tqHxpANYrQJ0P9wWZOHs4o5My4tfG7mutLbvvoVoWRIynLVbt QV0= X-IronPort-AV: E=Sophos;i="5.72,341,1580745600"; d="scan'208";a="243063513" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 04 Apr 2020 07:01:08 +0800 IronPort-SDR: Rf/Ksv3QV85xLtqPe488XvEZ/wNyTzz+aBz2Socxi2XdgokpBoI1PsaqOUORSSEchrUMjEiiwK Ao7XjR52FVOeOTSRnXWAAF4D1KT0yUBET8OL4yEVKHmM+5JmYwSfCuIdjJdtWVI3gaGo4v9HBT Xm6LCCSIBCq8PkY3YULDmGf6GOpSxcS9Gnfw4QlDVAytEQA4MvttClACAHMvFqZ74tG0Kh0Xyj mnkIh9ZG62mnvPDy1VZhzlwM25oIzLT9ZpwFv1RGVAeE1EdaL+ozgTfbF31xYI0+VU9+u1sg7g fvsX+v7MOPZv4K1PDHqtfTEl Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2020 15:52:30 -0700 IronPort-SDR: aMfcRVa5qXmFzhB0aGwReNEJVMhamWhgLu1cOoSLRB8fKYho2taALB1ZVqRe4lVhgZXM0u8E5n jRxeiUpOmZFNjmkUmdbs3xmwX9R4U063/YJ9fqBxNY1sRvqMXFjd7CkmL1qmRLBaQS0qGF9N4o ZY3uOMWszLsBGkugv4XPBOtTO4To5+GGsDAUernhyVKmysfhxIu1srLR9v73sqbmJzRSn2+6Zu UOOkLJaayG131IVOw/jcwENgOTqHyv+msfPanQ2moMsU5vaotdHHZ0Q2Ek0Gz8rpC16nHH1H6L Vro= WDCIronportException: Internal Received: from unknown (HELO redsun52) ([10.149.66.28]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2020 16:01:07 -0700 Date: Sat, 4 Apr 2020 00:01:04 +0100 (BST) From: "Maciej W. Rozycki" To: gcc-patches@gcc.gnu.org cc: Jeff Law , Mike Stump , Chung-Lin Tang , Ian Lance Taylor , libffi-discuss@sourceware.org Subject: [PATCH v4 GCC 2/5] libffi/test: Fix compilation for build sysroot In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libffi-discuss@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libffi-discuss mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2020 23:01:11 -0000 Fix a problem with the libffi testsuite using a method to determine the compiler to use resulting in the tool being different from one the library has been built with, and causing a catastrophic failure from the inability to actually choose any compiler at all in a cross-compilation configuration. Address this problem by providing a DejaGNU configuration file defining the compiler to use, via the CC_FOR_TARGET TCL variable, set from $CC by autoconf, which will have all the required options set for the target compiler to build executables in the environment configured, removing failures like: FAIL: libffi.call/closure_fn0.c -W -Wall -Wno-psabi -O0 (test for excess errors) Excess errors: default_target_compile: No compiler to compile with UNRESOLVED: libffi.call/closure_fn0.c -W -Wall -Wno-psabi -O0 compilation failed to produce executable and bringing overall test results for the `riscv64-linux-gnu' target (here with the `x86_64-linux-gnu' host and RISC-V QEMU in the Linux user emulation mode as the target board) from: === libffi Summary === # of unexpected failures 708 # of unresolved testcases 708 # of unsupported tests 30 to: === libffi Summary === # of expected passes 1934 # of unsupported tests 28 libffi/ * configure.ac: Add testsuite/local.exp to output files. * configure: Regenerate. * testsuite/local.exp.in: New file. * testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New variable. * testsuite/Makefile.in: Regenerate. --- This is a backport of upstream libffi change as recorded here: . New change in v4. --- libffi/configure | 3 ++- libffi/configure.ac | 2 +- libffi/testsuite/Makefile.am | 2 ++ libffi/testsuite/Makefile.in | 5 ++++- libffi/testsuite/local.exp.in | 2 ++ 5 files changed, 11 insertions(+), 3 deletions(-) gcc-test-libffi-cc-for-target-template.diff Index: gcc/libffi/configure =================================================================== --- gcc.orig/libffi/configure +++ gcc/libffi/configure @@ -16662,7 +16662,7 @@ ac_config_commands="$ac_config_commands ac_config_links="$ac_config_links include/ffitarget.h:src/$TARGETDIR/ffitarget.h" -ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc" +ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile testsuite/local.exp man/Makefile libffi.pc" cat >confcache <<\_ACEOF @@ -17829,6 +17829,7 @@ do "include/ffi.h") CONFIG_FILES="$CONFIG_FILES include/ffi.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; + "testsuite/local.exp") CONFIG_FILES="$CONFIG_FILES testsuite/local.exp" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;; Index: gcc/libffi/configure.ac =================================================================== --- gcc.orig/libffi/configure.ac +++ gcc/libffi/configure.ac @@ -377,6 +377,6 @@ test -d src/$TARGETDIR || mkdir src/$TAR AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h) -AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc) +AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile testsuite/local.exp man/Makefile libffi.pc) AC_OUTPUT Index: gcc/libffi/testsuite/Makefile.am =================================================================== --- gcc.orig/libffi/testsuite/Makefile.am +++ gcc/libffi/testsuite/Makefile.am @@ -13,6 +13,8 @@ RUNTEST = `if [ -f $(top_srcdir)/../deja AM_RUNTESTFLAGS = +EXTRA_DEJAGNU_SITE_CONFIG = local.exp + CLEANFILES = *.exe core* *.log *.sum EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \ Index: gcc/libffi/testsuite/Makefile.in =================================================================== --- gcc.orig/libffi/testsuite/Makefile.in +++ gcc/libffi/testsuite/Makefile.in @@ -106,7 +106,7 @@ am__configure_deps = $(am__aclocal_m4_de DIST_COMMON = $(srcdir)/Makefile.am mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = $(top_builddir)/fficonfig.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = local.exp CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -279,6 +279,7 @@ RUNTEST = `if [ -f $(top_srcdir)/../deja echo $(top_srcdir)/../dejagnu/runtest ; \ else echo runtest; fi` +EXTRA_DEJAGNU_SITE_CONFIG = local.exp CLEANFILES = *.exe core* *.log *.sum EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \ libffi.call/cls_align_longdouble_split.c \ @@ -390,6 +391,8 @@ $(top_srcdir)/configure: @MAINTAINER_MOD $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +local.exp: $(top_builddir)/config.status $(srcdir)/local.exp.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo Index: gcc/libffi/testsuite/local.exp.in =================================================================== --- /dev/null +++ gcc/libffi/testsuite/local.exp.in @@ -0,0 +1,2 @@ +set CC_FOR_TARGET "@CC@" +set CXX_FOR_TARGET "@CXX@"