dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dg-options after board/cflags


From: Jose E. Marchesi
Subject: dg-options after board/cflags
Date: Wed, 02 Sep 2020 17:30:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi people!

While adding a bpf-sim.exp to dejagnu, I noticed that the flags in
board/cflags were included in the final compilation line _after_ the
flags in the test's dg-options.

Since the test options are more particular than the board options, I
would expect them to be placed after any board-defined flags, so I
prepared the patch below for dejagnu, which does the right thing for the
gcc.target/bpf testsuite.

However:

1. There could be tests around that depend (erroneously) on some of
   their dg-options to not have effect (or a different effect) because
   they are annulled (or modified) by some flag in a board file.

2. This could also impact other programs using dejagnu.

How do you people recommend to proceed?
Should we fix dejagnu and then fix buggy tests?
Or the other way around?  :-)

diff --git a/lib/target.exp b/lib/target.exp
index 36ae639..f0bfe20 100644
--- a/lib/target.exp
+++ b/lib/target.exp
@@ -455,7 +455,7 @@ proc default_target_compile {source destfile type options} {
        }
        if {[regexp "^additional_flags=" $i]} {
            regsub "^additional_flags=" $i "" tmp
-           append add_flags " $tmp"
+           append additional_flags " $tmp"
        }
        if {[regexp "^ldflags=" $i]} {
            regsub "^ldflags=" $i "" tmp
@@ -703,6 +703,8 @@ proc default_target_compile {source destfile type options} {
        }
     }
 
+    append add_flags " $additional_flags"
+    
     verbose "doing compile"
 
     set sources ""
@@ -728,7 +730,7 @@ proc default_target_compile {source destfile type options} {
            append add_flags " -o $destfile"
        }
     }
-
+    
     # This is obscure: we put SOURCES at the end when building an
     # object, because otherwise, in some situations, libtool will
     # become confused about the name of the actual source file.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]