Skip to content

[Libomptarget] Fix linking to LLVM dylib #86397

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

Merged
merged 1 commit into from
Mar 23, 2024
Merged

Conversation

mgorny
Copy link
Member

@mgorny mgorny commented Mar 23, 2024

Use LINK_COMPONENTS parameter of add_llvm_library rather than passing LLVM components directly to target_link_libraries, in order to ensure that LLVM dylib is linked correctly when used. Otherwise, CMake insists on linking to static libraries that aren't present on distributions doing pure dylib installs, such as Gentoo.

This fixes a regression introduced
in dcbddc2.

Use `LINK_COMPONENTS` parameter of `add_llvm_library` rather than
passing LLVM components directly to `target_link_libraries`, in order
to ensure that LLVM dylib is linked correctly when used.  Otherwise,
CMake insists on linking to static libraries that aren't present
on distributions doing pure dylib installs, such as Gentoo.

This fixes a regression introduced
in dcbddc2.
Copy link

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link

✅ With the latest revision this PR passed the Python code formatter.

Copy link
Contributor

@jhuber6 jhuber6 left a comment

Choose a reason for hiding this comment

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

I was curious about this when I was moving that code around, but ended up keeping it since it worked on my machine. Thanks for fixing it.

@mgorny
Copy link
Member Author

mgorny commented Mar 23, 2024

Thanks!

@mgorny mgorny merged commit 3f5e649 into llvm:main Mar 23, 2024
@mgorny mgorny deleted the openmp-link-dylib branch March 23, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmp:libomptarget OpenMP offload runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants