aboutsummaryrefslogtreecommitdiffstats
path: root/sys/fuchsia
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fuchsia')
-rw-r--r--sys/fuchsia/fidlgen/main.go15
-rw-r--r--sys/fuchsia/init.go3
2 files changed, 11 insertions, 7 deletions
diff --git a/sys/fuchsia/fidlgen/main.go b/sys/fuchsia/fidlgen/main.go
index 937ef62d1..ab2bcf0cd 100644
--- a/sys/fuchsia/fidlgen/main.go
+++ b/sys/fuchsia/fidlgen/main.go
@@ -19,17 +19,20 @@ import (
)
func main() {
+ targetOS := os.Getenv("TARGETOS")
targetArch := os.Getenv("TARGETARCH")
- target := targets.Get(targets.Fuchsia, targetArch)
- if target == nil {
- tool.Failf("unknown TARGETARCH %s", targetArch)
- }
- arch := target.KernelHeaderArch
-
sourceDir := os.Getenv("SOURCEDIR")
+ if targetOS != targets.Fuchsia || sourceDir == "" {
+ return
+ }
if !osutil.IsExist(sourceDir) {
tool.Failf("cannot find SOURCEDIR %s", sourceDir)
}
+ target := targets.Get(targetOS, targetArch)
+ if target == nil {
+ tool.Failf("unknown TARGETARCH %s", targetArch)
+ }
+ arch := target.KernelHeaderArch
fidlgenPath := filepath.Join(
sourceDir,
diff --git a/sys/fuchsia/init.go b/sys/fuchsia/init.go
index 2fbbd4bdf..c3ca8ca9b 100644
--- a/sys/fuchsia/init.go
+++ b/sys/fuchsia/init.go
@@ -1,7 +1,8 @@
// Copyright 2017 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
-//go:generate go run fidlgen/main.go
+//go:generate bash -c "TARGETARCH=amd64 go run fidlgen/main.go"
+//go:generate bash -c "TARGETARCH=arm64 go run fidlgen/main.go"
package fuchsia