
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).
27 строки
625 Б
JSON
27 строки
625 Б
JSON
{
|
|
"llvm-target": "arm4-unknown-unknown-eabi",
|
|
"cpu": "arm7tdmi",
|
|
"build-tags": ["gameboyadvance", "arm7tdmi", "baremetal", "linux", "arm"],
|
|
"goos": "linux",
|
|
"goarch": "arm",
|
|
"linker": "ld.lld",
|
|
"rtlib": "compiler-rt",
|
|
"libc": "picolibc",
|
|
"cflags": [
|
|
"-Werror",
|
|
"-fshort-enums",
|
|
"-fomit-frame-pointer",
|
|
"-fno-exceptions", "-fno-unwind-tables",
|
|
"-ffunction-sections", "-fdata-sections"
|
|
],
|
|
"ldflags": [
|
|
"--gc-sections"
|
|
],
|
|
"linkerscript": "targets/gameboy-advance.ld",
|
|
"extra-files": [
|
|
"targets/gameboy-advance.s",
|
|
"src/runtime/gc_arm.S"
|
|
],
|
|
"gdb": ["gdb-multiarch"],
|
|
"emulator": ["mgba", "-3"]
|
|
}
|