mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 16:33:40 +00:00
Fix cross-Linux setup on non-amd64 arches
In that case, an emulator is needed for amd64, and tests should be run for amd64 as a _cross_ test.
This commit is contained in:
committed by
Ayke
parent
ac7e370c72
commit
010cc13e9e
+14
-5
@@ -317,11 +317,20 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) {
|
||||
if goarch != runtime.GOARCH {
|
||||
// Some educated guesses as to how to invoke helper programs.
|
||||
spec.GDB = []string{"gdb-multiarch"}
|
||||
if goarch == "arm" && goos == "linux" {
|
||||
spec.Emulator = []string{"qemu-arm"}
|
||||
}
|
||||
if goarch == "arm64" && goos == "linux" {
|
||||
spec.Emulator = []string{"qemu-aarch64"}
|
||||
if goos == "linux" {
|
||||
switch goarch {
|
||||
case "386":
|
||||
// amd64 can _usually_ run 32-bit programs, so skip the emulator in that case.
|
||||
if runtime.GOARCH != "amd64" {
|
||||
spec.Emulator = []string{"qemu-i386"}
|
||||
}
|
||||
case "amd64":
|
||||
spec.Emulator = []string{"qemu-x86_64"}
|
||||
case "arm":
|
||||
spec.Emulator = []string{"qemu-arm"}
|
||||
case "arm64":
|
||||
spec.Emulator = []string{"qemu-aarch64"}
|
||||
}
|
||||
}
|
||||
}
|
||||
if goos != runtime.GOOS {
|
||||
|
||||
Reference in New Issue
Block a user