From patchwork Fri May 12 07:26:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 92979 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4910691vqo; Fri, 12 May 2023 00:27:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ53ffuREQovf3Rd7sTZM8nWbAwV/O5Ta6WG5W5HpJOp+WYpjy1CRGTZTs6MdMjONB+aIS8k X-Received: by 2002:a17:907:86a7:b0:96a:42de:1cd5 with SMTP id qa39-20020a17090786a700b0096a42de1cd5mr7319180ejc.4.1683876435698; Fri, 12 May 2023 00:27:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683876435; cv=none; d=google.com; s=arc-20160816; b=GWOLYFsS2Vn8dhNhklBGnLqNQ8lU3T1//w/zuACR49iKA6r6ldBN2CpBuLrLD5klyA c567S2RQeoIlERSqd8DMo49Z8CZgDj+MydiuqAs9kgQetyA7uGF2U4DTCH4wYIK72ANZ bfTCsT4xiHE87er+HPmmdLT2ipnlFazJLyrgsrFRD5XJxG3CE+mPdP0IBlUZycjVEnLw n3kSXXxATOFMugNT1IBCQGbYlCa/sXVRhXTek1sUGCMr6PoLlMbg+EX3EsKAoHPOCqxC v4YMINXH/V8SDW+XlIb5ce2WCm4Cv0EQqknniu2nM/S12MOMwBHiOtYyH/TFBe1er8nE Pumg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender: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 :dmarc-filter:delivered-to; bh=mN1OZ/I3FLhhoap7pqjYZGWREDPXcO56J9oNk0bNnhs=; b=jHWaWwilgXJMMcFaVXCwcgzBchNC5hBAYwxtmHzwyNuDjY1ZVBJbGxMbu1Y0tnDYgO Ii+E3A9G6Bc9Y414loYFT7BPJk2IrIz9vkHJHzwGcC+Raf6O+qdUk/Z6Tq8ChXQIELx7 WZCJkUh0QWHvRaAAeQUETIkjckeujz+E3WeBNAAgEvQFn+RLlgtR1pKqet7LBti0Vcwz 6o0LdU5GqJ2ifs4DlG1tM2coudaZmbLqJR8MyHLE8QExlycIDPWX9psYk2HW63dXNRxB 2i6aGEPbuYsFRTGipamvugrWMQa0zLSTGFGKdYisFyTg1msNN8zsfYBfWTtrsx5iFb14 Kmhg== ARC-Authentication-Results: i=1; mx.google.com; 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 sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id tb9-20020a1709078b8900b009665a6bbd42si7277739ejc.528.2023.05.12.00.27.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 00:27:15 -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; 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 9D02C385558B for ; Fri, 12 May 2023 07:27:08 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id C48493858C54 for ; Fri, 12 May 2023 07:26:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C48493858C54 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-IronPort-AV: E=Sophos;i="5.99,269,1677571200"; d="scan'208,223";a="5654851" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 11 May 2023 23:26:39 -0800 IronPort-SDR: a4JAJaMEpXAoOiKBOFDG6V5a9yQWmm9Qv4LwRF/23/4e/jUr5UnZj8+xMIlMDxNH43nRu/7pZI detCk9PrOs6mzManuO42Af/Y32xzPPWYjiLLEyruY44uaCNT/Bs8W3UqUnF0WTBHgz6RRp3djQ tuDLvfcCkSGzyTuW2vu4/vP7JIC/2Zwa/QRgMh1N/f4IY+B5a03uy9UL522NNBlmYhuZrSdRz2 adijIIudrBTmkeGL9+IczIQE5+9C9EhuJexinWb02V+sboJdTI3fQjYlerM6s1T4tUK4IzdeDm dHc= From: Thomas Schwinge To: CC: Mike Stump , Jakub Jelinek , Tobias Burnus , Rainer Orth Subject: libgomp testsuite: Generalize 'lang_library_path' into a list of 'lang_library_paths' (was: libgomp testsuite: (not) using a specific driver for C++, Fortran?) In-Reply-To: References: <87h9z5wd1z.fsf@schwinge.name> <87y4rrrwnc.fsf@schwinge.name> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Fri, 12 May 2023 09:26:32 +0200 Message-ID: <87h6si9fiv.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.29 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 Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765672417243038780?= X-GMAIL-MSGID: =?utf-8?q?1765672417243038780?= Hi! On 2014-11-04T10:31:37-0800, Mike Stump wrote: > On Nov 4, 2014, at 4:13 AM, Thomas Schwinge wrote: >> On Wed, 15 Oct 2014 17:46:48 +0200, I wrote: >>> [...] >>> >>> Am I on the right track with the following? >> >> Nobody commented, which also means nobody disagreed > > :-) > >> OK to commit all that to trunk? > > Ok, thanks. Rebased, adjusted, retested another 2014 clean-up patch; pushed to master branch commit b794dc779382bb9e645ccc10b4447d4e411f6000 "libgomp testsuite: Generalize 'lang_library_path' into a list of 'lang_library_paths'" ("..., and use that for libquadmath, too"), 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 b794dc779382bb9e645ccc10b4447d4e411f6000 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Sun, 2 Nov 2014 17:49:31 +0100 Subject: [PATCH] libgomp testsuite: Generalize 'lang_library_path' into a list of 'lang_library_paths' ..., and use that for libquadmath, too. libgomp/ * testsuite/lib/libgomp.exp (libgomp_target_compile): Generalize 'lang_library_path' into a list of 'lang_library_paths'. * testsuite/libgomp.c++/c++.exp: Adjust. * testsuite/libgomp.oacc-c++/c++.exp: Likewise. * testsuite/libgomp.fortran/fortran.exp: Adjust. Use that for libquadmath, too. * testsuite/libgomp.oacc-fortran/fortran.exp: Likewise. --- libgomp/testsuite/lib/libgomp.exp | 14 ++++---- libgomp/testsuite/libgomp.c++/c++.exp | 14 ++++---- libgomp/testsuite/libgomp.fortran/fortran.exp | 33 +++++++++-------- libgomp/testsuite/libgomp.oacc-c++/c++.exp | 14 ++++---- .../libgomp.oacc-fortran/fortran.exp | 35 +++++++++++-------- 5 files changed, 63 insertions(+), 47 deletions(-) diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp index 2295fbbbd417..9fea31d80672 100644 --- a/libgomp/testsuite/lib/libgomp.exp +++ b/libgomp/testsuite/lib/libgomp.exp @@ -241,12 +241,14 @@ proc libgomp_target_compile { source dest type options } { lappend options "additional_flags=${lang_include_flags}" } - global lang_library_path - if { [info exists lang_library_path] } { - # Some targets use libgfortran.a%s in their specs, so they need - # a -B option for uninstalled testing. - lappend options "additional_flags=-B${blddir}/${lang_library_path}" - lappend options "ldflags=-L${blddir}/${lang_library_path}" + global lang_library_paths + if { [info exists lang_library_paths] } { + foreach lang_library_path $lang_library_paths { + # targets that use lib[...].a%s in their specs need a -B option + # for uninstalled testing. + lappend options "additional_flags=-B${blddir}/${lang_library_path}" + lappend options "ldflags=-L${blddir}/${lang_library_path}" + } } global lang_link_flags if { [info exists lang_link_flags] } { diff --git a/libgomp/testsuite/libgomp.c++/c++.exp b/libgomp/testsuite/libgomp.c++/c++.exp index 8307baf32fcf..1a1c3ee22252 100644 --- a/libgomp/testsuite/libgomp.c++/c++.exp +++ b/libgomp/testsuite/libgomp.c++/c++.exp @@ -2,14 +2,15 @@ load_lib libgomp-dg.exp load_gcc_lib gcc-dg.exp if { $blddir != "" } { - set lang_library_path "../libstdc++-v3/src/.libs" + set libstdc++_library_path "../libstdc++-v3/src/.libs" set shlib_ext [get_shlib_extension] - if { ![file exists "${blddir}/${lang_library_path}/libstdc++.a"] - && ![file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] } { + if { ![file exists "${blddir}/${libstdc++_library_path}/libstdc++.a"] + && ![file exists "${blddir}/${libstdc++_library_path}/libstdc++.${shlib_ext}"] } { verbose -log "No libstdc++ library found, will not execute c++ tests" - unset lang_library_path + unset libstdc++_library_path return } + lappend lang_library_paths ${libstdc++_library_path} } elseif { ![info exists GXX_UNDER_TEST] } { verbose -log "GXX_UNDER_TEST not defined, will not execute c++ tests" return @@ -39,7 +40,7 @@ set tests [lsort [concat \ set ld_library_path $always_ld_library_path if { $blddir != "" } { - append ld_library_path ":${blddir}/${lang_library_path}" + append ld_library_path ":${blddir}/${libstdc++_library_path}" } append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST] set_ld_library_path_env_vars @@ -62,7 +63,8 @@ if [info exists lang_include_flags] then { unset lang_include_flags } if { $blddir != "" } { - unset lang_library_path + unset libstdc++_library_path + unset lang_library_paths } unset lang_link_flags diff --git a/libgomp/testsuite/libgomp.fortran/fortran.exp b/libgomp/testsuite/libgomp.fortran/fortran.exp index d98739c8c99d..9295bbae65dd 100644 --- a/libgomp/testsuite/libgomp.fortran/fortran.exp +++ b/libgomp/testsuite/libgomp.fortran/fortran.exp @@ -3,14 +3,23 @@ load_gcc_lib gcc-dg.exp load_gcc_lib gfortran-dg.exp if { $blddir != "" } { - set lang_library_path "../libgfortran/.libs" + set libgfortran_library_path "../libgfortran/.libs" set shlib_ext [get_shlib_extension] - if { ![file exists "${blddir}/${lang_library_path}/libgfortran.a"] - && ![file exists "${blddir}/${lang_library_path}/libgfortran.${shlib_ext}"] } { + if { ![file exists "${blddir}/${libgfortran_library_path}/libgfortran.a"] + && ![file exists "${blddir}/${libgfortran_library_path}/libgfortran.${shlib_ext}"] } { verbose -log "No libgfortran library found, will not execute fortran tests" - unset lang_library_path + unset libgfortran_library_path return } + lappend lang_library_paths $libgfortran_library_path + + set libquadmath_library_path "../libquadmath/.libs" + if { [file exists "${blddir}/${libquadmath_library_path}/libquadmath.a"] + || [file exists "${blddir}/${libquadmath_library_path}/libquadmath.${shlib_ext}"] } { + lappend lang_library_paths $libquadmath_library_path + } else { + set libquadmath_library_path "" + } } elseif { ![info exists GFORTRAN_UNDER_TEST] } { verbose -log "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests" return @@ -32,18 +41,12 @@ set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]] set ld_library_path $always_ld_library_path if { $blddir != "" } { - append ld_library_path ":${blddir}/${lang_library_path}" + append ld_library_path ":${blddir}/${libgfortran_library_path}" - set quadmath_library_path "../libquadmath/.libs" - if { [file exists "${blddir}/${quadmath_library_path}/libquadmath.a"] - || [file exists "${blddir}/${quadmath_library_path}/libquadmath.${shlib_ext}"] } { - lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/${quadmath_library_path}/" - # Allow for spec subsitution. - lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/${quadmath_library_path}/" - append ld_library_path ":${blddir}/${quadmath_library_path}" + if { $libquadmath_library_path != "" } { + append ld_library_path ":${blddir}/${libquadmath_library_path}" append lang_link_flags " -lquadmath" } - unset quadmath_library_path } else { if { [check_no_compiler_messages has_libquadmath executable { int main() {return 0;} @@ -62,7 +65,9 @@ gfortran-dg-runtest $tests "" "" if { $blddir != "" } { unset lang_source_re unset lang_include_flags - unset lang_library_path + unset libgfortran_library_path + unset libquadmath_library_path + unset lang_library_paths } unset lang_link_flags diff --git a/libgomp/testsuite/libgomp.oacc-c++/c++.exp b/libgomp/testsuite/libgomp.oacc-c++/c++.exp index 5e4f70493490..63d1d7650a20 100644 --- a/libgomp/testsuite/libgomp.oacc-c++/c++.exp +++ b/libgomp/testsuite/libgomp.oacc-c++/c++.exp @@ -12,14 +12,15 @@ proc check_effective_target_c++ { } { } if { $blddir != "" } { - set lang_library_path "../libstdc++-v3/src/.libs" + set libstdc++_library_path "../libstdc++-v3/src/.libs" set shlib_ext [get_shlib_extension] - if { ![file exists "${blddir}/${lang_library_path}/libstdc++.a"] - && ![file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] } { + if { ![file exists "${blddir}/${libstdc++_library_path}/libstdc++.a"] + && ![file exists "${blddir}/${libstdc++_library_path}/libstdc++.${shlib_ext}"] } { verbose -log "No libstdc++ library found, will not execute c++ tests" - unset lang_library_path + unset libstdc++_library_path return } + lappend lang_library_paths ${libstdc++_library_path} } elseif { ![info exists GXX_UNDER_TEST] } { verbose -log "GXX_UNDER_TEST not defined, will not execute c++ tests" return @@ -45,7 +46,7 @@ set tests [lsort [concat \ set ld_library_path $always_ld_library_path if { $blddir != "" } { - append ld_library_path ":${blddir}/${lang_library_path}" + append ld_library_path ":${blddir}/${libstdc++_library_path}" } append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST] set_ld_library_path_env_vars @@ -139,7 +140,8 @@ if [info exists lang_include_flags] then { unset lang_include_flags } if { $blddir != "" } { - unset lang_library_path + unset libstdc++_library_path + unset lang_library_paths } unset lang_link_flags diff --git a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp index a590558a1950..af0a4f7ff311 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp +++ b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp @@ -5,14 +5,23 @@ load_gcc_lib gcc-dg.exp load_gcc_lib gfortran-dg.exp if { $blddir != "" } { - set lang_library_path "../libgfortran/.libs" + set libgfortran_library_path "../libgfortran/.libs" set shlib_ext [get_shlib_extension] - if { ![file exists "${blddir}/${lang_library_path}/libgfortran.a"] - && ![file exists "${blddir}/${lang_library_path}/libgfortran.${shlib_ext}"] } { + if { ![file exists "${blddir}/${libgfortran_library_path}/libgfortran.a"] + && ![file exists "${blddir}/${libgfortran_library_path}/libgfortran.${shlib_ext}"] } { verbose -log "No libgfortran library found, will not execute fortran tests" - unset lang_library_path + unset libgfortran_library_path return } + lappend lang_library_paths $libgfortran_library_path + + set libquadmath_library_path "../libquadmath/.libs" + if { [file exists "${blddir}/${libquadmath_library_path}/libquadmath.a"] + || [file exists "${blddir}/${libquadmath_library_path}/libquadmath.${shlib_ext}"] } { + lappend lang_library_paths $libquadmath_library_path + } else { + set libquadmath_library_path "" + } } elseif { ![info exists GFORTRAN_UNDER_TEST] } { verbose -log "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests" return @@ -35,18 +44,12 @@ set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]] set ld_library_path $always_ld_library_path if { $blddir != "" } { - append ld_library_path ":${blddir}/${lang_library_path}" - - set quadmath_library_path "../libquadmath/.libs" - if { [file exists "${blddir}/${quadmath_library_path}/libquadmath.a"] - || [file exists "${blddir}/${quadmath_library_path}/libquadmath.${shlib_ext}"] } { - lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/${quadmath_library_path}/" - # Allow for spec subsitution. - lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/${quadmath_library_path}/" - append ld_library_path ":${blddir}/${quadmath_library_path}" + append ld_library_path ":${blddir}/${libgfortran_library_path}" + + if { $libquadmath_library_path != "" } { + append ld_library_path ":${blddir}/${libquadmath_library_path}" append lang_link_flags " -lquadmath" } - unset quadmath_library_path } else { if { [check_no_compiler_messages has_libquadmath executable { int main() {return 0;} @@ -112,7 +115,9 @@ unset offload_target if { $blddir != "" } { unset lang_source_re unset lang_include_flags - unset lang_library_path + unset libgfortran_library_path + unset libquadmath_library_path + unset lang_library_paths } unset lang_link_flags -- 2.39.2