Created attachment 859354 [details] Output of emerge --info When compiling clang new slot 16 fails to build with the next error CMake Error at CMakeLists.txt:270 (message): Cannot set CLANG_LINK_CLANG_DYLIB=ON when LLVM_LINK_LLVM_DYLIB=OFF I have recompiled llvm to make sure that -DLLVM_LINK_LLVM_DYLIB was passed as ON, and it was, but for whatever reason clang keeps outputing an error telling that it's off
Please always include the full build.log.
I have tried to make an attachment with the complete build log but it fails to submit, I will append it asap.
Created attachment 859897 [details] complete build log
CMake Error at CMakeLists.txt:270 (message): Cannot set CLANG_LINK_CLANG_DYLIB=ON when LLVM_LINK_LLVM_DYLIB=OFF -- Configuring incomplete, errors occurred! [31;01m*[0m ERROR: sys-devel/clang-16.0.1::gentoo failed (configure phase): [31;01m*[0m cmake failed
$ grep -RH LLVM_LINK_LLVM /usr/lib/llvm/*/lib*/cmake/llvm/LLVMConfig.cmake plz.
(In reply to Michał Górny from comment #5) > $ grep -RH LLVM_LINK_LLVM /usr/lib/llvm/*/lib*/cmake/llvm/LLVMConfig.cmake > > plz. It's quite brief, but I will add it as an attachment anyways. /usr/lib/llvm/14/lib64/cmake/llvm/LLVMConfig.cmake:set(LLVM_LINK_LLVM_DYLIB ON) /usr/lib/llvm/14/lib/cmake/llvm/LLVMConfig.cmake:set(LLVM_LINK_LLVM_DYLIB ON) /usr/lib/llvm/15/lib64/cmake/llvm/LLVMConfig.cmake:set(LLVM_LINK_LLVM_DYLIB ON) /usr/lib/llvm/15/lib/cmake/llvm/LLVMConfig.cmake:set(LLVM_LINK_LLVM_DYLIB ON) /usr/lib/llvm/16/lib64/cmake/llvm/LLVMConfig.cmake:set(LLVM_LINK_LLVM_DYLIB ON) /usr/lib/llvm/16/lib/cmake/llvm/LLVMConfig.cmake:set(LLVM_LINK_LLVM_DYLIB ON)
Created attachment 859935 [details] grep of LLVMConfig.cmake
Created attachment 859941 [details, diff] debug1.patch I'm afraid I have no clue what's happening here. Clearly the .cmake files have the correct value, and clang doesn't override it anywhere. Try using the attached patch (debug1.patch). It should cause CMake to fail with the value of LLVM_LINK_LLVM_DYLIB after LLVMConfig.cmake is supposedly loaded. On my system, it prints: CMake Error at CMakeLists.txt:39 (message): ON -- Configuring incomplete, errors occurred!
Seems to be unset, because it's not printing any value CMake Error at CMakeLists.txt:39 (message): -- Configuring incomplete, errors occurred! and the patch is correctly applied * Applying user patches from /etc/portage/patches ... * Applying debug1.patch ... [ ok ] * User patches applied. I will upload the complete build log of the patch anyways in case it's useful
Created attachment 859962 [details] Complete build log with the debug1.patch applied
Also, I have been looking in the work/clang/CMakeLists.txt and the patch seems correctly aplied mark_as_advanced(LLVM_ENABLE_ASSERTIONS) endif() find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}") message(FATAL_ERROR ${LLVM_LINK_LLVM_DYLIB}) list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}") # Turn into CACHE PATHs for overwritting
I didn't knew I could patch files from the package I was going to install before you mentioned it. I have been messing around with the patch and printing some vars and now I think I know what happens. I printed this stuff message(FATAL_ERROR "${LLVM_LINK_LLVM_DYLIB} ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH} @ ${LLVM_DIR} @ ${LLVM_CMAKE_DIR}") And this is what got printed 16.0.0 @ /opt/llvmv7emhf/lib/cmake/llvm @ /opt/llvmv7emhf/lib/cmake/llvm I don't really know if this is made by crossdev or it was me messing with llvm, i might move it and try the system to see if nothing complains and then proceed to delete it
Once I moved it, without removing the patch, this is the output message ON 16.0.1 @ /usr/lib/llvm/16/lib/cmake/llvm @ /usr/lib/llvm/16/lib/cmake/llvm I checked the reverse dependencies of llvm:16 just in case I had to recompile any package (there were none) and now it's compiling already. Thank you very much, for the help and for what you taught me, For me this can be marked as resolved.
I'm guessing PEBKAC then. You really shouldn't be putting custom stuff in PATH ahead of system stuff.