I can commit changes partially.
- Add -fmodules-ignore-macro (llvm-config, libclang)
Their -DMACROs don't change headers' behavior. Just let them ignored.
- Unittests
They use -frtti. I thought they may be built w/o modules. Any better idea?
- DynamicLibraryTests
It doesn't use add_llvm_library(). Give -fno-modules with target_compile_options().
- libFuzzer
It doesn't depend on LLVM libraries. Just suppressing with -fno-modules.
- LLVMgold
add_definitions( -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 )
It prevents reusing modules. I think they may be pruned since HandleLLVMOptions.cmake provides them conditionally.