Browse Source

Add "linker=" option to target_compile to support testing

farm
Jacob Bachmeyer 6 years ago
parent
commit
a641e4899f
  1. 6
      ChangeLog
  2. 5
      doc/dejagnu.texi
  3. 12
      lib/target.exp

6
ChangeLog

@ -1,8 +1,14 @@
2020-06-22 Jacob Bachmeyer <jcb62281+dev@gmail.com>
* doc/dejagnu.texi (target_compile procedure): Document new
"linker=" option to target_compile.
* lib/target.exp (default_target_compile): Actually use internal
option for separate linker provided for Go language support. This
seems to have been accidentally omitted from Tom Tromey's patches.
(default_target_compile): Add "linker=" option, similar to
"compiler=" option, but the former overrides the latter when
building an executable.
(default_target_compile): Ensure that "--emit obj" is spaced from
previous item when used to compile Rust. Use "--emit asm" instead
of "-S" when generating assembly from Rust sources.

5
doc/dejagnu.texi

@ -4599,6 +4599,9 @@ this option is given multiple times, only the last use is significant.
@item compiler=@var{command}
Override the defaults and use @var{command} as the compiler. If
this option is given multiple times, only the last use is significant.
@item linker=@var{command}
Override the defaults and use @var{command} to build executables. If
this option is given multiple times, only the last use is significant.
@item early_flags=@var{flags}
Prepend @var{flags} to the set of arguments to be passed to the compiler.
Multiple uses of this option specify additional arguments.
@ -5898,4 +5901,4 @@ This makes @code{runtest} exit. Abbreviation: @kbd{q}.
@c LocalWords: subdirectory prepend prepended testsuite filename Expect's svn
@c LocalWords: DejaGnu CVS RCS SCCS prepending subcommands Tcl Awk Readline
@c LocalWords: POSIX KFAIL KPASS XFAIL XPASS hostname multitable gfortran
@c LocalWords: rustc
@c LocalWords: rustc executables

12
lib/target.exp

@ -312,15 +312,15 @@ proc default_target_compile {source destfile type options} {
}
set early_flags ""
# linker_opts_order is one of "sources-then-flags", "flags-then-sources".
# The order matters for things like -Wl,--as-needed. The default is to
# preserve existing behavior.
set linker_opts_order "sources-then-flags"
set add_flags ""
set libs ""
set compiler_type "c"
set compiler ""
set linker ""
# linker_opts_order is one of "sources-then-flags", "flags-then-sources".
# The order matters for things like -Wl,--as-needed. The default is to
# preserve existing behavior.
set linker_opts_order "sources-then-flags"
set ldflags ""
set dest [target_info name]
@ -445,6 +445,10 @@ proc default_target_compile {source destfile type options} {
regsub "^compiler=" $i "" tmp
set compiler $tmp
}
if {[regexp "^linker=" $i]} {
regsub "^linker=" $i "" tmp
set linker $tmp
}
if {[regexp "^early_flags=" $i]} {
regsub "^early_flags=" $i "" tmp
append early_flags " $tmp"

Loading…
Cancel
Save