Similar to #31942 (comment), CMake caches the check failure, which leaves the user in a broken state (unless they nuke the build dir):
0cmake -B build -DAPPEND_CXXFLAGS="-ftrivial-auto-var-init"
1-- The CXX compiler identification is GNU 14.2.0
2-- Detecting CXX compiler ABI info
3-- Detecting CXX compiler ABI info - done
4-- Check for working CXX compiler: /usr/bin/c++ - skipped
5-- Detecting CXX compile features
6-- Detecting CXX compile features - done
7-- Setting build type to "RelWithDebInfo" as none was specified
8-- Performing Test CXX_SUPPORTS__WERROR
9-- Performing Test CXX_SUPPORTS__WERROR - Success
10-- Performing Test CXX_SUPPORTS__G3
11-- Performing Test CXX_SUPPORTS__G3 - Success
12-- Performing Test LINKER_SUPPORTS__G3
13-- Performing Test LINKER_SUPPORTS__G3 - Success
14-- Performing Test CXX_SUPPORTS__FTRAPV
15-- Performing Test CXX_SUPPORTS__FTRAPV - Success
16-- Performing Test LINKER_SUPPORTS__FTRAPV
17-- Performing Test LINKER_SUPPORTS__FTRAPV - Success
18-- Found SQLite3: /usr/include (found suitable version "3.45.1", minimum required is "3.7.17")
19CMake Warning at cmake/module/CheckLinkerSupportsPIE.cmake:24 (message):
20 PIE is not supported at link time. See the configure log for details.
21Call Stack (most recent call first):
22 CMakeLists.txt:203 (check_linker_supports_pie)
23
24
25-- Performing Test LINKER_SUPPORTS__WL___FATAL_WARNINGS
26-- Performing Test LINKER_SUPPORTS__WL___FATAL_WARNINGS - Failed
27-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
28-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
29-- Check if compiler accepts -pthread
30-- Check if compiler accepts -pthread - no
31-- Looking for pthread_create in pthreads
32-- Looking for pthread_create in pthreads - not found
33-- Looking for pthread_create in pthread
34-- Looking for pthread_create in pthread - not found
35CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
36 Could NOT find Threads (missing: Threads_FOUND)
37Call Stack (most recent call first):
38 /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
39 /usr/share/cmake-3.28/Modules/FindThreads.cmake:226 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
40 CMakeLists.txt:345 (find_package)
41
42
43-- Configuring incomplete, errors occurred!
Fix the compiler flag (forgot the =zero
), and reconfigure:
0 cmake -B build -DAPPEND_CXXFLAGS="-ftrivial-auto-var-init=zero"
1CMake Warning at cmake/module/CheckLinkerSupportsPIE.cmake:24 (message):
2 PIE is not supported at link time. See the configure log for details.
3Call Stack (most recent call first):
4 CMakeLists.txt:203 (check_linker_supports_pie)
5
6
7CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
8 Could NOT find Threads (missing: Threads_FOUND)
9Call Stack (most recent call first):
10 /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
11 /usr/share/cmake-3.28/Modules/FindThreads.cmake:226 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
12 CMakeLists.txt:345 (find_package)
13
14
15-- Configuring incomplete, errors occurred!