From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=foss.st.com 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=selector1; bh=lkh3DqYE3U/JwIKPy0OyHbDua7heP2YDftGG1qXjuMU=; b=CBXFZ0u4GO4456TvZxc8QJBi0YFHiyfwFU5jEOgfGdHgHL+X6TU/3DiNB5x5EngH7rRb xMYjNnjlr9xbtAKcJDq0btW6ARiiyNvE4OysyhvTSB3f7jvWJr4DDLYCVtu8DcDE4yGw ktiz12XfK/QbArTrV5D0G3YZzSx+n+jAzMN/bHlyaxcr/wXYuL8tAkz08BFMzqAoRGsG HW1eN99OREpZUl4mtC4Rc9TBFip7LnS3cQw1ob/iA1r9qiyl96iygYaa+2TfY/VfohW9 dBHRobWWXNnLDVtmqbAjgFOnKpxhsij4Eu22MXOvGaUrVnrxrWaa5TWkBDtvMhrtN398 3g== 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 From: =?UTF-8?q?Torbj=C3=B6rn=20SVENSSON?= To: CC: , , , , =?UTF-8?q?Torbj=C3=B6rn=20SVENSSON?= 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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 List-Id: 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 + } } } } -- 2.25.1