From patchwork Tue Sep 12 09:35:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 138062 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp284683vqx; Tue, 12 Sep 2023 02:36:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMUx5QGfqQULaKpIB16GX35mx1p7i6jUjA5TQMWrkLXDO9d1qTd4yQbdeFs82yrzKqEOri X-Received: by 2002:a17:907:2c67:b0:9a1:cdf1:ba3 with SMTP id ib7-20020a1709072c6700b009a1cdf10ba3mr9285866ejc.27.1694511412616; Tue, 12 Sep 2023 02:36:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694511412; cv=none; d=google.com; s=arc-20160816; b=NCHiAzkOB1Dc20BG5MAANea5woFlgnCosfidKkwrogg4VSsPgCTHAm556Fts0wZteO RSzG/u7OB4riOoyBkNrIPn5TK0QpHInkuopEbMFpNa3fw6dCqcAWEbeYnAN8kRA39bKG i0Eaff8727bnILIKMsVRhVEFV7rxFV/rg+esyDCUuIeAe2OjXeZ+AvtdE59VzQxbbFt1 0157B9F0TuPjf/934FwhnIU9or7IYlJZHWgWSWrZCjy//CjnaHYRqls/AsSzojjz2wiE EryPJFRJH4eX9PExkSx3FSnSs+BlBb+01wfq6Ja+GlIpPyxLw2z4+unLgAPbWF8StS5L I91A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from:ironport-sdr :dmarc-filter:delivered-to; bh=ktFZP/xLAvWEOSL34+HTRm7FKgZya8Svkk+mnuoHm34=; fh=ZUt8kT3LWJKlEMSs8NPKcNA0kh71GpE4vdzHiLZ2L/Y=; b=f7gZYzdUQwoGooq+PO5Id44BPfwwm/z0ieYMTfTsSobqma6enHj/7MSEXF3At04nW6 sVwO/lpHnsE1Q2RumolaLa5OVQMifwLg+B/zOFu2YX9v0ekDCVi4l6h8St/FHOBKc/9I Uukvmi5oavpX5xEsNbHBzRUmaC9MHQcNJQmInYwLrZ5EZJ78cr70CfJCuLq56V+kkJx3 CJK2sMNo+JphxOheXo7SC1XdcOtldpmF5Zr4Wuox8H/1iWPEqKjiOfu0m/EIYL6dZ3gB rSJGLbfIaTwT0/1oYF4E04oFbRZI7id8AFacMW3Hpcuw/hSbeqx+YSX5w7JR1NeiFSWG 8KQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id n18-20020a170906841200b0099d959f952asi8100005ejx.26.2023.09.12.02.36.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 02:36:52 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 37B37385C414 for ; Tue, 12 Sep 2023 09:36:08 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 44321385703F for ; Tue, 12 Sep 2023 09:35:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 44321385703F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-CSE-ConnectionGUID: tYtjwwHPTeWwL3xjrmVSKA== X-CSE-MsgGUID: hurECogzQbqJ7jO2Qq1/lQ== X-IronPort-AV: E=Sophos;i="6.02,245,1688457600"; d="scan'208,223";a="16692168" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 12 Sep 2023 01:35:40 -0800 IronPort-SDR: 1PCVGfZ0dxUDzKiMEIOUdGP41FXNnbe/f/P1CO2tmwpa6AKaABvlp3OuhKG5vsGUQrwp4McX1i Q9G1PW4Q1a568SIWm+t9VYwoO5CZYjR+SCj/MxYIFONLjGSsCati0L76gF+fGYWQ5VQPuwPHFa rWVewVDw+ySOPo113yOdkGKsUPtBD2sPSZ9qQDgkxe7zl++H8LPUkskmPgfIOHd6PP+bUB+sGY GWni0KB703oWYi4i5goLI2wpX9rP4Rnnx0cSBe12jaOTBbJ0mOvJUqQRY40eLe3ru2tlWEHx1p 4Yo= From: Thomas Schwinge To: Subject: Pass 'SYSROOT_CFLAGS_FOR_TARGET' down to target libraries [PR109951] (was: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]) In-Reply-To: <875y868a4b.fsf@euler.schwinge.homeip.net> References: <6594B30D-743B-4B4C-81CE-11DD3EE87C8C@comcast.net> <20200103113421.51b55ff5@squid.athome> <875y868a4b.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: Tue, 12 Sep 2023 11:35:33 +0200 Message-ID: <875y4fzqca.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham 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: , Cc: Iain Sandoe , Julian Brown , "Maciej W. Rozycki" Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776823999004560271 X-GMAIL-MSGID: 1776823999004560271 Hi! On 2023-06-02T11:52:04+0200, I wrote: > On 2020-01-14T21:31:13+0800, Chung-Lin Tang wrote: >> I understand your situation with --with-build-sysroot/--without-sysroot, [...] >> >> Can you test if the attached patch works for you? The patch exports the build sysroot >> setting from the toplevel to target library subdirs, and adds the --sysroot= option >> when doing build-tree testing [...] > > Belatedly: thanks, I like that approach better indeed. > > This is, by the way, in line with what GCC compiler testing is doing; > 'gcc/Makefile.in': > > # Set if the compiler was configured with --with-build-sysroot. > SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ > > # TEST_ALWAYS_FLAGS are flags that should be passed to every compilation. > # They are passed first to allow individual tests to override them. > @echo "set TEST_ALWAYS_FLAGS \"$(SYSROOT_CFLAGS_FOR_TARGET)\"" >> ./site.tmp > > That is, via 'site.exp', put 'SYSROOT_CFLAGS_FOR_TARGET' into > 'TEST_ALWAYS_FLAGS', which is "passed to every compilation". > >> [...], if this does work, then other library testsuites (e.g. libatomic.exp) might >> also need considering updating, I think. > > Correct. (I'm offering to take care of that.) First, regarding the top-level build system part: >> 2020-01-14 Chung-Lin Tang >> >> * Makefile.tpl (NORMAL_TARGET_EXPORTS): Add export of >> SYSROOT_CFLAGS_FOR_TARGET variable. >> * Makefile.in: Regenerate. >> --- Makefile.tpl (revision 279954) >> +++ Makefile.tpl (working copy) >> @@ -322,6 +322,7 @@ RAW_CXX_TARGET_EXPORTS = \ >> >> NORMAL_TARGET_EXPORTS = \ >> $(BASE_TARGET_EXPORTS) \ >> + SYSROOT_CFLAGS_FOR_TARGET="$(SYSROOT_CFLAGS_FOR_TARGET)"; export SYSROOT_CFLAGS_FOR_TARGET; \ >> CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; > > With that one moved into the generic 'BASE_TARGET_EXPORTS', [...] Pushed to master branch commit d1bff1ba4d470f6723be83c0e3c4d5083e51877a "Pass 'SYSROOT_CFLAGS_FOR_TARGET' down to target libraries [PR109951]", see attached. 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 d1bff1ba4d470f6723be83c0e3c4d5083e51877a Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 1 Jun 2023 23:07:37 +0200 Subject: [PATCH] Pass 'SYSROOT_CFLAGS_FOR_TARGET' down to target libraries [PR109951] ..., where we need to use it (separate commits) for build-tree testing, similar to 'gcc/Makefile.in:site.exp': # TEST_ALWAYS_FLAGS are flags that should be passed to every compilation. # They are passed first to allow individual tests to override them. @echo "set TEST_ALWAYS_FLAGS \"$(SYSROOT_CFLAGS_FOR_TARGET)\"" >> ./site.tmp PR testsuite/109951 * Makefile.tpl (BASE_TARGET_EXPORTS): Add 'SYSROOT_CFLAGS_FOR_TARGET'. * Makefile.in: Regenerate. Co-authored-by: Chung-Lin Tang --- Makefile.in | 1 + Makefile.tpl | 1 + 2 files changed, 2 insertions(+) diff --git a/Makefile.in b/Makefile.in index c97130a2338..2f136839c35 100644 --- a/Makefile.in +++ b/Makefile.in @@ -321,6 +321,7 @@ BASE_TARGET_EXPORTS = \ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ READELF="$(READELF_FOR_TARGET)"; export READELF; \ STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \ + SYSROOT_CFLAGS_FOR_TARGET="$(SYSROOT_CFLAGS_FOR_TARGET)"; export SYSROOT_CFLAGS_FOR_TARGET; \ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \ @if gcc-bootstrap diff --git a/Makefile.tpl b/Makefile.tpl index 36fa20950d4..5872dd03f2c 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -324,6 +324,7 @@ BASE_TARGET_EXPORTS = \ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ READELF="$(READELF_FOR_TARGET)"; export READELF; \ STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \ + SYSROOT_CFLAGS_FOR_TARGET="$(SYSROOT_CFLAGS_FOR_TARGET)"; export SYSROOT_CFLAGS_FOR_TARGET; \ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \ @if gcc-bootstrap -- 2.34.1