Skip to content

Conversation

xarblu
Copy link

@xarblu xarblu commented Apr 14, 2024

When extensions like polly are linked as part of libLLVM these don't need to be and likely shouldn't be installed.

Reason being that e.g. out-of-tree clang builds against libLLVM will try to statically link these extensions
when calling process_llvm_pass_plugins.

  1. This is undesirable because the whole point is to have a shared library to link to
  2. It actually causes issues because LLVMExports.cmake will include e.g. libPollyISL, LLVMPolly, etc. as installed targets depending on on non-installed LLVM*.a targets which are available via libLLVM.so

This is mainly intended to allow distributions to ship polly enabled libLLVM while still keeping e.g. clang independent and linked dynamically.

Allows building out-of-tree clang against libLLVM
built with ENABLE_PROJECTS=polly POLLY_LINK_INTO_TOOLS=ON
and LINK_LLVM_DYLIB=ON.
Previously clang/CMakeLists.txt would call process_llvm_pass_plugins
and try statically linking extensions that are unavailable if only
installed as part of libLLVM.
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot llvmbot added the cmake Build system in general and CMake in particular label Apr 14, 2024
@xarblu
Copy link
Author

xarblu commented Apr 18, 2024

Nevermind, this still doesn't work the way I expected. While it does allow clang to fully dynamically link to a polly-enabled libLLVM clang will then hard-depend on polly symbols in libLLVM and break when libLLVM is build with polly disabled.

@xarblu xarblu closed this Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants