main: improve support for x86-32 and add tests

To avoid breaking this, make sure we actually test x86-32 (aka i386 aka
GOARCH=386) support in CI.

Also remove the now-unnecessary binutils-arm-none-eabi package to speed
up CI a bit.
This commit is contained in:
Ayke van Laethem
2020-09-23 17:26:43 +02:00
committed by Ron Evans
parent 9a12d129ab
commit 05d2f2c412
3 changed files with 14 additions and 8 deletions
+4 -3
View File
@@ -215,6 +215,7 @@ func LoadTarget(target string) (*TargetSpec, error) {
}
goarch := map[string]string{ // map from LLVM arch to Go arch
"i386": "386",
"i686": "386",
"x86_64": "amd64",
"aarch64": "arm64",
"armv7": "arm",
@@ -260,9 +261,9 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) {
spec.GDB = "aarch64-linux-gnu-gdb"
spec.Emulator = []string{"qemu-aarch64", "-L", "/usr/aarch64-linux-gnu"}
}
if goarch == "386" {
spec.CFlags = []string{"-m32"}
spec.LDFlags = []string{"-m32"}
if goarch == "386" && runtime.GOARCH == "amd64" {
spec.CFlags = append(spec.CFlags, "-m32")
spec.LDFlags = append(spec.LDFlags, "-m32")
}
}
return &spec, nil