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

Fix build with system LLVM #638

Closed
wants to merge 2 commits into from

Conversation

mrexodia
Copy link
Contributor

When using a vanilla LLVM there were some issues with the build (when using system libraries):

  1. Certain libraries were missing, this is fixed by simply linking to all available LLVM libs
  2. Without GFLAGS_USE_TARGET_NAMESPACE the target gflags::gflags does not exist, not sure what vcpkg is doing different there, perhaps an older version?
  3. The LLVM include directories are not mentioned anywhere so remill fails to compile

These issues were found when trying a superbuild without vcpkg.

if(LLVM_LINK_LLVM_DYLIB)
set(llvm_libs LLVM)
else()
set(llvm_libs ${LLVM_AVAILABLE_LIBS})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still want llvm_map_components_to_libnames here, otherwise it starts to pull in things like LibEdit. In the past we've also faced linking issues with LLVM_AVAILABLE_LIBS having some things out-of-order.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's true, I had to disable LibEdit on the LLVM command line. I'll try to reproduce the linker error then and see if I can find the component. Generally it shouldn't be an issue to link to all LLVM libraries, unused things are ignored. I've been using this since LLVM 10 without issues related to out-of-order linking.

@mrexodia
Copy link
Contributor Author

Will open a new PR later.

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

Successfully merging this pull request may close these issues.

2 participants