On May 27, 2020, Alexandre Oliva <ol...@adacore.com> wrote:

> - The prepending of -Wl, to file names in ldflags et al was done in a
> way that introduced empty arguments when consecutive blanks appeared
> in these board configuration knobs.  Skip the empty strings between
> consecutive blanks to avoid this problem.

I thought I'd dealt with nearly all of the fallout with the patch above,
but I was still seeing unexpected outputs.exp errors in gcc-testresults@

Anthony Green, whose results showed a problem, was kind enough to share
his board config file with me, and looking into it I realized I'd used
ldscripts instead of ldscript as the board configuration knob name.
Oops.

I have not tested the patch below yet.  I'm starting testing it on
various configurations that, despite some of them being crosses to
embedded targets, did *not* have ldscript or ldscripts in the board
config files, i.e., they did not experience the problem.

I'd appreciate if someone who uses the ldscript knob in their board
config file would confirm that this patch fixes the problems for them.
I'll check the patch in under the obviously correct rule as soon as I
get confirmation that it brings some progress.

Thanks in advance,


spell ldscript correctly in outputs.exp et al

From: Alexandre Oliva <ol...@adacore.com>

In my recent changes to outputs.exp and gcc-defs.exp, I misreferenced
dejagnu board property ldscript, singular, as ldscripts, plural.

This probably didn't have much impact on gcc-defs.exp: the code there
would just prefix with -Wl, any options that amounted to file names,
and linker scripts probably wouldn't be named without a -T or even an
-Wl,-T, prefix.

The visible effects were in outputs.exp, that also intended to add the
ldscript, if present, to the set of options to be passed to the
compiler driver for linking.  Using the wrong option name, that
wouldn't work.


for  gcc/testsuite/ChangeLog

        * gcc.misc-tests/outputs.exp: Spell ldscript correctly.
        * lib/gcc-defs.exp (gcc_adjust_linker_flags): Likewise.
---
 testsuite/gcc.misc-tests/outputs.exp |    2 +-
 testsuite/lib/gcc-defs.exp           |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git gcc/testsuite/gcc.misc-tests/outputs.exp 
gcc/testsuite/gcc.misc-tests/outputs.exp
index c3c6c2d..06a32db 100644
--- gcc/testsuite/gcc.misc-tests/outputs.exp
+++ gcc/testsuite/gcc.misc-tests/outputs.exp
@@ -48,7 +48,7 @@ set skip_lto ![check_effective_target_lto]
 # We do not compile to an executable, because that requires naming an output.
 set link_options ""
 set dest [target_info name]
-foreach i { ldflags libs ldscripts } {
+foreach i { ldflags libs ldscript } {
     if {[board_info $dest exists $i]} {
        set skip ""
        foreach opt [split [board_info $dest $i]] {
diff --git gcc/testsuite/lib/gcc-defs.exp gcc/testsuite/lib/gcc-defs.exp
index d591cb3..87eeb7d 100644
--- gcc/testsuite/lib/gcc-defs.exp
+++ gcc/testsuite/lib/gcc-defs.exp
@@ -287,7 +287,7 @@ proc dg-additional-files { args } {
 
 set gcc_adjusted_linker_flags 0
 
-# Add -Wl, before any file names in ldflags, libs, and ldscripts, so
+# Add -Wl, before any file names in ldflags, libs, and ldscript, so
 # that default object files or libraries do not change the names of
 # gcc auxiliary outputs.
 
@@ -300,7 +300,7 @@ proc gcc_adjust_linker_flags {} {
 
     if {![is_remote host]} {
        set dest [target_info name]
-       foreach i { ldflags libs ldscripts } {
+       foreach i { ldflags libs ldscript } {
            if {[board_info $dest exists $i]} {
                set opts [board_info $dest $i]
                set nopts {}



-- 
Alexandre Oliva, freedom fighter    he/him    https://FSFLA.org/blogs/lxo/
Free Software Evangelist              Stallman was right, but he's left :(
GNU Toolchain Engineer           Live long and free, and prosper ethically

Reply via email to