I don't like running a totally separate build system within the AOSP build system. It takes a ridiculous amount of time and memory to link the Linux kernel with full LTO and it doesn't use kati so it doesn't handle incremental builds well so I really prefer the AOSP approach.
Conversation
Why LTO? Does it have extended hardening properties or is it just 3% optimizing non-bottlenecks?
2
Pixels build the kernels with Clang CFI which requires LTO. If you disable dynamic kernel modules, set -fvisibility=hidden as the default and avoid using ThinLTO, you get much better CFI granularity because it can see that nearly everything can't be indirectly called.
2
3
It's infuriating that this needs LTO because conceptually there's no reason it couldn't just be normal linking with some extended symbol markup.
1
Compiling vs linking is the most critical scalability boundary and compiler folks are determined to tear it down because they love their fancy toy (LTO) and keep building all the actually useful stuff on top of it to push it.
2
or maybe it's because linkers are borderline unusable if you do something that wasn't standard in 1980. i have fixed a GNU ld bug once, and i will never touch that codebase again
2
2
IIRC, GNU ld is literally a massively pile of shell scripts generating code with here docs. ld.gold is essentially dead by the way, was always somewhat broken / incomplete and shouldn't be used. LLD is the only way to go for something that works properly now.
1
3
there's some shell scripting involved but the bulk of my complaint is architectural, it seems to be implemented in an inefficient to extend way that makes less popular architectures prone to having obscure bugs
i didn't know it about gold. i like the gold link times :/
1
2
Google stopped working it and shifted focus to LLD. LLD is actually intended as a full replacement for the GNU linker, the macOS linker and the Windows linker. It has really good support for Windows too. It had working Windows support before Linux. It's a lot nicer than gold.
2
4
wait, can it be used with gcc? for reasons I'm sure you know, quite a few projects are using the gcc compiler driver as an entry point for distro specific linker options
1
2
ld.lld is a drop-in replacement for both ld.bfd and ld.gold similarly to how clang handles that with GCC.
If you do `ln -s /usr/bin/ld.lld lld-link && ./lld-link`, that's the drop-in replacement for Visual Studio's linker, similar to clang-cl.
1
4
I'm going to be so happy when all the GNU toolchain stuff is fully replaced because LLVM makes cross-compilation for any OS and architecture so trivial. As far as I can tell, you could compile and link a Windows executable using actual Windows libraries using it on Linux.
1
3
Show replies


