This patch is the first one of a series of patches aiming to support to build llvm toolchain(compiler, tools, libraries) with CET enabled. Currently, CET has been implemented in x86 Linux target and in order to compile source code with CET enabled, "-fcf-protection=full" should be added. CET introduces 'IBT' which restricts the target of indirect jumps and 'SHSTK' is also introduced which aims to check the return address when a function is going to return to caller. This patch introduces the option "LLVM_BUILD_CET_ENABLE", if you want to build compiler and libraries with CET enabled, you can set this option to ON:
cmake -G "Unix Makefiles" -DLLVM_BUILD_CET_ENABLE=ON ...
The default value is OFF. Not all subprojects support building with CET, so we don't add any CET build option in this patch. For those subprojects which have already supported CET, they can add CET building option based on "LLVM_BUILD_CET_ENABLE" option.
Details
Details
Diff Detail
Diff Detail
Unit Tests
Unit Tests
Event Timeline
llvm/cmake/modules/HandleLLVMOptions.cmake | ||
---|---|---|
372 ↗ | (On Diff #357113) | I am not an expert in CMake but I think we need to add support for this option per subproject as well since the projects can be built independent of LLVM e.g. : compiler-rt, libcxx, libcxxbi, libunwind can be built separately without compiling llvm. |
llvm/cmake/modules/HandleLLVMOptions.cmake | ||
---|---|---|
372 ↗ | (On Diff #357113) | Hi, @manojgupta |