targets: add CPU property everywhere

This is for consistency with Clang, which always adds a CPU flag even if
it's not specified in CFLAGS.

This commit also adds some tests to make sure the Clang target-cpu
matches the CPU property in the JSON files.

This does have an effect on the generated binaries. The effect is very
small though: on average just 0.2% increase in binary size, apparently
because Cortex-M3 and Cortex-M4 are compiled a bit differently. However,
when rebased on top of https://github.com/tinygo-org/tinygo/pull/2218
(minsize), the difference drops to -0.1% (a slight decrease on average).
This commit is contained in:
Ayke van Laethem
2021-11-01 19:11:04 +01:00
committed by Ron Evans
parent c2165f74d8
commit 29206cf0a4
21 changed files with 174 additions and 28 deletions
-3
View File
@@ -6,9 +6,6 @@
"serial": "uart",
"linker": "xtensa-esp32-elf-ld",
"default-stack-size": 2048,
"cflags": [
"-mcpu=esp32"
],
"rtlib": "compiler-rt",
"libc": "picolibc",
"linkerscript": "targets/esp32.ld",