Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM-7.0.0 and LLVM-8.0.0 linking failures on gentoo #61

Closed
hjudt opened this issue Apr 19, 2019 · 7 comments
Closed

LLVM-7.0.0 and LLVM-8.0.0 linking failures on gentoo #61

hjudt opened this issue Apr 19, 2019 · 7 comments

Comments

@hjudt
Copy link
Contributor

hjudt commented Apr 19, 2019

Hi,

in 5.0.0 branch you specified

llvm_map_components_to_libnames(llvm_libs core support mcparser option bitreader profiledata)

llvm_map_components_to_libnames(llvm_libs core support mcparser option bitreader profiledata)
message(STATUS "Using llvm libs: ${llvm_libs}")
and used these ${llvm_libs} in target_link_libraries

in 7.0.0 llvm_map_components has been removed and the target_link_libraries has been replaced by LLVM

LLVM)

Same in 8.0.0. Both 7 and 8 now do no longer build on Gentoo because ld cannot find -lLLVM.

@hjudt
Copy link
Contributor Author

hjudt commented Apr 19, 2019

`diff -Naur c2ffi-8.0.0~/CMakeLists.txt c2ffi-8.0.0/CMakeLists.txt
--- c2ffi-8.0.0~/CMakeLists.txt 2019-04-19 02:50:09.249266768 +0200
+++ c2ffi-8.0.0/CMakeLists.txt 2019-04-19 02:51:36.109265726 +0200
@@ -10,6 +10,7 @@
message(STATUS "LLVM installed in ${LLVM_INSTALL_PREFIX}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
add_definitions(${LLVM_DEFINITIONS})
+llvm_map_components_to_libnames(llvm_libs core support mcparser option bitreader profiledata)
link_directories(${LLVM_INSTALL_PREFIX}/lib ${LLVM_INSTALL_PREFIX}/lib64)

set(CMAKE_CXX_STANDARD 11)
@@ -67,7 +68,7 @@
clangIndex
clangToolingCore
clangTooling

  • LLVM)
  • ${llvm_libs})

set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin")
set_target_properties(c2ffi PROPERTIES`

@hjudt
Copy link
Contributor Author

hjudt commented Apr 19, 2019

github won't let me upload the patch, but simply reverting the change mentioned above fixes compilation for me. I just don't know if all libnames are included that are required, but so far there have been no errors during building.

@rpav rpav closed this as completed in e189757 May 8, 2019
@rpav
Copy link
Owner

rpav commented May 8, 2019

These auto-close now?

In any case, the above should fix this; someone needs to modernize LLVM cmake. Let me know if you still have troubles. Still seems to build on arch fine; someone on ubuntu will have to comment there.

@hjudt
Copy link
Contributor Author

hjudt commented May 9, 2019

Yes, thank you, 8.0.0 builds fine now on gentoo.

@lockie
Copy link

lockie commented Oct 31, 2019

Hey. Unfortunately I was getting linker errors (being unable to find -lclangFrontendTool and then -lLLVM) using 9.0.0 branch on Gentoo. Reverting to commit 9e49eb8 fixed the problem - built with no errors at all.

@rpav
Copy link
Owner

rpav commented Oct 31, 2019

Can you create a gist and link it here with the contents/list-of-files gentoo installs with your LLVM/Clang?

@lockie
Copy link

lockie commented Oct 31, 2019

Sure, here you go:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants