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

No library versions in soname #3046

Open
Pulfer opened this issue Nov 13, 2019 · 6 comments
Open

No library versions in soname #3046

Pulfer opened this issue Nov 13, 2019 · 6 comments

Comments

@Pulfer
Copy link

Pulfer commented Nov 13, 2019

In Unix world it's common for libraries to have version in soname (usually major and minor, major changes when there are backward incompatible ABI changes).

But current sonames for libraries don't have version info:
libSPIRV-Tools-link.so
libSPIRV-Tools-opt.so
libSPIRV-Tools-reduce.so
libSPIRV-Tools-shared.so
libSPIRV-Tools.so

From packaging POV (RPM in my case) .so files are usually symlinks to versioned library files and packaged to -devel (development) packages. Could be nice to see versioned library files/sonames and non-versioned -devel symlinks here too.

@dneto0
Copy link
Collaborator

dneto0 commented Mar 6, 2020

See also the corresponding discussion for Shaderc: google/shaderc#381

@rpavlik
Copy link

rpavlik commented Apr 16, 2020

This is currently blocking a whole bunch of packages in Debian (and its derivatives) since anything using glslang in its build process won't migrate because of this. Debian bug is https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=956510

@mikesart
Copy link

I'm likely missing something (or several things), but why wouldn't something like this fix the issue?

mikesart@mikesart-tr3:/tmp/spirv-tools/build (master *)$ git diff
diff --git i/source/CMakeLists.txt w/source/CMakeLists.txt
index 708ca84..ce55291 100644
--- i/source/CMakeLists.txt
+++ w/source/CMakeLists.txt
@@ -368,6 +368,7 @@ target_include_directories(${SPIRV_TOOLS}-shared
PRIVATE ${SPIRV_HEADER_INCLUDE_DIR}
)
set_target_properties(${SPIRV_TOOLS}-shared PROPERTIES CXX_VISIBILITY_PRESET hidden)
+set_target_properties(${SPIRV_TOOLS}-shared PROPERTIES SOVERSION 1)
set_property(TARGET ${SPIRV_TOOLS}-shared PROPERTY FOLDER "SPIRV-Tools libraries")
spvtools_check_symbol_exports(${SPIRV_TOOLS}-shared)
target_compile_definitions(${SPIRV_TOOLS}-shared
`

Before the change:

mikesart@mikesart-tr3:/tmp/spirv-tools (master)$ readelf --wide -a ./build/source/libSPIRV-Tools-shared.so | grep SONAM
0x000000000000000e (SONAME) Library soname: [libSPIRV-Tools-shared.so]

After the above change:

mikesart@mikesart-tr3:/tmp/spirv-tools/build (master *)$ readelf --wide -a source/libSPIRV-Tools-shared.so | grep SONAM
0x000000000000000e (SONAME) Library soname: [libSPIRV-Tools-shared.so.1]

@rpavlik
Copy link

rpavlik commented May 11, 2020

Well, because it's not just the lack of a soname - it's the lack of a meaningful soname :) which should change every time the ABI changes incompatibly.

@mikesart
Copy link

Wouldn't whoever made that ABI breaking change bump SOVERSION up at that point? Or are you saying that needs to happen programmatically? Thanks Ryan.

@mikesart
Copy link

Ok, I see... this is described in #3214.

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

No branches or pull requests

5 participants