llvm-project
llvm-project copied to clipboard
LLVM 15.0.3 cmake file fails due to missing llvm-bolt
LLVMExports.cmake is "faulty", complaining of missing llvm-bolt install.
2022-10-12T10:16:43.1944691Z -- The C compiler identification is Clang 15.0.3
2022-10-12T10:16:43.3702543Z -- The CXX compiler identification is Clang 15.0.3
2022-10-12T10:16:43.4881695Z -- Detecting C compiler ABI info
2022-10-12T10:16:43.6852526Z -- Detecting C compiler ABI info - done
2022-10-12T10:16:43.6948262Z -- Check for working C compiler: /usr/bin/clang-15 - skipped
2022-10-12T10:16:43.7015348Z -- Detecting C compile features
2022-10-12T10:16:43.7079205Z -- Detecting C compile features - done
2022-10-12T10:16:43.7279573Z -- Detecting CXX compiler ABI info
2022-10-12T10:16:43.8863684Z -- Detecting CXX compiler ABI info - done
2022-10-12T10:16:43.8960693Z -- Check for working CXX compiler: /usr/bin/clang++-15 - skipped
2022-10-12T10:16:43.8963927Z -- Detecting CXX compile features
2022-10-12T10:16:43.8971293Z -- Detecting CXX compile features - done
2022-10-12T10:16:43.9376157Z -- Performing Test HAVE_FFI_CALL
2022-10-12T10:16:44.0747441Z -- Performing Test HAVE_FFI_CALL - Success
2022-10-12T10:16:44.0826465Z -- Found FFI: /usr/lib/x86_64-linux-gnu/libffi.so
2022-10-12T10:16:44.0890864Z -- Performing Test Terminfo_LINKABLE
2022-10-12T10:16:44.2189488Z -- Performing Test Terminfo_LINKABLE - Success
2022-10-12T10:16:44.2202348Z -- Found Terminfo: /usr/lib/x86_64-linux-gnu/libtinfo.so
2022-10-12T10:16:44.2577518Z -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
2022-10-12T10:16:44.3828267Z -- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.10")
2022-10-12T10:16:44.4040265Z CMake Error at /usr/lib/llvm-15/lib/cmake/llvm/LLVMExports.cmake:1693 (message):
2022-10-12T10:16:44.4041150Z The imported target "llvm-bolt" references the file
2022-10-12T10:16:44.4041684Z
2022-10-12T10:16:44.4042198Z "/usr/lib/llvm-15/bin/llvm-bolt"
2022-10-12T10:16:44.4042410Z
2022-10-12T10:16:44.4042749Z but this file does not exist. Possible reasons include:
2022-10-12T10:16:44.4042969Z
2022-10-12T10:16:44.4043166Z * The file was deleted, renamed, or moved to another location.
2022-10-12T10:16:44.4043378Z
2022-10-12T10:16:44.4043578Z * An install or uninstall procedure did not complete successfully.
2022-10-12T10:16:44.4043815Z
2022-10-12T10:16:44.4043981Z * The installation package was faulty and contained
2022-10-12T10:16:44.4044192Z
2022-10-12T10:16:44.4044462Z "/usr/lib/llvm-15/lib/cmake/llvm/LLVMExports.cmake"
2022-10-12T10:16:44.4044677Z
2022-10-12T10:16:44.4044809Z but not all the files it references.
2022-10-12T10:16:44.4044979Z
2022-10-12T10:16:44.4045110Z Call Stack (most recent call first):
2022-10-12T10:16:44.4045536Z /usr/lib/llvm-15/cmake/LLVMConfig.cmake:336 (include)
2022-10-12T10:16:44.4045869Z CMakeLists.txt:77 (find_package)
2022-10-12T10:16:44.4046033Z
2022-10-12T10:16:44.4046054Z
2022-10-12T10:16:44.4052407Z -- Configuring incomplete, errors occurred!
2022-10-12T10:16:44.4052850Z See also "/home/runner/work/c3c/c3c/build/CMakeFiles/CMakeOutput.log".
install bolt-15 fixes your problem?
It resolves that particular error, but in the linking step it now ends up with:
/usr/lib/x86_64-linux-gnu/libtinfo.so /usr/lib/llvm-15/lib/libLLVMDemangle.a && :
/usr/bin/ld: /usr/lib/llvm-15/lib/libLLVMAArch64AsmParser.a: error adding symbols: archive has no index; run ranlib to add one
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Probably #58316 is related.
yeah, they are duped
About the ar issue, it is a different issue (i enabled LTO)
@sylvestre Regarding LTO, I previously had problems with homebrew enabling LTO in their llvm15 package, as this prevented linking with anything except the exact same Clang version they used. So nothing worked.
oh :|
They then switched to thinLTO which also didn't work :(
ok, I restarted the builds with llvm-bolt and disabled LTO (for now)
@sylvestre Regarding LTO, I previously had problems with homebrew enabling LTO in their llvm15 package, as this prevented linking with anything except the exact same Clang version they used. So nothing worked.
This issue in Homebrew was resolved in https://github.com/Homebrew/homebrew-core/pull/112154, right? I does work for me now.
This issue in Homebrew was resolved in https://github.com/Homebrew/homebrew-core/pull/112154, right?
I did that but I am pretty sure that my script is failing :)
Yes, the brew issue was resolved.
Is this fixed? Can we close this issue?
No, while the workaround with bolt-15 now seems to be ok, I don't think CMake for LLVM targets should break if bolt-15 isn't imported.
I think I fixed in the repo. Not sure that the builds are all completed
I'll try later, because it doesn't work yet.
How can I check that I'm using the version with the fix? I still see the LLVMExport failure if I don't import bolt-15.
It doesn't seem to have helped @sylvestre. I see my tests trying to compile both with a version from 2022-10-12 and later with one from 2022-10-13, both fails the same way.
@lerno what is the result of
grep bolt /usr/lib/llvm-15/lib/cmake/llvm/LLVMExports-release.cmake ?
It seems to be this:
# Import target "llvm-bolt" for configuration "Release"
set_property(TARGET llvm-bolt APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(llvm-bolt PROPERTIES
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/llvm-bolt"
list(APPEND _IMPORT_CHECK_TARGETS llvm-bolt )
list(APPEND _IMPORT_CHECK_FILES_FOR_llvm-bolt "${_IMPORT_PREFIX}/bin/llvm-bolt" )
# Import target "llvm-bolt-heatmap" for configuration "Release"
set_property(TARGET llvm-bolt-heatmap APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(llvm-bolt-heatmap PROPERTIES
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/llvm-bolt-heatmap"
list(APPEND _IMPORT_CHECK_TARGETS llvm-bolt-heatmap )
list(APPEND _IMPORT_CHECK_FILES_FOR_llvm-bolt-heatmap "${_IMPORT_PREFIX}/bin/llvm-bolt-heatmap" )
ok, thanks :) I think I have a fix!
Let me know when I can test again. Also, it looks like this problem found its way into 16 now.
I think it is now fixed on the repo
Thanks for looking into this!
From the latest run of llvm-tutor (which depends on these packages):
CMake Error at /usr/lib/llvm-15/lib/cmake/llvm/LLVMExports.cmake:1693 (message):
The imported target "merge-fdata" references the file
-- Configuring incomplete, errors occurred!
"/usr/lib/llvm-15/bin/merge-fdata"
See also "/home/runner/work/llvm-tutor/llvm-tutor/HelloWorld/build/CMakeFiles/CMakeOutput.log".
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/lib/llvm-15/lib/cmake/llvm/LLVMExports.cmake"
but not all the files it references.
merge-fdata is a bolt tool. So one step forward, but not quite there yet :)
This should be fixed too in the next rebuild: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/commit/992e52c0b156a5ba9c6a8a54f8c4857ddd3d371d
The LLVM 15 version is still on 20221014 with the "merge-fdata" error. LLVM 16 on 20221015 is showing a new error, missing "/usr/lib/llvm-16/bin/llvm-bat-dump" instead. @sylvestre
It appears that 15.0.3 now works. But the issue in LLVM-16 remains (missing /usr/lib/llvm-16/bin/llvm-bat-dump)
unrelated to 15.0.3 :)
Well that 15.0.3 works is related ;) Also 16 seems to work when bolt is included.
Just curious if there is any general plan for LLVM to fix this directly? There's really no reason to check for lots of targets the user didn't ask for and then fail?