aboutsummaryrefslogtreecommitdiffstats
path: root/sys/targets
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-01-17 17:41:51 +0100
committerAleksandr Nogikh <wp32pw@gmail.com>2023-01-18 11:21:44 +0100
commit4620c2d9bc4fb639aa971d619b0735e9406371b5 (patch)
tree08ce470960a7bc5c3e61c5f2ef2a31f050d67114 /sys/targets
parent6434079ffdc826cfd09b1cf754686ede638fa955 (diff)
sys/targets: take DataOffset from reference targets
For test targets, we curretly specialize a single FreeBSD/386 exception. But it's more robust to just copy the DataOffset value from the reference targets, especially now that we explicitly determine it.
Diffstat (limited to 'sys/targets')
-rw-r--r--sys/targets/targets.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index 7d10dfc04..1e19cfe88 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -640,6 +640,8 @@ func init() {
target.CPP = host.CPP
target.CFlags = append(append([]string{}, host.CFlags...), target.CFlags...)
target.CFlags = processMergedFlags(target.CFlags)
+ // At least FreeBSD/386 requires a non-default DataOffset value.
+ target.DataOffset = host.DataOffset
// In ESA/390 mode, the CPU is able to address only 31bit of memory but
// arithmetic operations are still 32bit
// Fix cflags by replacing compiler's -m32 option with -m31
@@ -648,13 +650,6 @@ func init() {
target.CFlags[i] = strings.Replace(target.CFlags[i], "-m32", "-m31", -1)
}
}
- if target.PtrSize == 4 && goos == FreeBSD && arch == AMD64 {
- // A hack to let 32-bit "test" target tests run on FreeBSD:
- // freebsd/386 requires a non-default DataOffset to avoid
- // clobbering mappings created by the C runtime. Since that is the
- // only target with this constraint, just special-case it for now.
- target.DataOffset = List[goos][I386].DataOffset
- }
target.BuildOS = goos
}
}