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

shared library lost SOVERSION #422

Closed
anbe42 opened this issue Apr 21, 2023 · 5 comments
Closed

shared library lost SOVERSION #422

anbe42 opened this issue Apr 21, 2023 · 5 comments

Comments

@anbe42
Copy link

anbe42 commented Apr 21, 2023

After switching from add_llvm_library() to add_library() (commit 743bd15) the shared library lost its SOVERSION, the SONAME is simply the unversioned libopencl-clang.so while it previously was libopencl-clang.so.15. Not a good idea as you can now mix libLLVM-##.so.1 with incompatible libopencl-clang.so.

If I switch it back to

add_llvm_library(${TARGET_NAME} SHARED
    ${TARGET_INCLUDE_FILES}
    ${TARGET_SOURCE_FILES}
    $<TARGET_OBJECTS:cl_headers>

  DEPENDS CClangCompileOptions
  LINK_COMPONENTS
    ${OPENCL_CLANG_LLVM_MODULES}
  LINK_LIBS
    ${OPENCL_CLANG_LINK_LIBS}
)

and drop add_dependencies() and target_link_libraries() below
(with OPENCL_CLANG_LLVM_MODULES being all in case of LLVM_LINK_LLVM_DYLIB, as I (as package maintainer for Debian) only care about linking against the shared libraries from separate LLVM and SPIRV-LLVM-Translator builds, but you could probably set it to the module list used in target_link_libraries(), too),
I get again a working build with

@anbe42
Copy link
Author

anbe42 commented Apr 21, 2023

cmake_policy(SET CMP0057 NEW) should probably be moved to the top of CMakeLists.txt as there is usage of IN_LIST both before and after this line ...

wenju-he added a commit to wenju-he/opencl-clang that referenced this issue May 17, 2023
Add cmake option EXCLUDE_LIBS_FROM_ALL to remove a specific llvm library
from llvm 'all'.

This PR partially reverts 743bd15.
This PR addresses intel#401, intel#417, intel#418, intel#422, and brings back SONAME.
wenju-he added a commit to wenju-he/opencl-clang that referenced this issue May 17, 2023
Add cmake option EXCLUDE_LIBS_FROM_ALL to remove a specific llvm library
from llvm 'all'.

This PR partially reverts 743bd15.
This PR addresses intel#401, intel#417, intel#418, intel#422, and brings back SONAME.
@wenju-he
Copy link
Contributor

address this issue in #439

wenju-he added a commit that referenced this issue May 18, 2023
Add cmake option EXCLUDE_LIBS_FROM_ALL to remove a specific llvm library
from llvm 'all'.

This PR partially reverts 743bd15.
This PR addresses #401, #417, #418, #422, and brings back SONAME.
wenju-he added a commit that referenced this issue May 18, 2023
Add cmake option EXCLUDE_LIBS_FROM_ALL to remove a specific llvm library
from llvm 'all'.

This PR partially reverts 743bd15.
This PR addresses #401, #417, #418, #422, and brings back SONAME.
@wenju-he
Copy link
Contributor

wenju-he commented May 18, 2023

#439 is merged into ocl-open-160 branch, @anbe42 could you please help to check if this issue is resolved?

@frantisekz
Copy link
Contributor

#439 fixes this, thanks!

@anbe42
Copy link
Author

anbe42 commented Oct 30, 2023

Works for me in the ocl-open-170 branch.

@wenju-he wenju-he closed this as completed Apr 7, 2024
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