From patchwork Wed Oct 25 08:32:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 157924 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2449680vqx; Wed, 25 Oct 2023 01:33:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEOPziEu+1lFm5C0tqvdFT0+sUO5MDpb41HHCXIfV7z1E58q/rpojMEeQ2vRrBPQwfwcV4Y X-Received: by 2002:ac8:4e43:0:b0:417:b55d:dfa0 with SMTP id e3-20020ac84e43000000b00417b55ddfa0mr15709801qtw.0.1698222815086; Wed, 25 Oct 2023 01:33:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698222815; cv=pass; d=google.com; s=arc-20160816; b=sLqZn6U7XGhsUxOxWK8hpqMRLwbrOMtY4s6oPf9KanBMxrbVBqfZYaMGN92GC69xkC yx6Rr4YsIynfc9bc47DKVG9Vsn1L/hHFJ0By9zrYjvYb3nftUsxFbXd8esfG/8rNMqOn XiSIoLFx7G1Ol4VTqCTWo+uamBTtqkSII+DwAH0W6XKVqaDWKf7D1Y5Hw++itGzEleyk Wu+mB6+4sYmJGmhH2ZVLuPK7WTJk855DvtLPhwfGAjwxElt7wwpO2zTh6mFfWdZOdRLw FvRBM/GFWv3LlOdOEX6ByaYoI0wbBddVsg9SZ+DbldnkRo498CdSLnh3XlttD3cEmt7+ jBVQ== 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=fTw1o2qb52QTv4LZXlWWEHUs9ita/8+bw4Nx9tInxHA=; fh=tGr4cXZnUPao3QPGo+BrBMZn/XIPo21zWc9w89Z4WzA=; b=iykvzsNhBrCTquWN0XtPI760C61UynhS4BZ/bkFkESMoraoa4e3AtaicMIvSaq60+X cKlsL5yR8QDC/kq0+aNqSNe/B7W9j0XMvQiCwnIMReYm3GIYTtHP0hJLpK2TDPQiP5hX QVfMT7psqXppFpOw8cH3vwDXbd2yOKxe/p8BVek+ufArjoJMZPi73zBf4WI7eJWcAoFb rsCCneMIEdvvwUiE/tv4cdR/ODcy5ZyPZwLq60H8TPIHF5INWe1t1IGNLzBEtAnZ0eDn RiTDRWSsQNx7FXyug1YBY4U7HJNnAYTqNElJy+LEgjTCFXenM9dzhwgxK1uKaw0TuUZi rH8A== 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 v36-20020a05622a18a400b0040fe864c812si8286517qtc.10.2023.10.25.01.33.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 01:33:35 -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 D6D9F3857725 for ; Wed, 25 Oct 2023 08:33:34 +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 AF69C3857C41 for ; Wed, 25 Oct 2023 08:33:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF69C3857C41 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 AF69C3857C41 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=1698222788; cv=none; b=Hf7azJ4+NN9EDCQw+B5oNg4sBaQK17SXG3K4WxpPU4UAkizTCSJd+Co7vh1YoiquE6kutGFOIfRkYBcstQOV1R2Hj/BuFVrwESlLJ0DQbLTfVKIs8VkO2jynlu2ItCT74+bjTEYtF7b/9ZyZ695g1EVzYVwsCcj/ywA32QMoqjw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698222788; c=relaxed/simple; bh=fQw412Z+zcB5qSdCui8J5C6BlMsG+qhggmQTiQyLoaU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=iPZz3pO2uudtsOQCf0nIR9R4f+ANFWG8QUAbbpFqSWseNKyR9WpAMLbPKZXKo+miISACi8R8corbBwJdvbIjKBJ7p3MTB7riw/LOdSJP8zF4w+L44VzHBzAKiDAOn/R20AxClrK13VdhF/fY+uBAHeM03HtT0ismCJr6XiwdUCs= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: WQy2ReOVTViuP8lcsR1Mqw== X-CSE-MsgGUID: n7gV/LD0QeWefNl8XSKT4w== X-IronPort-AV: E=Sophos;i="6.03,250,1694764800"; d="scan'208,223";a="20685364" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 25 Oct 2023 00:33:05 -0800 IronPort-SDR: 1i5NowMx8SzI/EvKgom+D/ZwD3oQ9tKjt1tYeJjP05pSWW2Bpw63lvXjY0ja4GVbMQ7sa8Ob8w qLjbiwgqhJDXVl7GkPWGAbwcds0QP50JSTGN/sbMndCxGMet4flwzFL6ruHBf6P1O24n7QEbs3 O3mqMU42gzjXP/MiAgboeTZXeBMfM+lVxCKNCvir9FnaU+FllE0tRWcAEtwkFQp6Kiv8kFFXex bww6lovBysZAoRLkLaZUGjnLEJnqYQ4ZvgggPBzVyG/s3KSijYJ5q/Jk3hYpeBFvK6VsLEqDhB WHQ= From: Thomas Schwinge To: CC: Iain Sandoe , Rainer Orth , Mike Stump , "Maciej W. Rozycki" Subject: [PING] libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] (was: [PATCH v4 1/5] libatomic/test: Fix compilation for build sysroot) In-Reply-To: <87y1hby7pb.fsf@euler.schwinge.homeip.net> References: <87y1hby7pb.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:32:58 +0200 Message-ID: <87v8avw18l.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776829498616962016 X-GMAIL-MSGID: 1780715686278659984 Hi! Ping. Grüße Thomas On 2023-09-12T13:03:28+0200, I wrote: > Hi! > > On 2020-04-04T00:00:44+0100, "Maciej W. Rozycki via Gcc-patches" wrote: >> Fix a problem with the libatomic 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 >> lack of a suitable `--sysroot=' option where the `--with-build-sysroot=' >> configuration option has been used to build the compiler resulting in >> the inability to link executables. >> >> Address this problem by providing a DejaGNU configuration file defining >> the compiler to use, via the GCC_UNDER_TEST 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 libatomic 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 > "libatomic: 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 584bfb74e802b94c490b963bd05ed520b5c6e453 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 11 Sep 2023 11:36:31 +0200 Subject: [PATCH] libatomic: 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 5ff06d762a88077aff0fb637c931c64e6f47f93d "libatomic/test: Fix compilation for build sysroot" done differently, avoiding build-tree testing use of any random gunk that may appear in build-time 'CC'. PR testsuite/109951 libatomic/ * configure.ac: 'AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)'. * Makefile.in: Regenerate. * configure: Likewise. * testsuite/Makefile.in: Likewise. * testsuite/lib/libatomic.exp (libatomic_init): If '--with-build-sysroot=[...]' was specified, use it for build-tree testing. * testsuite/libatomic-site-extra.exp.in (GCC_UNDER_TEST): Don't set. (SYSROOT_CFLAGS_FOR_TARGET): Set. --- libatomic/Makefile.in | 1 + libatomic/configure | 7 +++++-- libatomic/configure.ac | 2 ++ libatomic/testsuite/Makefile.in | 1 + libatomic/testsuite/lib/libatomic.exp | 5 +++++ libatomic/testsuite/libatomic-site-extra.exp.in | 2 +- 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in index 83efe7d2694..2d2d64ee947 100644 --- a/libatomic/Makefile.in +++ b/libatomic/Makefile.in @@ -328,6 +328,7 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZES = @SIZES@ STRIP = @STRIP@ +SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ VERSION = @VERSION@ XCFLAGS = @XCFLAGS@ XLDFLAGS = @XLDFLAGS@ diff --git a/libatomic/configure b/libatomic/configure index 57f320753e1..629ad22e833 100755 --- a/libatomic/configure +++ b/libatomic/configure @@ -656,6 +656,7 @@ LIBAT_BUILD_VERSIONED_SHLIB_FALSE LIBAT_BUILD_VERSIONED_SHLIB_TRUE OPT_LDFLAGS SECTION_LDFLAGS +SYSROOT_CFLAGS_FOR_TARGET enable_aarch64_lse libtool_VERSION MAINT @@ -11402,7 +11403,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11405 "configure" +#line 11406 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11508,7 +11509,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11511 "configure" +#line 11512 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11866,6 +11867,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ;; esac + + # Get target configury. . ${srcdir}/configure.tgt if test -n "$UNSUPPORTED"; then diff --git a/libatomic/configure.ac b/libatomic/configure.ac index 318b605a1d7..4beff2d681f 100644 --- a/libatomic/configure.ac +++ b/libatomic/configure.ac @@ -170,6 +170,8 @@ case "$target" in ;; esac +AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET) + # Get target configury. . ${srcdir}/configure.tgt if test -n "$UNSUPPORTED"; then diff --git a/libatomic/testsuite/Makefile.in b/libatomic/testsuite/Makefile.in index b874ac527a9..247268f1949 100644 --- a/libatomic/testsuite/Makefile.in +++ b/libatomic/testsuite/Makefile.in @@ -198,6 +198,7 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZES = @SIZES@ STRIP = @STRIP@ +SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ VERSION = @VERSION@ XCFLAGS = @XCFLAGS@ XLDFLAGS = @XLDFLAGS@ diff --git a/libatomic/testsuite/lib/libatomic.exp b/libatomic/testsuite/lib/libatomic.exp index 10f38475bc8..43b54212d90 100644 --- a/libatomic/testsuite/lib/libatomic.exp +++ b/libatomic/testsuite/lib/libatomic.exp @@ -146,6 +146,11 @@ proc libatomic_init { args } { set ALWAYS_CFLAGS "" if { $blddir != "" } { + # If '--with-build-sysroot=[...]' was specified, use it for build-tree + # testing. + global SYSROOT_CFLAGS_FOR_TARGET + lappend ALWAYS_CFLAGS "additional_flags=${SYSROOT_CFLAGS_FOR_TARGET}" + lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/" lappend ALWAYS_CFLAGS "additional_flags=-I${blddir}" lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs" diff --git a/libatomic/testsuite/libatomic-site-extra.exp.in b/libatomic/testsuite/libatomic-site-extra.exp.in index c0d26660bad..5c81b7750bb 100644 --- a/libatomic/testsuite/libatomic-site-extra.exp.in +++ b/libatomic/testsuite/libatomic-site-extra.exp.in @@ -1 +1 @@ -set GCC_UNDER_TEST {@CC@} +set SYSROOT_CFLAGS_FOR_TARGET {@SYSROOT_CFLAGS_FOR_TARGET@} -- 2.34.1