arm: switch to hardfloat ABI for Linux
This avoids an error on the Raspberry Pi 3.
Этот коммит содержится в:
родитель
1c68da89af
коммит
9b4071237f
3 изменённых файлов: 11 добавлений и 8 удалений
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
11
target.go
11
target.go
|
@ -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"
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче