From patchwork Fri Sep 9 13:03:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Torbjorn SVENSSON X-Patchwork-Id: 1120 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp704878wrt; Fri, 9 Sep 2022 06:04:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR68X44W43h+G6ymvcam3ka6sOM5uef3JkX9FEBiuCLfsDq6kGrm++2puh5rdvflfppBdj3k X-Received: by 2002:a05:6402:1445:b0:44d:844d:e76e with SMTP id d5-20020a056402144500b0044d844de76emr11019825edx.313.1662728684898; Fri, 09 Sep 2022 06:04:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662728684; cv=none; d=google.com; s=arc-20160816; b=R50nFttk3csBeSi4D8IwBffRMBXqRJvP96+c/No3MZUcwLHbtkkpmung6GJbZQBnY0 qNop/p5Gs9vHREi0r5txeh+fuepO8SCd43HdG2+ZlcAs8dv9Zp0lcQ4xvd8sAPoZhtiM Go62iDcCT7ywCssicpuzw8SD36t4GLUvKxDQg0v7UrTwgKUPV/XhAu5iNtbquFaio4f6 41EucYs8beDtoJLJm6xVlX6bcphDZXBaZxjEcA1KCE972hRWwlp3eNLHdkl+0PFNlihf ahqrt++tw1gKEgjTVGN8blxrvr7Kotx9ReC8VIUL2SvVcVBnH51QmCoP+8XKEeL8U1iS CQyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=lkh3DqYE3U/JwIKPy0OyHbDua7heP2YDftGG1qXjuMU=; b=B6PNLfJeJe1U7OZ7k4fNlyc775ROH5gRoHxZzJ5gWWHW4E3P70lY1D7BKD4nWzTY5f EZuxfrVIB6IvX3faCiqsAksE3yryNoN3mJdEwLMLe4bot3uHM0yyQ2rK6C51SjMj5aiB HqGFf4HNHc26fDf+BF5Z5BYQ49LcOA32SJIQSWjVXsJsYML35Da0reG5Y162WOJ6E7x6 Mizk3WVwzkm/aXimnfPg5Qy8rkaRqu/TjzsIz6dQU1pPC5Pbu47losouNmpN3sjzQ9Er 2KB5lkRVXdSz7mBhIDOZnxUtQaKDJ85aQxdoPqZG+QODEKIoEDm96HAJWTDLLiKYoZwx 41xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=oUqOkLDt; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id hz4-20020a1709072ce400b0077086d80875si357907ejc.538.2022.09.09.06.04.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 06:04:44 -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; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=oUqOkLDt; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5249F3857348 for ; Fri, 9 Sep 2022 13:04:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5249F3857348 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662728683; bh=lkh3DqYE3U/JwIKPy0OyHbDua7heP2YDftGG1qXjuMU=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=oUqOkLDtUR72oAAiipGSOo9Lx7/+Jlcixwlad1aIyQA2S8bKlO5Wj6INqMGj1t6L7 6zANlxxkNaeh8ioq7PYF+ZpM+k+x1+m8QKuaT86jTPiW/N/00qswcOU2v2PdeEb6pL D/KlMvjbEvLetwNfR7lv403PMmKwZBhKnqespsjQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by sourceware.org (Postfix) with ESMTPS id 30EC23857C4B; Fri, 9 Sep 2022 13:03:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 30EC23857C4B Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2899xr2g025384; Fri, 9 Sep 2022 15:03:49 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3jg3bns1m9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Sep 2022 15:03:49 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E27E710002A; Fri, 9 Sep 2022 15:03:46 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id DE3CB22D199; Fri, 9 Sep 2022 15:03:46 +0200 (CEST) Received: from jkgcxl0002.jkg.st.com (10.75.127.48) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2375.31; Fri, 9 Sep 2022 15:03:43 +0200 To: Subject: [PATCH] testsuite: gluefile file need to be prefixed Date: Fri, 9 Sep 2022 15:03:14 +0200 Message-ID: <20220909130313.2562293-1-torbjorn.svensson@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-09_08,2022-09-09_01,2022-06-22_01 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, 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: , X-Patchwork-Original-From: =?utf-8?q?Torbj=C3=B6rn_SVENSSON_via_Gcc-patches?= From: Torbjorn SVENSSON Reply-To: =?utf-8?q?Torbj=C3=B6rn_SVENSSON?= Cc: =?utf-8?q?Torbj=C3=B6rn_SVENSSON?= , aoliva@gcc.gnu.org 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?1743497393331708244?= X-GMAIL-MSGID: =?utf-8?q?1743497393331708244?= PR/95720 When the status wrapper is used, the gluefile need to be prefixed with -Wl, in order for the test cases to have the dump files with the expected names. gcc/testsuite/ChangeLog: * gcc/testsuite/lib/g++.exp: Moved gluefile block to after flags have been prefixed for the target_compile call. * gcc/testsuite/lib/gcc.exp: Likewise. * gcc/testsuite/lib/wrapper.exp: Reset adjusted state flag. Co-Authored-By: Yvan ROUX Signed-off-by: Torbjörn SVENSSON --- gcc/testsuite/lib/g++.exp | 10 +++++----- gcc/testsuite/lib/gcc.exp | 21 +++++++++++---------- gcc/testsuite/lib/wrapper.exp | 7 ++++++- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp index 24ef068b239..16e61fb4ad4 100644 --- a/gcc/testsuite/lib/g++.exp +++ b/gcc/testsuite/lib/g++.exp @@ -303,11 +303,6 @@ proc g++_target_compile { source dest type options } { global flags_to_postpone global board_info - if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } { - lappend options "libs=${gluefile}" - lappend options "ldflags=${wrap_flags}" - } - global TEST_EXTRA_LIBS if [info exists TEST_EXTRA_LIBS] { lappend options "ldflags=$TEST_EXTRA_LIBS" @@ -333,6 +328,11 @@ proc g++_target_compile { source dest type options } { set options [dg-additional-files-options $options $source] + if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } { + lappend options "libs=${gluefile}" + lappend options "ldflags=${wrap_flags}" + } + set result [target_compile $source $dest $type $options] if {[board_info $tboard exists multilib_flags]} { diff --git a/gcc/testsuite/lib/gcc.exp b/gcc/testsuite/lib/gcc.exp index 1b25ebec4cf..2f145d0fdf4 100644 --- a/gcc/testsuite/lib/gcc.exp +++ b/gcc/testsuite/lib/gcc.exp @@ -129,16 +129,6 @@ proc gcc_target_compile { source dest type options } { global flags_to_postpone global board_info - if {[target_info needs_status_wrapper] != "" && \ - [target_info needs_status_wrapper] != "0" && \ - [info exists gluefile] } { - lappend options "libs=${gluefile}" - lappend options "ldflags=$wrap_flags" - if { $type == "executable" } { - set options [concat "{additional_flags=-dumpbase \"\"}" $options] - } - } - global TEST_EXTRA_LIBS if [info exists TEST_EXTRA_LIBS] { lappend options "ldflags=$TEST_EXTRA_LIBS" @@ -170,6 +160,17 @@ proc gcc_target_compile { source dest type options } { lappend options "timeout=[timeout_value]" lappend options "compiler=$GCC_UNDER_TEST" set options [dg-additional-files-options $options $source] + + if {[target_info needs_status_wrapper] != "" && \ + [target_info needs_status_wrapper] != "0" && \ + [info exists gluefile] } { + lappend options "libs=${gluefile}" + lappend options "ldflags=$wrap_flags" + if { $type == "executable" } { + set options [concat "{additional_flags=-dumpbase \"\"}" $options] + } + } + set return_val [target_compile $source $dest $type $options] if {[board_info $tboard exists multilib_flags]} { diff --git a/gcc/testsuite/lib/wrapper.exp b/gcc/testsuite/lib/wrapper.exp index 5a601b269da..4a7d56941fc 100644 --- a/gcc/testsuite/lib/wrapper.exp +++ b/gcc/testsuite/lib/wrapper.exp @@ -22,7 +22,7 @@ # the compiler when compiling FILENAME. proc ${tool}_maybe_build_wrapper { filename args } { - global gluefile wrap_flags + global gluefile wrap_flags gcc_adjusted_linker_flags if { [target_info needs_status_wrapper] != "" \ && [target_info needs_status_wrapper] != "0" \ @@ -43,6 +43,11 @@ proc ${tool}_maybe_build_wrapper { filename args } { if { $result != "" } { set gluefile [lindex $result 0] set wrap_flags [lindex $result 1] + + # Reset the cached state of the adjusted flags + if { [info exists gcc_adjusted_linker_flags] } { + set gcc_adjusted_linker_flags 0 + } } } }