arm: switch to hardfloat ABI for Linux

This avoids an error on the Raspberry Pi 3.
This commit is contained in:
Ayke van Laethem
2019-02-14 11:40:27 +01:00
committed by Ron Evans
parent 1c68da89af
commit 9b4071237f
3 changed files with 11 additions and 8 deletions
+7 -4
View File
@@ -162,6 +162,9 @@ func LoadTarget(target string) (*TargetSpec, error) {
llvmarch = goarch
}
target = llvmarch + "--" + llvmos
if goarch == "arm" {
target += "-gnueabihf"
}
return defaultTarget(goos, goarch, target)
}
@@ -226,10 +229,10 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) {
if goarch != runtime.GOARCH {
// Some educated guesses as to how to invoke helper programs.
if goarch == "arm" && goos == "linux" {
spec.Linker = "arm-linux-gnueabi-gcc"
spec.Objcopy = "arm-linux-gnueabi-objcopy"
spec.GDB = "arm-linux-gnueabi-gdb"
spec.Emulator = []string{"qemu-arm", "-L", "/usr/arm-linux-gnueabi"}
spec.Linker = "arm-linux-gnueabihf-gcc"
spec.Objcopy = "arm-linux-gnueabihf-objcopy"
spec.GDB = "arm-linux-gnueabihf-gdb"
spec.Emulator = []string{"qemu-arm", "-L", "/usr/arm-linux-gnueabihf"}
}
if goarch == "arm64" && goos == "linux" {
spec.Linker = "aarch64-linux-gnu-gcc"