aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Bachmeyer <jcb62281+dev@gmail.com>2020-07-06 20:59:00 -0500
committerJacob Bachmeyer <jcb62281+dev@gmail.com>2020-07-06 20:59:00 -0500
commite572af7e43e26162a717408c2464cad24c936d07 (patch)
tree9df4a73d45cda75f0ea7507b81db1a97223c449c
parent33f82a77ef49cfa5133917ee629ed599f7893a89 (diff)
parent024297c3b4444b1210d869cc868558e10d75bd97 (diff)
downloaddejagnu-e572af7e43e26162a717408c2464cad24c936d07.zip
dejagnu-e572af7e43e26162a717408c2464cad24c936d07.tar.gz
dejagnu-e572af7e43e26162a717408c2464cad24c936d07.tar.bz2
Merge branch 'gdb-upstream-for-1.6.3'
Conflicts: ChangeLog
-rw-r--r--ChangeLog46
-rw-r--r--NEWS4
-rw-r--r--doc/dejagnu.texi66
-rw-r--r--lib/libgloss.exp40
-rw-r--r--lib/target.exp104
-rw-r--r--testsuite/runtest.libs/target.test319
6 files changed, 568 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b87c20..f966333 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,52 @@
* aclocal.m4, configure.ac, Makefile.am: regenerated GDB too.
* doc/dejagnu.texi: Update copyright date.
+2020-06-22 Jacob Bachmeyer <jcb62281+dev@gmail.com>
+
+ * NEWS: Mention "linker=" option and added language support.
+
+ * 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.
+
+ * testsuite/runtest.libs/target.test: Add tests for Go and Rust.
+ Also add tests for the new "early_flags=" and "linker=" options.
+
+2020-06-20 Jacob Bachmeyer <jcb62281+dev@gmail.com>
+
+ * doc/dejagnu.texi (Libgloss): Update menu.
+ (find_go procedure, find_go_linker procedure): New nodes.
+ (find_rustc procedure): New node.
+
+2020-06-19 Tom Tromey <tromey@adacore.com>
+
+ * doc/dejagnu.texi (target_compile procedure): Document Go
+ additions.
+ * lib/target.exp (default_target_compile): Handle Go.
+ * lib/libgloss.exp (find_go, find_go_linker): New procs.
+
+2020-06-19 Tom Tromey <tromey@adacore.com>
+
+ * doc/dejagnu.texi (target_compile procedure): Document rust
+ additions.
+ * lib/target.exp (default_target_compile): Handle rust.
+ * lib/libgloss.exp (find_rustc): New proc.
+
+2020-06-19 Tom Tromey <tromey@adacore.com>
+
+ * lib/target.exp (default_target_compile): Add early_flags.
+ * doc/dejagnu.texi (target_compile procedure): Document
+ early_flags.
+
2020-06-15 Jacob Bachmeyer <jcb62281+dev@gmail.com>
Merge patches from Linaro:
diff --git a/NEWS b/NEWS
index 209e9c4..9e6dff7 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,10 @@ Changes since 1.6.2:
retrieving or providing information about the current testsuite.
6. A command "testsuite file" is added to replace the use of the
"*dir" variables in test scripts.
+X. The target_compile procedure now accepts a "linker=" option that
+ overrides the compiler selection when producing an executable.
+X. The internal default_target_compile procedure now supports compiling
+ sources in Go (using GCC Go) and Rust.
7. A shell command "dejagnu" is added as a place to hang various
auxiliary commands not directly involved with running tests. The
"runtest" command will remain for that purpose for the foreseeable
diff --git a/doc/dejagnu.texi b/doc/dejagnu.texi
index f01c7ae..fa03a07 100644
--- a/doc/dejagnu.texi
+++ b/doc/dejagnu.texi
@@ -4564,6 +4564,10 @@ Use a compiler for the D language.
Use a compiler for Fortran 77.
@item f90
Use a compiler for Fortran 90.
+@item go
+Use a compiler for Go.
+@item rust
+Use a compiler for Rust.
@end table
If none of these options are given, the C compiler is used by default.
Giving multiple language-selection options is an error.
@@ -4595,6 +4599,12 @@ 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.
@item additional_flags=@var{flags}
Add @var{flags} to the set of arguments to be passed to the compiler.
Multiple uses of this option specify additional arguments.
@@ -4667,6 +4677,15 @@ compiler will be used and the @code{compiler} option ignored.
@item F90_FOR_TARGET
Override Fortran 90 compiler. If the @code{f90} option is given, this
compiler will be used and the @code{compiler} option ignored.
+@item GO_FOR_TARGET
+Override Go compiler. If the @code{go} option is given, this
+compiler will be used and the @code{compiler} option ignored.
+@item GO_LD_FOR_TARGET
+Override Go linker. If the @code{go} option is given, this
+linker will be used.
+@item RUSTC_FOR_TARGET
+Override Rust compiler. If the @code{rust} option is given, this
+compiler will be used and the @code{compiler} option ignored.
@item GNATMAKE_FOR_TARGET
Override Ada compiler. If the @code{ada} option is given, this
compiler will be used and the @code{compiler} option ignored.
@@ -5272,6 +5291,9 @@ systems.
* find_g++ Procedure: find_g++ procedure
* find_g77 Procedure: find_g77 procedure
* find_gfortran Procedure: find_gfortran procedure
+* find_go Procedure: find_go procedure
+* find_go_linker Procedure: find_go_linker procedure
+* find_rustc Procedure: find_rustc procedure
* process_multilib_options Procedure: process_multilib_options procedure
* add_multilib_option Procedure: add_multilib_option procedure
* find_gas Procedure: find_gas procedure
@@ -5511,7 +5533,7 @@ for a cross-compiler if the build tree is configured for one.
@t{@b{find_g77}}
@end quotation
-@node find_gfortran procedure, process_multilib_options procedure, find_g77 procedure, Libgloss
+@node find_gfortran procedure, find_go procedure, find_g77 procedure, Libgloss
@subsubheading find_gfortran Procedure
@findex find_gfortran
@@ -5523,7 +5545,46 @@ for a cross-compiler if the build tree is configured for one.
@t{@b{find_gfortran}}
@end quotation
-@node process_multilib_options procedure, add_multilib_option procedure, find_gfortran procedure, Libgloss
+@node find_go procedure, find_go_linker procedure, find_gfortran procedure, Libgloss
+@subsubheading find_go Procedure
+@findex find_go
+
+Looks for a copy of the GNU compiler for the Go language in the build
+tree and in the @code{PATH}. This will also return the proper
+transformed name for a cross-compiler if the build tree is configured
+for one.
+
+@quotation
+@t{@b{find_go}}
+@end quotation
+
+@node find_go_linker procedure, find_rustc procedure, find_go procedure, Libgloss
+@subsubheading find_go_linker Procedure
+@findex find_go_linker
+
+Looks for a copy of the special linker associated with the GNU
+compiler for the Go language in the build tree and in the @code{PATH}.
+This will also return the proper transformed name for a cross-compiler
+if the build tree is configured for one.
+
+@quotation
+@t{@b{find_go_linker}}
+@end quotation
+
+@node find_rustc procedure, process_multilib_options procedure, find_go_linker procedure, Libgloss
+@subsubheading find_rustc Procedure
+@findex find_rustc
+
+Looks for a copy of a compiler for the Rust language in the build tree
+and in the @code{PATH}. The Rust compiler is different and this
+procedure also ensures that it will be called with options to suppress
+output coloration.
+
+@quotation
+@t{@b{find_rustc}}
+@end quotation
+
+@node process_multilib_options procedure, add_multilib_option procedure, find_rustc procedure, Libgloss
@subsubheading process_multilib_options Procedure
@findex process_multilib_options
@@ -5840,3 +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 executables
diff --git a/lib/libgloss.exp b/lib/libgloss.exp
index 56a9728..8e8a9ce 100644
--- a/lib/libgloss.exp
+++ b/lib/libgloss.exp
@@ -765,6 +765,46 @@ proc find_gnatmake {} {
return $CC
}
+proc find_go {} {
+ global tool_root_dir
+
+ set GO ""
+
+ if {![is_remote host]} {
+ set file [lookfor_file $tool_root_dir gccgo]
+ if { $file ne "" } {
+ set root [file dirname $file]
+ set GO "$file -B$root/gcc/"
+ }
+ }
+
+ if { $GO eq "" } {
+ set GO [transform gccgo]
+ }
+
+ return $GO
+}
+
+proc find_go_linker {} {
+ return [find_go]
+}
+
+proc find_rustc {} {
+ global tool_root_dir
+ if {![is_remote host]} {
+ set rustc [lookfor_file $tool_root_dir rustc]
+ if {$rustc eq ""} {
+ set rustc rustc
+ }
+ } else {
+ set rustc ""
+ }
+ if {$rustc ne ""} {
+ append rustc " --color never"
+ }
+ return $rustc
+}
+
proc find_nm {} {
global tool_root_dir
diff --git a/lib/target.exp b/lib/target.exp
index d240007..30f6eb3 100644
--- a/lib/target.exp
+++ b/lib/target.exp
@@ -311,10 +311,16 @@ proc default_target_compile {source destfile type options} {
error "Must supply an output filename for the compile to default_target_compile"
}
+ set early_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]
@@ -395,6 +401,38 @@ proc default_target_compile {source destfile type options} {
}
}
+ if { $i eq "go" } {
+ set compiler_type "go"
+ if {[board_info $dest exists goflags]} {
+ append add_flags " [board_info $dest goflags]"
+ }
+ if {[board_info $dest exists gocompiler]} {
+ set compiler [board_info $dest gocompiler]
+ } else {
+ set compiler [find_go]
+ }
+ if {[board_info $dest exists golinker]} {
+ set linker [board_info $dest golinker]
+ } else {
+ set linker [find_go_linker]
+ }
+ if {[board_info $dest exists golinker_opts_order]} {
+ set linker_opts_order [board_info $dest golinker_opts_order]
+ }
+ }
+
+ if { $i eq "rust" } {
+ set compiler_type "rust"
+ if {[board_info $dest exists rustflags]} {
+ append add_flags " [board_info $dest rustflags]"
+ }
+ if {[board_info $dest exists rustcompiler]} {
+ set compiler [board_info $dest rustcompiler]
+ } else {
+ set compiler [find_rustc]
+ }
+ }
+
if {[regexp "^dest=" $i]} {
regsub "^dest=" $i "" tmp
if {[board_info $tmp exists name]} {
@@ -407,6 +445,14 @@ 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"
+ }
if {[regexp "^additional_flags=" $i]} {
regsub "^additional_flags=" $i "" tmp
append add_flags " $tmp"
@@ -451,6 +497,9 @@ proc default_target_compile {source destfile type options} {
global F77_FOR_TARGET
global F90_FOR_TARGET
global GNATMAKE_FOR_TARGET
+ global GO_FOR_TARGET
+ global GO_LD_FOR_TARGET
+ global RUSTC_FOR_TARGET
if {[info exists GNATMAKE_FOR_TARGET]} {
if { $compiler_type eq "ada" } {
@@ -488,6 +537,25 @@ proc default_target_compile {source destfile type options} {
}
}
+ if { $compiler_type eq "go" } {
+ if {[info exists GO_FOR_TARGET]} {
+ set compiler $GO_FOR_TARGET
+ }
+ if {[info exists GO_LD_FOR_TARGET]} {
+ set linker $GO_LD_FOR_TARGET
+ }
+ }
+
+ if {[info exists RUSTC_FOR_TARGET]} {
+ if {$compiler_type eq "rust"} {
+ set compiler $RUSTC_FOR_TARGET
+ }
+ }
+
+ if { $type eq "executable" && $linker ne "" } {
+ set compiler $linker
+ }
+
if { $compiler eq "" } {
if { [board_info $dest exists compiler] } {
set compiler [board_info $dest compiler]
@@ -506,7 +574,11 @@ proc default_target_compile {source destfile type options} {
}
if {$type eq "object"} {
- append add_flags " -c"
+ if {$compiler_type eq "rust"} {
+ append add_flags " --emit obj"
+ } else {
+ append add_flags " -c"
+ }
}
if { $type eq "preprocess" } {
@@ -514,7 +586,11 @@ proc default_target_compile {source destfile type options} {
}
if { $type eq "assembly" } {
- append add_flags " -S"
+ if {$compiler_type eq "rust"} {
+ append add_flags " --emit asm"
+ } else {
+ append add_flags " -S"
+ }
}
if {[board_info $dest exists cflags]} {
@@ -634,10 +710,26 @@ proc default_target_compile {source destfile type options} {
# 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.
- if {$type eq "object"} {
- set opts "$add_flags $sources"
- } else {
- set opts "$sources $add_flags"
+ switch $type {
+ "object" {
+ set opts "$early_flags $add_flags $sources"
+ }
+ "executable" {
+ switch $linker_opts_order {
+ "flags-then-sources" {
+ set opts "$early_flags $add_flags $sources"
+ }
+ "sources-then-flags" {
+ set opts "$early_flags $sources $add_flags"
+ }
+ default {
+ error "Invalid value for board_info linker_opts_order"
+ }
+ }
+ }
+ default {
+ set opts "$early_flags $sources $add_flags"
+ }
}
if {[isremote host]} {
diff --git a/testsuite/runtest.libs/target.test b/testsuite/runtest.libs/target.test
index 629637f..11d32ba 100644
--- a/testsuite/runtest.libs/target.test
+++ b/testsuite/runtest.libs/target.test
@@ -106,7 +106,8 @@ create_test_interpreter compile_test {
}
}
# mock find_* procedures from libgloss.exp
-foreach { prog } { gcc gcj g++ gdc g77 gfortran gnatmake nm gas ld } {
+foreach { prog } { gcc gcj g++ gdc g77 gfortran go go_linker rustc gnatmake
+ nm gas ld } {
establish_mock compile_test find_$prog {} [list found-$prog]
}
@@ -205,6 +206,39 @@ eval_tests compile_test {
"remote_exec host" U { 2 {found-gcc foo.c -g -lm -Tidp.ld -o foo} }
}
}
+
+ { "minimal simple preprocess with early flags"
+ { default_target_compile "foo.c" "" preprocess {
+ "early_flags=-fearly"
+ } }
+ check_calls {
+ "remote_exec host" U { 2 {found-gcc -fearly foo.c -E} }
+ }
+ }
+ { "minimal simple compile to assembly with early flags"
+ { default_target_compile "foo.c" "foo.s" assembly {
+ "early_flags=-fearly"
+ } }
+ check_calls {
+ "remote_exec host" U { 2 {found-gcc -fearly foo.c -S -o foo.s} }
+ }
+ }
+ { "minimal simple compile to object with early flags"
+ { default_target_compile "foo.c" "foo.o" object {
+ "early_flags=-fearly"
+ } }
+ check_calls {
+ "remote_exec host" U { 2 {found-gcc -fearly -c -o foo.o foo.c} }
+ }
+ }
+ { "minimal simple compile and link with early flags"
+ { default_target_compile "foo.c" "foo" executable {
+ "early_flags=-fearly"
+ } }
+ check_calls {
+ "remote_exec host" U { 2 {found-gcc -fearly foo.c -lm -Tidp.ld -o foo} }
+ }
+ }
}
# add more keys to the board_info array for a more complex target description
@@ -447,6 +481,30 @@ eval_tests compile_test {
{ 2 {host-gcc foo.c -lm -Tmvme.ld -o foo} }
}
}
+ { "override destination to host and compile and link with host-gcc via linker"
+ { default_target_compile "foo.c" "foo" executable {
+ "dest=host" "linker=host-gcc"
+ } }
+ check_calls {
+ "find_gcc" ! {}
+ "board_info host" * { 2 exists 3 name }
+ "board_info host" * { 2 name }
+ "remote_exec host" U
+ { 2 {host-gcc foo.c -lm -Tmvme.ld -o foo} }
+ }
+ }
+ { "override destination to host and compile and link with host-gcc-ld via linker"
+ { default_target_compile "foo.c" "foo" executable {
+ "dest=host" "compiler=host-gcc" "linker=host-gcc-ld"
+ } }
+ check_calls {
+ "find_gcc" ! {}
+ "board_info host" * { 2 exists 3 name }
+ "board_info host" * { 2 name }
+ "remote_exec host" U
+ { 2 {host-gcc-ld foo.c -lm -Tmvme.ld -o foo} }
+ }
+ }
{ "override ldscript"
{ default_target_compile "foo.c" "foo" executable {
"ldscript=-Tspecial.ld"
@@ -605,9 +663,12 @@ set board_info(idp,cxxflags) "-fgnu-c++"
set board_info(idp,dflags) "-fdflag"
set board_info(idp,f77flags) "-flong-f77-flag"
set board_info(idp,f90flags) "-flonger-f90-flag"
+set board_info(idp,goflags) "-fgo"
+set board_info(idp,rustflags) "-frust"
foreach {k v} {
- gnatmake gnatmake c++compiler g++ dcompiler gdc
- f77compiler g77 f90compiler gfortran
+ gnatmake gnatmake c++compiler g++ dcompiler gdc
+ f77compiler g77 f90compiler gfortran rustcompiler rustc
+ gocompiler gccgo golinker gccgo-ld
} { set board_info(idp,$k) "$board_info(idp,config)-$v" }
eval_tests compile_test {
@@ -1173,6 +1234,258 @@ eval_tests compile_test {
}
}
+ # Go
+ { "preprocess Go with target compiler"
+ { default_target_compile "foo.go" "" preprocess {go} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_go" ! {}
+ "find_go_linker" ! {}
+ "remote_exec host" U
+ { 2 {m68k-unknown-aout-gccgo foo.go -midp -fgo
+ -E -I/usr/gnemul/idp/include} }
+ }
+ }
+ { "compile Go to assembly with target compiler"
+ { default_target_compile "foo.go" "foo.s" assembly {go} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_go" ! {}
+ "find_go_linker" ! {}
+ "remote_exec host" U
+ { 2 {m68k-unknown-aout-gccgo foo.go -midp -fgo
+ -S -I/usr/gnemul/idp/include -o foo.s} }
+ }
+ }
+ { "compile Go to object with target compiler"
+ { default_target_compile "foo.go" "foo.o" object {go} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_go" ! {}
+ "find_go_linker" ! {}
+ "remote_exec host" U
+ { 2 {m68k-unknown-aout-gccgo -midp -fgo
+ -c -I/usr/gnemul/idp/include
+ -o foo.o foo.go} }
+ }
+ }
+ { "compile and link Go with target compiler"
+ { default_target_compile "foo.go" "foo" executable {go} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_go" ! {}
+ "find_go_linker" ! {}
+ "remote_exec host" U
+ { 2 {m68k-unknown-aout-gccgo-ld foo.go -midp -fgo
+ -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+ -lidpsup -lm_idp -Tidp.ld -o foo} }
+ }
+ }
+
+ { "setup GO_FOR_TARGET"
+ { set GO_FOR_TARGET "target-gccgo" }
+ }
+ { "preprocess Go with GO_FOR_TARGET"
+ { default_target_compile "foo.go" "" preprocess {go} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_go" ! {}
+ "find_go_linker" ! {}
+ "remote_exec host" U
+ { 2 {target-gccgo foo.go -midp -fgo
+ -E -I/usr/gnemul/idp/include} }
+ }
+ }
+ { "compile Go to assembly with GO_FOR_TARGET"
+ { default_target_compile "foo.go" "foo.s" assembly {go} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_go" ! {}
+ "find_go_linker" ! {}
+ "remote_exec host" U
+ { 2 {target-gccgo foo.go -midp -fgo
+ -S -I/usr/gnemul/idp/include -o foo.s} }
+ }
+ }
+ { "compile Go to object with GO_FOR_TARGET"
+ { default_target_compile "foo.go" "foo.o" object {go} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_go" ! {}
+ "find_go_linker" ! {}
+ "remote_exec host" U
+ { 2 {target-gccgo -midp -fgo
+ -c -I/usr/gnemul/idp/include
+ -o foo.o foo.go} }
+ }
+ }
+ { "clean up GO_FOR_TARGET"
+ { unset GO_FOR_TARGET }
+ }
+ { "setup GO_LD_FOR_TARGET"
+ { set GO_LD_FOR_TARGET "target-gccgo-ld" }
+ }
+ { "compile and link Go with GO_LD_FOR_TARGET"
+ { default_target_compile "foo.go" "foo" executable {go} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_go" ! {}
+ "find_go_linker" ! {}
+ "remote_exec host" U
+ { 2 {target-gccgo-ld foo.go -midp -fgo
+ -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+ -lidpsup -lm_idp -Tidp.ld -o foo} }
+ }
+ }
+ { "clean up GO_LD_FOR_TARGET"
+ { unset GO_LD_FOR_TARGET }
+ }
+
+ { "override destination to host and compile Go to object"
+ { default_target_compile "foo.go" "foo.o" object {
+ "dest=host" go
+ } }
+ check_calls {
+ "remote_exec host" U { 2 {found-go -c -o foo.o foo.go} }
+ }
+ }
+ { "override destination to host and compile Go to object with host-gccgo"
+ { default_target_compile "foo.go" "foo.o" object {
+ "dest=host" go "compiler=host-gccgo"
+ } }
+ check_calls {
+ "remote_exec host" U { 2 {host-gccgo -c -o foo.o foo.go} }
+ }
+ }
+ { "override destination to host and compile and link Go"
+ { default_target_compile "foo.go" "foo" executable {
+ "dest=host" go
+ } }
+ check_calls {
+ "remote_exec host" U
+ { 2 {found-go_linker foo.go -lm -Tmvme.ld -o foo} }
+ }
+ }
+ { "override destination to host and compile and link Go with host-gccgo-ld"
+ { default_target_compile "foo.go" "foo" executable {
+ "dest=host" go "compiler=host-gccgo" "linker=host-gccgo-ld"
+ } }
+ check_calls {
+ "remote_exec host" U
+ { 2 {host-gccgo-ld foo.go -lm -Tmvme.ld -o foo} }
+ }
+ }
+
+ # Rust
+ { "preprocess Rust with target compiler"
+ { default_target_compile "foo.rs" "" preprocess {rust} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_rustc" ! {}
+ "remote_exec host" U
+ { 2 {m68k-unknown-aout-rustc foo.rs -midp -frust
+ -E -I/usr/gnemul/idp/include} }
+ }
+ }
+ { "compile Rust to assembly with target compiler"
+ { default_target_compile "foo.rs" "foo.s" assembly {rust} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_rustc" ! {}
+ "remote_exec host" U
+ { 2 {m68k-unknown-aout-rustc foo.rs -midp -frust
+ --emit asm -I/usr/gnemul/idp/include -o foo.s} }
+ }
+ }
+ { "compile Rust to object with target compiler"
+ { default_target_compile "foo.rs" "foo.o" object {rust} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_rustc" ! {}
+ "remote_exec host" U
+ { 2 {m68k-unknown-aout-rustc -midp -frust
+ --emit obj -I/usr/gnemul/idp/include
+ -o foo.o foo.rs} }
+ }
+ }
+ { "compile and link Rust with target compiler"
+ { default_target_compile "foo.rs" "foo" executable {rust} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_rustc" ! {}
+ "remote_exec host" U
+ { 2 {m68k-unknown-aout-rustc foo.rs -midp -frust
+ -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+ -lidpsup -lm_idp -Tidp.ld -o foo} }
+ }
+ }
+
+ { "setup RUSTC_FOR_TARGET"
+ { set RUSTC_FOR_TARGET "target-rustc" }
+ }
+ { "preprocess Rust with RUSTC_FOR_TARGET"
+ { default_target_compile "foo.rs" "" preprocess {rust} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_rustc" ! {}
+ "remote_exec host" U
+ { 2 {target-rustc foo.rs -midp -frust
+ -E -I/usr/gnemul/idp/include} }
+ }
+ }
+ { "compile Rust to assembly with RUSTC_FOR_TARGET"
+ { default_target_compile "foo.rs" "foo.s" assembly {rust} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_rustc" ! {}
+ "remote_exec host" U
+ { 2 {target-rustc foo.rs -midp -frust
+ --emit asm -I/usr/gnemul/idp/include -o foo.s} }
+ }
+ }
+ { "compile Rust to object with RUSTC_FOR_TARGET"
+ { default_target_compile "foo.rs" "foo.o" object {rust} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_rustc" ! {}
+ "remote_exec host" U
+ { 2 {target-rustc -midp -frust
+ --emit obj -I/usr/gnemul/idp/include
+ -o foo.o foo.rs} }
+ }
+ }
+ { "compile and link Rust with RUSTC_FOR_TARGET"
+ { default_target_compile "foo.rs" "foo" executable {rust} }
+ check_calls {
+ "find_gcc" ! {}
+ "find_rustc" ! {}
+ "remote_exec host" U
+ { 2 {target-rustc foo.rs -midp -frust
+ -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+ -lidpsup -lm_idp -Tidp.ld -o foo} }
+ }
+ }
+ { "clean up RUSTC_FOR_TARGET"
+ { unset RUSTC_FOR_TARGET }
+ }
+
+ { "override destination to host and compile and link Rust"
+ { default_target_compile "foo.rs" "foo" executable {
+ "dest=host" rust
+ } }
+ check_calls {
+ "remote_exec host" U { 2 {found-rustc foo.rs -lm -Tmvme.ld -o foo} }
+ }
+ }
+ { "override destination to host and compile and link Rust with host-rustc"
+ { default_target_compile "foo.rs" "foo" executable {
+ "dest=host" rust "compiler=host-rustc"
+ } }
+ check_calls {
+ "remote_exec host" U { 2 {host-rustc foo.rs -lm -Tmvme.ld -o foo} }
+ }
+ }
+
}
# mock [file exists ...] in slave interpreter for testing libs= option