Precautions
- To add the -mllvm option, you need to add the prefix -Wl, to pass the option to a linker. For example, to add -mllvm -align-all-functions=8, change it to -Wl,-mllvm,-align-all-functions=8 when enabling LTO.
- The LTO principles determine that the product of the -c option is LLVM bitcode instead of ELF binary before the link. Therefore, ensure that the -flto option is added to the link step. Failure to do so may result in the symbol not being found (error message is similar to "undefined reference to xxx").
Parent topic: Link Time Optimization (LTO)