aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/syz-extract/netbsd.go24
1 files changed, 19 insertions, 5 deletions
diff --git a/sys/syz-extract/netbsd.go b/sys/syz-extract/netbsd.go
index 04785d8b4..2be626249 100644
--- a/sys/syz-extract/netbsd.go
+++ b/sys/syz-extract/netbsd.go
@@ -25,17 +25,31 @@ func (*netbsd) prepare(sourcedir string, build bool, arches []string) error {
}
func (*netbsd) prepareArch(arch *Arch) error {
- if err := os.Symlink(filepath.Join(arch.sourceDir, "sys", "arch", "amd64", "include"),
- filepath.Join(arch.buildDir, "machine")); err != nil {
- return fmt.Errorf("failed to create link: %v", err)
+ links := [][2]string{
+ {"amd64", "machine"},
+ {"amd64", "amd64"},
+ {"x86", "x86"},
+ }
+ for _, v := range links {
+ if err := machineLink(arch, v[0], v[1]); err != nil {
+ return err
+ }
}
- if err := os.Symlink(filepath.Join(arch.sourceDir, "sys", "arch", "x86", "include"),
- filepath.Join(arch.buildDir, "x86")); err != nil {
+ return nil
+}
+
+func machineLink(arch *Arch, machine string, dest string) error {
+ if err := os.Symlink(machineInclude(arch, machine),
+ filepath.Join(arch.buildDir, dest)); err != nil {
return fmt.Errorf("failed to create link: %v", err)
}
return nil
}
+func machineInclude(arch *Arch, machine string) string {
+ return filepath.Join(arch.sourceDir, "sys", "arch", machine, "include")
+}
+
func (*netbsd) processFile(arch *Arch, info *compiler.ConstInfo) (map[string]uint64, map[string]bool, error) {
args := []string{
"-fmessage-length=0",