arm: make FPU configuraton consistent

Eventually we might want to start using the FPU, but the easy option
right now is to simply disable it everywhere. Previously, it depended on
whether Clang was built as part of TinyGo or it was an external binary.
By setting the floating point mode explicitly, such inconsistencies are
avoided.

This commit creates a new cortex-m4 target which can be the central
place for setting FPU-related settings across all Cortex-M4 chips.
This commit is contained in:
Ayke van Laethem
2020-05-12 20:45:58 +02:00
committed by Ron Evans
parent 3c55689566
commit 9f4459cee1
8 changed files with 15 additions and 21 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ func (l *Library) Load(target string) (path string, err error) {
// Precalculate the flags to the compiler invocation.
args := append(l.cflags(), "-c", "-Oz", "-g", "-ffunction-sections", "-fdata-sections", "-Wno-macro-redefined", "--target="+target, "-fdebug-prefix-map="+dir+"="+remapDir)
if strings.HasPrefix(target, "arm") || strings.HasPrefix(target, "thumb") {
args = append(args, "-fshort-enums", "-fomit-frame-pointer")
args = append(args, "-fshort-enums", "-fomit-frame-pointer", "-mfloat-abi=soft")
}
if strings.HasPrefix(target, "riscv32-") {
args = append(args, "-march=rv32imac", "-mabi=ilp32", "-fforce-enable-int128")
+1 -3
View File
@@ -1,9 +1,7 @@
{
"inherits": ["cortex-m"],
"llvm-target": "armv7em-none-eabi",
"inherits": ["cortex-m4"],
"build-tags": ["atsamd51g19", "atsamd51", "sam"],
"cflags": [
"--target=armv7em-none-eabi",
"-Qunused-arguments"
],
"linkerscript": "targets/atsamd51.ld",
+1 -3
View File
@@ -1,9 +1,7 @@
{
"inherits": ["cortex-m"],
"llvm-target": "armv7em-none-eabi",
"inherits": ["cortex-m4"],
"build-tags": ["atsamd51j19", "atsamd51", "sam"],
"cflags": [
"--target=armv7em-none-eabi",
"-Qunused-arguments"
],
"linkerscript": "targets/atsamd51.ld",
+1 -3
View File
@@ -1,9 +1,7 @@
{
"inherits": ["cortex-m"],
"llvm-target": "armv7em-none-eabi",
"inherits": ["cortex-m4"],
"build-tags": ["sam", "atsamd51", "atsamd51j20", "atsamd51j20a"],
"cflags": [
"--target=armv7em-none-eabi",
"-Qunused-arguments"
],
"linkerscript": "targets/atsamd51j20a.ld",
+8
View File
@@ -0,0 +1,8 @@
{
"inherits": ["cortex-m"],
"llvm-target": "armv7em-none-eabi",
"cflags": [
"--target=armv7em-none-eabi",
"-mfloat-abi=soft"
]
}
+1 -4
View File
@@ -1,10 +1,7 @@
{
"inherits": ["cortex-m"],
"llvm-target": "armv7em-none-eabi",
"inherits": ["cortex-m4"],
"build-tags": ["nrf52", "nrf"],
"cflags": [
"--target=armv7em-none-eabi",
"-mfloat-abi=soft",
"-Qunused-arguments",
"-DNRF52832_XXAA",
"-I{root}/lib/CMSIS/CMSIS/Include",
+1 -4
View File
@@ -1,10 +1,7 @@
{
"inherits": ["cortex-m"],
"llvm-target": "armv7em-none-eabi",
"inherits": ["cortex-m4"],
"build-tags": ["nrf52840", "nrf"],
"cflags": [
"--target=armv7em-none-eabi",
"-mfloat-abi=soft",
"-Qunused-arguments",
"-DNRF52840_XXAA",
"-I{root}/lib/CMSIS/CMSIS/Include",
+1 -3
View File
@@ -1,9 +1,7 @@
{
"inherits": ["cortex-m"],
"llvm-target": "armv7em-none-eabi",
"inherits": ["cortex-m4"],
"build-tags": ["stm32f4disco", "stm32f407", "stm32"],
"cflags": [
"--target=armv7em-none-eabi",
"-Qunused-arguments"
],
"linkerscript": "targets/stm32f407.ld",