diff options
author | Jacob Bachmeyer <jcb62281+dev@gmail.com> | 2020-06-22 18:25:30 -0500 |
---|---|---|
committer | Jacob Bachmeyer <jcb62281+dev@gmail.com> | 2020-06-22 18:25:30 -0500 |
commit | a641e4899fbde3cfe8e0611542be2742818adc12 (patch) | |
tree | 1f260f467c04dbbfa4d18e3f4511b166081a2762 | |
parent | 3a4313df675a83e598bcb8fcfacf8761fe997db5 (diff) | |
download | dejagnu-a641e4899fbde3cfe8e0611542be2742818adc12.zip dejagnu-a641e4899fbde3cfe8e0611542be2742818adc12.tar.gz dejagnu-a641e4899fbde3cfe8e0611542be2742818adc12.tar.bz2 |
Add "linker=" option to target_compile to support testing
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | doc/dejagnu.texi | 5 | ||||
-rw-r--r-- | lib/target.exp | 12 |
3 files changed, 18 insertions, 5 deletions
@@ -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. diff --git a/doc/dejagnu.texi b/doc/dejagnu.texi index 3e68f19..fa03a07 100644 --- a/doc/dejagnu.texi +++ b/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 diff --git a/lib/target.exp b/lib/target.exp index 627f07f..30f6eb3 100644 --- a/lib/target.exp +++ b/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" |