From 66f648d0870286540511846f69a101e24dbe92c1 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sat, 8 Nov 2025 02:13:31 +0000 Subject: compilers: support GCC incremental LTO GCC 15 supports incremental LTO (caching). It's the same feature as Clang's ThinLTO caching. Unfortunately, for the Clang ThinLTO cache support, we chose a pretty vendor-specific option name, and I don't want to worry about deprecating that (-Db_thinlto_cache and -Db_thinlto_cache_dir) at this time, so... Wire -Db_thinlto_cache and -Db_thinlto_cache_dir for GCC in the obvious and natural way. Other notes: * GCC, unlike Clang, requires the cache dir to exist. If the user passes an invalid directory, that's on them, but for our default in meson-private, we should os.mkdir() it, so we do that now too. * I did wonder about adding -flto-partition=cache, but when I asked about this last year [0], the response was that it has too many caveats. Though Honza did recently [1] suggest it has some utility, so I don't know. I'll ask about it. [0] https://inbox.sourceware.org/gcc-patches/vjeanwm7b2jnedzmbwww4cy6jf4prty6ypxvz7x5d463xw2mys@bxzxuvgfaplf/ [1] https://inbox.sourceware.org/gcc-patches/aLnAGpln6SXbjV7e@kam.mff.cuni.cz/ Closes: https://github.com/mesonbuild/meson/issues/14428 --- docs/markdown/snippets/gcc_incremental_lto.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 docs/markdown/snippets/gcc_incremental_lto.md (limited to 'docs') diff --git a/docs/markdown/snippets/gcc_incremental_lto.md b/docs/markdown/snippets/gcc_incremental_lto.md new file mode 100644 index 000000000..50bb21837 --- /dev/null +++ b/docs/markdown/snippets/gcc_incremental_lto.md @@ -0,0 +1,4 @@ +## `-Db_thinlto_cache` now supported for GCC + +`-Db_thinlto_cache` is now supported for GCC 15's incremental LTO, as is +`-Db_thinlto_cache_dir`. \ No newline at end of file -- cgit v1.2.3