aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/targets/targets.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index 4f569a778..37737f16e 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -383,6 +383,13 @@ func init() {
for _, target := range List["test"] {
target.CCompiler = List[goos][runtime.GOARCH].CCompiler
target.CPP = List[goos][runtime.GOARCH].CPP
+ target.BuildOS = goos
+ if runtime.GOOS == "freebsd" && runtime.GOARCH == "amd64" && target.PtrSize == 4 {
+ // -m32 alone does not work on freebsd with gcc.
+ // TODO(dvyukov): consider switching to clang on freebsd instead.
+ target.CFlags = append(target.CFlags, "-B/usr/lib32")
+ target.CrossCFlags = append(target.CrossCFlags, "-B/usr/lib32")
+ }
}
}
@@ -410,9 +417,6 @@ func initTarget(target *Target, OS, arch string) {
if target.BuildOS == "" {
target.BuildOS = OS
}
- if OS == "test" {
- target.BuildOS = "linux"
- }
if runtime.GOOS != target.BuildOS {
// Spoil native binaries if they are not usable, so that nobody tries to use them later.
target.CCompiler = fmt.Sprintf("cant-build-%v-on-%v", target.OS, runtime.GOOS)