aboutsummaryrefslogtreecommitdiffstats
path: root/sys/targets
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-12-23 08:46:10 +0100
committerDmitry Vyukov <dvyukov@google.com>2019-12-23 08:57:42 +0100
commit4b042b7d6708cae4cb29fa41b89deea14b2eea32 (patch)
treee624c19095860d2901d0a9094b7269a6c31e79d7 /sys/targets
parent61f4e7ee54a1a1ae938c8ab2ee18bf16da1abab4 (diff)
sys/linux: fix int64 alignment on 386
Turns out int64 alignment is 4 on 386... But on arm it's still 8. Another amusing finding thanks to syz-check. Update #590
Diffstat (limited to 'sys/targets')
-rw-r--r--sys/targets/targets.go20
1 files changed, 12 insertions, 8 deletions
diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index e1d5731d8..c4deb3fc6 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -22,6 +22,7 @@ type Target struct {
PageSize uint64
NumPages uint64
DataOffset uint64
+ Int64Alignment uint64
CFlags []string
CrossCFlags []string
CCompilerPrefix string
@@ -105,10 +106,11 @@ var List = map[string]map[string]*Target{
},
},
"32_shmem": {
- PtrSize: 4,
- PageSize: 8 << 10,
- CFlags: []string{"-m32"},
- CrossCFlags: []string{"-m32", "-static"},
+ PtrSize: 4,
+ PageSize: 8 << 10,
+ Int64Alignment: 4,
+ CFlags: []string{"-m32"},
+ CrossCFlags: []string{"-m32", "-static"},
osCommon: osCommon{
SyscallNumbers: true,
SyscallPrefix: "SYS_",
@@ -150,6 +152,7 @@ var List = map[string]map[string]*Target{
VMArch: "amd64",
PtrSize: 4,
PageSize: 4 << 10,
+ Int64Alignment: 4,
CFlags: []string{"-m32"},
CrossCFlags: []string{"-m32", "-static"},
CCompilerPrefix: "x86_64-linux-gnu-",
@@ -207,10 +210,11 @@ var List = map[string]map[string]*Target{
NeedSyscallDefine: dontNeedSyscallDefine,
},
"386": {
- VMArch: "amd64",
- PtrSize: 4,
- PageSize: 4 << 10,
- CFlags: []string{"-m32"},
+ VMArch: "amd64",
+ PtrSize: 4,
+ PageSize: 4 << 10,
+ Int64Alignment: 4,
+ CFlags: []string{"-m32"},
// The story behind -B/usr/lib32 is not completely clear, but it helps in some cases.
// For context see discussion in https://github.com/google/syzkaller/pull/1202
CrossCFlags: []string{"-m32", "-static", "-B/usr/lib32"},