From patchwork Wed Oct 25 08:30:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 157923 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2448609vqx; Wed, 25 Oct 2023 01:31:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHkZH1B8B81MxWsT/Adr8e4+dBQjfuFTM3aqD0+p6RAPuaGPCE5MumhXdAQFmGafkRVQ800 X-Received: by 2002:a05:620a:628f:b0:76c:ba25:a8f1 with SMTP id ov15-20020a05620a628f00b0076cba25a8f1mr15945436qkn.42.1698222678716; Wed, 25 Oct 2023 01:31:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698222678; cv=pass; d=google.com; s=arc-20160816; b=1JKMMpG+4fFBU1DTixoRQAYuExqXZR5BQ1hHw6eYiDSG255WwcWyME6y8JnkZVDfIe Fnl3FDp9Pv40icl2L7meH6vcLpIlR9JT6Ur+w6ntBqwy+gSbwVShLjF2H7RDmWpifaBx 6OnaDQnGYdJl3GvJkdSsAnn5XFyyXG2BzpacUm/1idxd7zsndAvxYLjA39I4b5mR+uwi KPN4bVNHVAHvSEd4WSMn30j00eJYKsVflr3IepZgEuvIShkB2cO8klVhCh+tVREaipSj 2V2pemn4isCukNlLxR+4rXzfPGBIERLU9fhYH4ShCQwNFF3531QrnVaO+tWOeEYN22xd xY6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:message-id:date :user-agent:references:in-reply-to:subject:cc:to:from:ironport-sdr :arc-filter:dmarc-filter:delivered-to; bh=ZOk5Rn5CX5hiWLNAoBZYSsKe+N5h9YieB/qxlcG6Mf4=; fh=3hcU/XpHrm7MbKlbgIbuCT4NK/mjHVErUt+3wUJsVLY=; b=a6KKMsGUrWP2EIxZ4hB5d0+iGs9xSW7cg26hSzYdLI/0Lu6t8s2zZKQ5/aw4pR0vta iTbKXg73sekWRp+AaUjVBpLs+ojHsCpakUxSGOcjD/UfRUNx5nBhGat0NfFs3Rt1CpVh BIlf7DcMiRlT84iAxg4+ql35kKjX/UsmSlM8fTaIGVxZ4+tsYu5HbNXtyH/yidOdrveN 7G5b6XowSmD/UhSWtrvtq+lhx/cIHBWITKJUFGFc3qq/ALJXjCt+1bKllTVHxug876b3 TbwpY/dj4KEsopFnx0+OWo3owp/D25Ia5//niJCA4uvns1lBKiaIV13bhySn/F4ZPiUv Lifw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h14-20020a05620a21ce00b007683e40b4a1si7982305qka.517.2023.10.25.01.31.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 01:31:18 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7CD5838582BE for ; Wed, 25 Oct 2023 08:31:18 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 740EF3858C36 for ; Wed, 25 Oct 2023 08:30:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 740EF3858C36 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 740EF3858C36 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.137.252 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698222625; cv=none; b=Lix0KyphmE63c8oFA9sPKhGmEpWzTTAWI1tC3zVQqicImMGd0BC/BGDedrycFYvFTuT+Gz5Yp0ZpTuKGKhHEWGeGY0sYoMehVvw0/NQgFGOtHXpR0KSZd0pEd9rLNUCMOWq9t0eUsddJKzPIuDoQtdQlrkholxPB7qsTkN628B8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698222625; c=relaxed/simple; bh=C3RX/rUTBl+k5ftTv9oMco7H352/oCOusJgdVwEttno=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=pCtKQPrrRP8fp6t9yEFPHmGHFHx2taJabA+d/r+szI7P8xPMQTLBJDzOCG/OKA4vmmGgNSNlW2ZEsB44IN6rHXN0fpwmyrJsCs8D/gnQ8zxcLtFx0ZBcNBZijkbQ9hgfohovlwNDzgc7YI9ujucd+Vc5R7QgCEhE86CVYAW4YR8= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: 6uWtTljMQVWsfoz0p5uwgw== X-CSE-MsgGUID: VJvKyCyNRAuKxAfOlV0icg== X-IronPort-AV: E=Sophos;i="6.03,250,1694764800"; d="scan'208,223";a="20685192" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 25 Oct 2023 00:30:20 -0800 IronPort-SDR: XptJDaZx9L6T7J7+zhf3mpIVLlB5yzUF6YStf8uO3YdtRKquEwee3TApdu0lxBRucqFlEHay8K zxXb0uDW3oTHAiQ8kStPwYr8ZfqFX+KTZ/i4Fj0i8ir9LUym1+XUoQVHKyDbmzKjnimFz2GFTj elgxr9NEbCLGAbn1bKnAuzortoBOWSfdY4PSt1KlHS4YUsaYNXYV/DnkiWD7w6pAz+jtkcuQ3V cEizxF7o/M5KgLOT5xB360mAOM/wDJhsBj6Ap9IyAWDk4847FVXEeQWkjeT50mrRPqE7TnT9Hn hHQ= From: Thomas Schwinge To: CC: Iain Sandoe , , "Maciej W. Rozycki" Subject: [PING] libffi: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] (was: [PATCH v5 GCC] libffi/test: Fix compilation for build sysroot) In-Reply-To: <871qf3zmi4.fsf@euler.schwinge.homeip.net> References: <871qf3zmi4.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Wed, 25 Oct 2023 10:30:08 +0200 Message-ID: <87y1frw1db.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LOTSOFHASH, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776829208868802986 X-GMAIL-MSGID: 1780715543550972320 Hi! Ping. Grüße Thomas On 2023-09-12T12:58:27+0200, I wrote: > Hi! > > On 2020-04-20T14:18:40+0100, "Maciej W. Rozycki via Gcc-patches" wrote: >> 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. > > This has since, as far as I can tell, been resolved properly by H.J. Lu's > GCC commit 5be7b66998127286fada45e4f23bd8a2056d553e, > "libffi: Integrate build with GCC", and > GCC commit 4824ed41ba7cd63e60fd9f8769a58b79935a90d1 > "libffi: Integrate testsuite with GCC testsuite". > >> 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 > > As we've found, this is conceptually problematic, as discussed in > > "Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]". > I therefore suggest to apply to GCC libffi the conceptually same changes > as I've just pushed for libgomp: > > "libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951]". > OK to push the attached > "libffi: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]"? > > > Grüße > Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 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 <