tinygo/builder
Ayke van Laethem 603fff78d4 all: add support for ThinLTO
ThinLTO optimizes across LLVM modules at link time. This means that
optimizations (such as inlining and const-propagation) are possible
between C and Go. This makes this change especially useful for CGo, but
not just for CGo. By doing some optimizations at link time, the linker
can discard some unused functions and this leads to a size reduction on
average. It does increase code size in some cases, but that's true for
most optimizations.

I've excluded a number of targets for now (wasm, avr, xtensa, windows,
macos). They can probably be supported with some more work, but that
should be done in separate PRs.

Overall, this change results in an average 3.24% size reduction over all
the tinygo.org/x/drivers smoke tests.

TODO: this commit runs part of the pass pipeline twice. We should set
the PrepareForThinLTO flag in the PassManagerBuilder for even further
reduced code size (0.7%) and improved compilation speed.
2022-03-12 12:55:38 +01:00
..
ar.go all: add support for windows/amd64 2021-11-16 11:08:30 +01:00
build.go all: add support for ThinLTO 2022-03-12 12:55:38 +01:00
builder_test.go targets: change LLVM features to match vanilla Clang 2021-11-20 02:48:23 +01:00
buildid.go builder: prefer GNU build ID over Go build ID 2022-01-27 18:38:40 +01:00
builtins.go builder: build static binaries using musl on Linux 2021-11-04 17:15:38 +01:00
cc.go all: add support for ThinLTO 2022-03-12 12:55:38 +01:00
cc1as.cpp all: switch to LLVM 13 2022-01-09 11:04:10 +01:00
cc1as.h all: switch to LLVM 13 2022-01-09 11:04:10 +01:00
cc_test.go builder: cache C and assembly file outputs 2021-04-05 20:52:04 +02:00
clang.cpp all: switch to LLVM 11 for static builds 2020-12-10 07:01:32 +01:00
commands.go feat: support build on darwin arm64 (#2439) 2022-01-12 12:10:08 +01:00
config.go main: test other architectures by specifying a different GOARCH 2021-10-04 18:22:55 +02:00
darwin-libsystem.go builder: add support for cross compiling to Darwin 2022-02-12 15:33:06 +01:00
elfpatch.go rp2040: patch elf to checksum 2nd stage boot 2021-06-17 12:10:04 +02:00
env.go builder (env): update clang header search path to look in /usr/lib 2022-01-09 18:46:15 +01:00
error.go compiler: add location information to the IR checker 2019-12-21 20:49:51 +01:00
esp.go esp32c3: add support for this chip 2021-09-16 20:13:04 +02:00
jobs.go builder: refactor job runner and use a shared semaphore across build jobs 2021-12-30 12:03:12 -05:00
library.go arm: Explicitly disable unwind tables 2022-01-14 07:34:36 +01:00
lld.cpp builder: add support for cross compiling to Darwin 2022-02-12 15:33:06 +01:00
mingw-w64.go all: add support for windows/amd64 2021-11-16 11:08:30 +01:00
musl.go builder (musl): add -fno-stack-protector 2022-01-09 18:46:15 +01:00
nrfutil.go support flashing pca10059 from windows 2021-06-08 14:17:04 +02:00
objcopy.go main: add initial support for (in-development) LLVM 11 2020-10-13 20:23:50 +02:00
picolibc.go all: switch to LLVM 13 2022-01-09 11:04:10 +01:00
sizes.go builder: fix off-by-one in size calculation 2021-11-19 12:14:32 +01:00
tools-builtin.go builder: add support for cross compiling to Darwin 2022-02-12 15:33:06 +01:00
tools-external.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
tools.go main: implement tinygo lldb subcommand 2021-10-05 06:26:21 +02:00
uf2.go all: fix staticcheck warnings 2021-09-27 15:47:12 +02:00