Description
I'm trying to build clang in Release
mode with LLVM_UNREACHABLE_OPTIMIZATIONS
turned off; however, the file AttrImpl.cpp
fails to compile. This happens in release/17.x
branch and main
.
cmake llvm \
-DLLVM_ENABLE_PROJECTS=clang \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_ASM_COMPILER=clang \
-DLLVM_UNREACHABLE_OPTIMIZE=OFF \
-B build
cd build/
make obj.clangAST
This seems due to the fact that on CMAKE_BUILD_TYPE=Release
+ LLVM_UNREACHABLE_OPTIMIZE=OFF
leads to
llvm-project/llvm/include/llvm/Support/ErrorHandling.h
Lines 151 to 154 in 6cbf6f5
AttrImpl.inc
) to not compile. All other variants work [(Release + LLVM_UNREACHABLE_OPTIMIZE=ON
), (Debug + LLVM_UNREACHABLE_OPTIMIZE=[ON|OFF]
)]
This is bisected to clang-tblgen
change b6d4d51#diff-58111c7c545672c3a67b1b31a37d4103b35d9c584a46c74b0be14cc37741491bR2642-R2646
Tested with both host toolchains clang 17.0.2
and gcc 13.2.0
For Rust specific issue: Rust defaults to LLVM_UNREACHABLE_OPTIMIZE=OFF
for all LLVM builds and this causes a regression when LLVM
is compiled in release mode. See rust-lang/rust#109373
Metadata
Metadata
Assignees
Type
Projects
Status