mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 10:37:46 +00:00
arm: switch to hardfloat ABI for Linux
This avoids an error on the Raspberry Pi 3.
This commit is contained in:
committed by
Ron Evans
parent
1c68da89af
commit
9b4071237f
+2
-2
@@ -18,9 +18,9 @@ addons:
|
||||
- llvm-7-dev
|
||||
- clang-7
|
||||
- libclang-7-dev
|
||||
- gcc-arm-linux-gnueabi
|
||||
- gcc-arm-linux-gnueabihf
|
||||
- binutils-arm-none-eabi
|
||||
- libc6-dev-armel-cross
|
||||
- libc6-dev-armhf-cross
|
||||
- gcc-aarch64-linux-gnu
|
||||
- libc6-dev-arm64-cross
|
||||
- qemu-system-arm
|
||||
|
||||
+2
-2
@@ -68,7 +68,7 @@ func TestCompiler(t *testing.T) {
|
||||
continue // TODO: improve CGo
|
||||
}
|
||||
t.Run(path, func(t *testing.T) {
|
||||
runTest(path, tmpdir, "arm--linux-gnueabi", t)
|
||||
runTest(path, tmpdir, "arm--linux-gnueabihf", t)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ func TestCompiler(t *testing.T) {
|
||||
continue // TODO: improve CGo
|
||||
}
|
||||
t.Run(path, func(t *testing.T) {
|
||||
runTest(path, tmpdir, "aarch64--linux-gnueabi", t)
|
||||
runTest(path, tmpdir, "aarch64--linux-gnu", t)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user