Skip to content
Snippets Groups Projects
Commit 9d503515 authored by Torbjörn SVENSSON's avatar Torbjörn SVENSSON Committed by Yvan Roux
Browse files

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  <torbjorn.svensson@foss.st.com>

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: default avatarYvan ROUX <yvan.roux@foss.st.com>
Signed-off-by: default avatarTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
parent 1995a022
No related branches found
No related tags found
No related merge requests found
...@@ -303,11 +303,6 @@ proc g++_target_compile { source dest type options } { ...@@ -303,11 +303,6 @@ proc g++_target_compile { source dest type options } {
global flags_to_postpone global flags_to_postpone
global board_info 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 global TEST_EXTRA_LIBS
if [info exists TEST_EXTRA_LIBS] { if [info exists TEST_EXTRA_LIBS] {
lappend options "ldflags=$TEST_EXTRA_LIBS" lappend options "ldflags=$TEST_EXTRA_LIBS"
...@@ -333,6 +328,11 @@ proc g++_target_compile { source dest type options } { ...@@ -333,6 +328,11 @@ proc g++_target_compile { source dest type options } {
set options [dg-additional-files-options $options $source] 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] set result [target_compile $source $dest $type $options]
if {[board_info $tboard exists multilib_flags]} { if {[board_info $tboard exists multilib_flags]} {
......
...@@ -129,16 +129,6 @@ proc gcc_target_compile { source dest type options } { ...@@ -129,16 +129,6 @@ proc gcc_target_compile { source dest type options } {
global flags_to_postpone global flags_to_postpone
global board_info 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 global TEST_EXTRA_LIBS
if [info exists TEST_EXTRA_LIBS] { if [info exists TEST_EXTRA_LIBS] {
lappend options "ldflags=$TEST_EXTRA_LIBS" lappend options "ldflags=$TEST_EXTRA_LIBS"
...@@ -170,6 +160,17 @@ proc gcc_target_compile { source dest type options } { ...@@ -170,6 +160,17 @@ proc gcc_target_compile { source dest type options } {
lappend options "timeout=[timeout_value]" lappend options "timeout=[timeout_value]"
lappend options "compiler=$GCC_UNDER_TEST" lappend options "compiler=$GCC_UNDER_TEST"
set options [dg-additional-files-options $options $source] 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] set return_val [target_compile $source $dest $type $options]
if {[board_info $tboard exists multilib_flags]} { if {[board_info $tboard exists multilib_flags]} {
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
# the compiler when compiling FILENAME. # the compiler when compiling FILENAME.
proc ${tool}_maybe_build_wrapper { filename args } { 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] != "" \ if { [target_info needs_status_wrapper] != "" \
&& [target_info needs_status_wrapper] != "0" \ && [target_info needs_status_wrapper] != "0" \
...@@ -43,6 +43,11 @@ proc ${tool}_maybe_build_wrapper { filename args } { ...@@ -43,6 +43,11 @@ proc ${tool}_maybe_build_wrapper { filename args } {
if { $result != "" } { if { $result != "" } {
set gluefile [lindex $result 0] set gluefile [lindex $result 0]
set wrap_flags [lindex $result 1] 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
}
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment