From patchwork Thu Feb 13 23:36:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 1237810 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-519518-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=wMLUeojB; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=q7buxMMX; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48JXwY6FyQz9s29 for ; Fri, 14 Feb 2020 10:37:01 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; q=dns; s=default; b=dWBn32vlrvjIXGKl 7JSgwKtQ4djIvz0KFjdsWqnI9+zToGm5lB0Wylu6jvAkuB8G4V9Men96J1wwpZ45 fHxqvPIq+Zcld49JW6PPRtJUAi0jbQKxNG7tpHy1coOAnbQfBn1i+hnHbbttDpGb xwISkN6MymHkQu/9zjqrFBIkXoE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; s=default; bh=s9n26Q0h3WT2BbRZtBF0kQ WDuNc=; b=wMLUeojBar/85IgKL8Ol+Dx6AmsMTubVsyl1vRLGMGRqrNFyLy4FBf 0tSyUYMalucmhmdaHjo+7s82DjY5r/6ab3CF4B/lk4IrTxCh+6S4t4rwIoBEUXCw t7LReLvcqH9E/EWLS3JAcKLUYAPFjXJNeVKrZoEPoj1korQa+VIBU= Received: (qmail 117730 invoked by alias); 13 Feb 2020 23:36:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 117722 invoked by uid 89); 13 Feb 2020 23:36:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS autolearn=ham version=3.3.1 spammy=tool_executable, ar, AR, sk:TOOL_E X-HELO: esa3.hgst.iphmx.com Received: from esa3.hgst.iphmx.com (HELO esa3.hgst.iphmx.com) (216.71.153.141) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Feb 2020 23:36:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1581637013; x=1613173013; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=v1cPKtQ/7vJi1s7uRcniASJXEbRZrfcbLhlJNEWZGwg=; b=q7buxMMXC0Wx3rhemGg0YmXWNu8VZcxsVQQVixXbFkohM1W8Vi8nsttl xx81hWo30Tmfa7/GiSNlhWgdmWAFrutx1lckA6ds8qXASPxgaoWUSzg26 1MsM2h+JQ1J8v6DVkU+nZFBvtK4gytrii5Iw38CCYMNVRXOlaf4sXVJ3h 7lGhDT+GEkYj5riBdqHroAh3usdlIXU5aV2TDowhWIrqthv8wO3lSBxQ4 6+ZokAmlnRp5RYIsbsAopBknJa56TigVelyTu3CPLvZo5IdSMHQ399Nsy BL4MC5tXIyxSOarOe/O+5pkZB3cbQSG3ajb3YF62hv4HIOxc0skb1i6dL g==; IronPort-SDR: DRO0mG3fDqQyx/RYiczNDi8w90I6a4lqJtpqxx7oy4xYZr1R7bUPHBloED9lTBGKfO7DF8myVz EezLyyauTHZvp3Sm+9ly2uAmHawtf6wLlkV1L6VNslJGrYGg45tvd4r5H+2oBx7c9kmPKz99bZ DVzYhvwKmS8UK1unv6r+WmZXHiIPOi2CDd4nfpCRONinD8a+YYRggCucWyQQY1MMzi5JqMo9T4 tT/XxfRU7o6hsYxlyuPeznMv9KaSCg8rad6xZH+MTeQAjtfzDtsTt6iTNj8pudoR2rAdagNAMI gMM= 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; 14 Feb 2020 07:36:51 +0800 IronPort-SDR: f6/B4+qyk7pHtUCztsB/1mGsLr+RPj8P3cz2QB7vqSncIQrklXpB91Mh8cL8ChyYWyT6DTVa98 vZTa0bjwtaOJZdnPcdW4YDquxJxkPStAEMzbmwwWdQbHMmx+PvqBHEtlQltJQasyAQB8f59W7W 9WvTVj/0pUGXjtJJLp/YSZ1GLCrOJlXJA1jVPtYPiV5hikxARYL7PMMoXstB2Yjvn1/fK40ZrR rZa4SAWU1YBiofhkxAgGNDO487oZHBnNoloxpcMqMaX26u4A/VaZtvCWfdT2wE2lYRn0lmOPz0 8uc2GXTYxppwqt/NqJ/bETyN 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; 13 Feb 2020 15:29:37 -0800 IronPort-SDR: sla2eVhtCvH1UY04ean5KO/BZzYtpRBNxP/TbZ975fDjWlWtoSn9qZ3hMMsVsfly+IB51E8fij OvDFKfYPbWS17xpC7VcNoZrMnU1icAluagTPKbYAy7TecQ1QNJoQJ5uZaD2kMX1kaDOZet/fM9 93x/WtuoF6aVzUqvr8N+5vKb8YRNMhh5H+JI0YVWQYlbteUHIO4hYwA2BgiBGAOcnRdak159al yzX4qXlQOp3HP3YS5jVcITxpAqAHKKQLSvbdn8T57qRvgHNTsMUv07DMy/Nxat+BXqO+g1xhAR ScA= 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; 13 Feb 2020 15:36:48 -0800 Date: Thu, 13 Feb 2020 23:36:46 +0000 (GMT) From: "Maciej W. Rozycki" To: gcc-patches@gcc.gnu.org cc: Julian Brown , Tobias Burnus , Jeff Law , Thomas Schwinge , Mike Stump , Chung-Lin Tang , Ian Lance Taylor Subject: [PATCH v2 2/4] 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 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 passing the `--tool_exec' option to `runtest' via $(AM_RUNTESTFLAGS) with $(CC) as the argument, 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 For consistency with other top-level target libraries also respect the GCC_UNDER_TEST TCL variable, which can be set e.g. with an argument to `runtest' in a standalone run. Finally remove an unused TOOL_OPTIONS TCL variable instance. libffi/ * testsuite/Makefile.am (AM_RUNTESTFLAGS): Add `--tool_exec' option. * testsuite/Makefile.in: Regenerate. * testsuite/lib/libffi.exp (libffi-init): Handle GCC_UNDER_TEST and TOOL_EXECUTABLE. (libffi_target_compile): Use GCC_UNDER_TEST. --- Changes from v1: - Remove testsuite/libffi-test-support.exp.in and the associated changes. - Pass $(CC) via `--tool_exec' in $(AM_RUNTESTFLAGS). --- libffi/testsuite/Makefile.am | 2 +- libffi/testsuite/Makefile.in | 2 +- libffi/testsuite/lib/libffi.exp | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) gcc-test-libffi-runtestflags-tool-exec.diff Index: gcc/libffi/testsuite/Makefile.am =================================================================== --- gcc.orig/libffi/testsuite/Makefile.am +++ gcc/libffi/testsuite/Makefile.am @@ -11,7 +11,7 @@ RUNTEST = `if [ -f $(top_srcdir)/../deja echo $(top_srcdir)/../dejagnu/runtest ; \ else echo runtest; fi` -AM_RUNTESTFLAGS = +AM_RUNTESTFLAGS = --tool_exec "$(CC)" CLEANFILES = *.exe core* *.log *.sum Index: gcc/libffi/testsuite/Makefile.in =================================================================== --- gcc.orig/libffi/testsuite/Makefile.in +++ gcc/libffi/testsuite/Makefile.in @@ -134,7 +134,7 @@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LTLDFLAGS = @AM_LTLDFLAGS@ -AM_RUNTESTFLAGS = +AM_RUNTESTFLAGS = --tool_exec "$(CC)" AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ Index: gcc/libffi/testsuite/lib/libffi.exp =================================================================== --- gcc.orig/libffi/testsuite/lib/libffi.exp +++ gcc/libffi/testsuite/lib/libffi.exp @@ -99,7 +99,8 @@ proc libffi-init { args } { global blddirffi global objdir global blddircxx - global TOOL_OPTIONS + global TOOL_EXECUTABLE + global GCC_UNDER_TEST global tool global libffi_include global libffi_link_flags @@ -123,7 +124,15 @@ proc libffi-init { args } { set ld_library_path "." append ld_library_path ":${gccdir}" - set compiler "${gccdir}/xgcc" + if ![info exists GCC_UNDER_TEST] then { + if [info exists TOOL_EXECUTABLE] { + set GCC_UNDER_TEST $TOOL_EXECUTABLE + } else { + set GCC_UNDER_TEST "[find_gcc]" + } + } + + set compiler [lindex $GCC_UNDER_TEST 0] if { [is_remote host] == 0 && [which $compiler] != 0 } { foreach i "[exec $compiler --print-multi-lib]" { set mldir "" @@ -175,11 +184,14 @@ proc libffi_target_compile { source dest global srcdir global blddirffi global TOOL_OPTIONS + global GCC_UNDER_TEST global libffi_link_flags global libffi_include global target_triplet + lappend options "compiler=$GCC_UNDER_TEST" + if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } { lappend options "libs=${gluefile}" lappend options "ldflags=$wrap_flags"