musl >= 1.2.4 only defines lseek64 and friends if _LARGEFILE64_SOURCE is defined. This causes the symbol check to "succeed" but compilation to later fail. --- llvm-14.0.6.src/cmake/config-ix.cmake.old 2022-06-22 11:46:24.000000000 -0500 +++ llvm-14.0.6.src/cmake/config-ix.cmake 2023-05-05 21:36:46.662084291 -0500 @@ -250,9 +250,7 @@ if( HAVE_SIGNAL_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*" AND NOT APPLE ) check_symbol_exists(sigaltstack signal.h HAVE_SIGALTSTACK) endif() -set(CMAKE_REQUIRED_DEFINITIONS "-D_LARGEFILE64_SOURCE") check_symbol_exists(lseek64 "sys/types.h;unistd.h" HAVE_LSEEK64) -set(CMAKE_REQUIRED_DEFINITIONS "") check_symbol_exists(mallctl malloc_np.h HAVE_MALLCTL) check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO) check_symbol_exists(mallinfo2 malloc.h HAVE_MALLINFO2)