aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-11-17 11:20:17 -0800
committerDmitry Vyukov <dvyukov@google.com>2018-11-17 11:42:22 -0800
commitd1a88510856c352db84d1b8ffa252c0a9ce30dec (patch)
treeb76c193cb11f94d1ae7532409e12d2255b43ee41 /pkg/csource
parent7d395878aa6d662c1880c5b2a7ab76378cc96b7f (diff)
sys/targest: introduce target.BuildOS
We can't cross-compile native binaries from just any OS to any other. For most OSes we can do only native compilation. Some can only be compiled from linux. To date we avoided this problem completely (mostly assumed linux build OS). Make this notion of what can build what explicit.
Diffstat (limited to 'pkg/csource')
-rw-r--r--pkg/csource/csource_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/csource/csource_test.go b/pkg/csource/csource_test.go
index 8545efba8..9743b6356 100644
--- a/pkg/csource/csource_test.go
+++ b/pkg/csource/csource_test.go
@@ -14,6 +14,7 @@ import (
"github.com/google/syzkaller/prog"
_ "github.com/google/syzkaller/sys"
+ "github.com/google/syzkaller/sys/targets"
)
func TestGenerate(t *testing.T) {
@@ -23,11 +24,10 @@ func TestGenerate(t *testing.T) {
}
t.Parallel()
for _, target := range prog.AllTargets() {
- switch target.OS {
- case "netbsd", "windows":
+ target := target
+ if runtime.GOOS != targets.Get(target.OS, target.Arch).BuildOS {
continue
}
- target := target
t.Run(target.OS+"/"+target.Arch, func(t *testing.T) {
if target.OS == "linux" && target.Arch == "arm" {
// This currently fails (at least with my arm-linux-gnueabihf-gcc-4.8) with: