LLVM_ENABLE_MODULES builds on Linux

https://github.com/Trass3r/llvm-project/blob/modules-test/.github/workflows/CI.yml
I’ve been playing with modules-enabled builds a bit and would like to raise some awareness of this seemingly underrated feature. To my knowledge it’s mostly associated with/used/maintained on Mac with libc++.
But it works fine on Linux too and even with libstdc++ when using a proper modulemap (I tuned one from swift).

The build time savings for a release clang build are significant (OFF vs ON results, the tool is CompileScore):

Debug builds unfortunately don’t work due to linker errors: fix artifacts · Trass3r/llvm-project@b7f6c60 · GitHub
[-fmodules] linker errors when building llvm with libc++ · Issue #59064 · llvm/llvm-project · GitHub

1 Like