From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1844) id C133A383FB80; Wed, 14 Sep 2022 07:00:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C133A383FB80 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663138845; bh=ELJL2VpAwrwxULHBNQmuA1l5Qf1+vtcydDL2C/GvhiI=; h=From:To:Subject:Date:From; b=EhvglakdOcqjgT+04FzvmTnqqEhbDWIGkm417899yH+aC8jWTN8erJQckmFZXrZYQ GEQIkX3xeJcUeYei+7aUtUZBX9S83nSIItDzt+IYrZepOoyN0pH1WqUXY9pRm4XvKT LQyAN6CTCQvxTcHDh0T+mQPYN7NZf1DNtS8Ntfx8= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Yvan Roux To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2655] testsuite: gluefile file need to be prefixed X-Act-Checkin: gcc X-Git-Author: =?utf-8?q?Torbj=C3=B6rn_SVENSSON?= X-Git-Refname: refs/heads/master X-Git-Oldrev: 1995a0227d2602718fd0b283a8c7050fdfc701fb X-Git-Newrev: 9d503515ceebc778a5c2958f7459367c34f1fed0 Message-Id: <20220914070045.C133A383FB80@sourceware.org> Date: Wed, 14 Sep 2022 07:00:45 +0000 (GMT) List-Id: https://gcc.gnu.org/g:9d503515ceebc778a5c2958f7459367c34f1fed0 commit r13-2655-g9d503515ceebc778a5c2958f7459367c34f1fed0 Author: Torbjörn SVENSSON Date: Wed Sep 14 07:22:27 2022 +0200 testsuite: gluefile file need to be prefixed 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. 2022-09-14 Torbjörn SVENSSON gcc/testsuite/ PR target/95720 * lib/g++.exp: Moved gluefile block to after flags have been prefixed for the target_compile call. * lib/gcc.exp: Likewise. * lib/wrapper.exp: Reset adjusted state flag. Co-Authored-By: Yvan ROUX Signed-off-by: Torbjörn SVENSSON Diff: --- 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 + } } } }