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.
Этот коммит содержится в:
родитель
3c55689566
коммит
9f4459cee1
8 изменённых файлов: 15 добавлений и 21 удалений
|
@ -69,7 +69,7 @@ func (l *Library) Load(target string) (path string, err error) {
|
||||||
// Precalculate the flags to the compiler invocation.
|
// 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)
|
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") {
|
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-") {
|
if strings.HasPrefix(target, "riscv32-") {
|
||||||
args = append(args, "-march=rv32imac", "-mabi=ilp32", "-fforce-enable-int128")
|
args = append(args, "-march=rv32imac", "-mabi=ilp32", "-fforce-enable-int128")
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
{
|
{
|
||||||
"inherits": ["cortex-m"],
|
"inherits": ["cortex-m4"],
|
||||||
"llvm-target": "armv7em-none-eabi",
|
|
||||||
"build-tags": ["atsamd51g19", "atsamd51", "sam"],
|
"build-tags": ["atsamd51g19", "atsamd51", "sam"],
|
||||||
"cflags": [
|
"cflags": [
|
||||||
"--target=armv7em-none-eabi",
|
|
||||||
"-Qunused-arguments"
|
"-Qunused-arguments"
|
||||||
],
|
],
|
||||||
"linkerscript": "targets/atsamd51.ld",
|
"linkerscript": "targets/atsamd51.ld",
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
{
|
{
|
||||||
"inherits": ["cortex-m"],
|
"inherits": ["cortex-m4"],
|
||||||
"llvm-target": "armv7em-none-eabi",
|
|
||||||
"build-tags": ["atsamd51j19", "atsamd51", "sam"],
|
"build-tags": ["atsamd51j19", "atsamd51", "sam"],
|
||||||
"cflags": [
|
"cflags": [
|
||||||
"--target=armv7em-none-eabi",
|
|
||||||
"-Qunused-arguments"
|
"-Qunused-arguments"
|
||||||
],
|
],
|
||||||
"linkerscript": "targets/atsamd51.ld",
|
"linkerscript": "targets/atsamd51.ld",
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
{
|
{
|
||||||
"inherits": ["cortex-m"],
|
"inherits": ["cortex-m4"],
|
||||||
"llvm-target": "armv7em-none-eabi",
|
|
||||||
"build-tags": ["sam", "atsamd51", "atsamd51j20", "atsamd51j20a"],
|
"build-tags": ["sam", "atsamd51", "atsamd51j20", "atsamd51j20a"],
|
||||||
"cflags": [
|
"cflags": [
|
||||||
"--target=armv7em-none-eabi",
|
|
||||||
"-Qunused-arguments"
|
"-Qunused-arguments"
|
||||||
],
|
],
|
||||||
"linkerscript": "targets/atsamd51j20a.ld",
|
"linkerscript": "targets/atsamd51j20a.ld",
|
||||||
|
|
8
targets/cortex-m4.json
Обычный файл
8
targets/cortex-m4.json
Обычный файл
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"inherits": ["cortex-m"],
|
||||||
|
"llvm-target": "armv7em-none-eabi",
|
||||||
|
"cflags": [
|
||||||
|
"--target=armv7em-none-eabi",
|
||||||
|
"-mfloat-abi=soft"
|
||||||
|
]
|
||||||
|
}
|
|
@ -1,10 +1,7 @@
|
||||||
{
|
{
|
||||||
"inherits": ["cortex-m"],
|
"inherits": ["cortex-m4"],
|
||||||
"llvm-target": "armv7em-none-eabi",
|
|
||||||
"build-tags": ["nrf52", "nrf"],
|
"build-tags": ["nrf52", "nrf"],
|
||||||
"cflags": [
|
"cflags": [
|
||||||
"--target=armv7em-none-eabi",
|
|
||||||
"-mfloat-abi=soft",
|
|
||||||
"-Qunused-arguments",
|
"-Qunused-arguments",
|
||||||
"-DNRF52832_XXAA",
|
"-DNRF52832_XXAA",
|
||||||
"-I{root}/lib/CMSIS/CMSIS/Include",
|
"-I{root}/lib/CMSIS/CMSIS/Include",
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
{
|
{
|
||||||
"inherits": ["cortex-m"],
|
"inherits": ["cortex-m4"],
|
||||||
"llvm-target": "armv7em-none-eabi",
|
|
||||||
"build-tags": ["nrf52840", "nrf"],
|
"build-tags": ["nrf52840", "nrf"],
|
||||||
"cflags": [
|
"cflags": [
|
||||||
"--target=armv7em-none-eabi",
|
|
||||||
"-mfloat-abi=soft",
|
|
||||||
"-Qunused-arguments",
|
"-Qunused-arguments",
|
||||||
"-DNRF52840_XXAA",
|
"-DNRF52840_XXAA",
|
||||||
"-I{root}/lib/CMSIS/CMSIS/Include",
|
"-I{root}/lib/CMSIS/CMSIS/Include",
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
{
|
{
|
||||||
"inherits": ["cortex-m"],
|
"inherits": ["cortex-m4"],
|
||||||
"llvm-target": "armv7em-none-eabi",
|
|
||||||
"build-tags": ["stm32f4disco", "stm32f407", "stm32"],
|
"build-tags": ["stm32f4disco", "stm32f407", "stm32"],
|
||||||
"cflags": [
|
"cflags": [
|
||||||
"--target=armv7em-none-eabi",
|
|
||||||
"-Qunused-arguments"
|
"-Qunused-arguments"
|
||||||
],
|
],
|
||||||
"linkerscript": "targets/stm32f407.ld",
|
"linkerscript": "targets/stm32f407.ld",
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче