aboutsummaryrefslogtreecommitdiffhomepage
path: root/targets/cortex-m33.json
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2021-09-22 00:26:53 +0200
committerRon Evans <[email protected]>2021-09-28 18:44:11 +0200
commitbf9dab36f757eafbf5858784d14e4c0e96fbca9d (patch)
tree9825c5e97909610957509ea34af6f0f6fa5d2cb4 /targets/cortex-m33.json
parent6234bf9a88e26636f8867ff71ca986be952ea780 (diff)
downloadtinygo-bf9dab36f757eafbf5858784d14e4c0e96fbca9d.tar.gz
tinygo-bf9dab36f757eafbf5858784d14e4c0e96fbca9d.zip
build: normalize target triples to match Clang
This commit changes a target triple like "armv6m-none-eabi" to "armv6m-unknown-unknow-eabi". The reason is that while the former is correctly parsed in Clang (due to normalization), it wasn't parsed correctly in LLVM meaning that the environment wasn't set to EABI. This change normalizes all target triples and uses the EABI environment (-eabi in the triple) for Cortex-M targets. This change also drops the `--target=` flag in the target JSON files, the flag is now added implicitly in `(*compileopts.Config).CFlags()`. This removes some duplication in target JSON files. Unfortunately, this change also increases code size for Cortex-M targets. It looks like LLVM now emits calls like __aeabi_memmove instead of memmove, which pull in slightly more code (they basically just call the regular C functions) and the calls themself don't seem to be as efficient as they could be. Perhaps this is a LLVM bug that will be fixed in the future, as this is a very common occurrence.
Diffstat (limited to 'targets/cortex-m33.json')
-rw-r--r--targets/cortex-m33.json3
1 files changed, 1 insertions, 2 deletions
diff --git a/targets/cortex-m33.json b/targets/cortex-m33.json
index db0f2516d..0dc79a5fc 100644
--- a/targets/cortex-m33.json
+++ b/targets/cortex-m33.json
@@ -1,8 +1,7 @@
{
"inherits": ["cortex-m"],
- "llvm-target": "armv7m-none-eabi",
+ "llvm-target": "armv7m-unknown-unknown-eabi",
"cflags": [
- "--target=armv7m-none-eabi",
"-mfloat-abi=soft"
]
}