CONFIGURE: added a configure option to add SONAME suffix#11483
CONFIGURE: added a configure option to add SONAME suffix#11483roiedanino wants to merge 1 commit into
Conversation
Signed-off-by: Roie Danino <rdanino@nvidia.com>
| AS_IF([test "x$with_soname_suffix" != xno], | ||
| [AS_IF([test "x$with_soname_suffix" = xyes], | ||
| [AC_MSG_ERROR([--with-soname-suffix requires an explicit suffix value])]) | ||
| AS_IF([printf '%s\n' "$with_soname_suffix" | grep -Eq '^@<:@A-Za-z0-9@:>@@<:@A-Za-z0-9_.-@:>@*$'], |
There was a problem hiding this comment.
[P2] [important] Dotted suffixes break module loading
The option accepts dots, but libtool -release 1.22 produces names like libucs-1.22.so.0; UCX's module loader derives module_ext from the first dot in the loaded libucs basename, so it would look for module files ending in .22.so.0 instead of .so.0. That means accepted values such as --with-soname-suffix=1.22 can prevent optional UCT/UCM modules from loading. Either reject dots here or fix the loader to derive the real shared-library extension, and add a small configure/runtime check for a dotted suffix.
| -DUCX_CONFIG_DIR=\"$(ucx_config_dir)\" | ||
| libucs_la_CFLAGS = $(BASE_CFLAGS) $(LT_CFLAGS) | ||
| libucs_la_LDFLAGS = -ldl $(BFD_LDFLAGS) -version-info $(SOVERSION) | ||
| libucs_la_LDFLAGS = -ldl $(BFD_LDFLAGS) -version-info $(SOVERSION) $(UCX_LT_RELEASE) |
There was a problem hiding this comment.
[P2] [important] libucs_signal is left unsuffixed
The new suffix is applied to libucm/libucs/libuct/libucp, but libucs_signal is also an installed versioned UCX shared library. If the goal is avoiding collisions with already-loaded UCX DSOs, leaving this SONAME as libucs_signal.so.0 keeps one UCX entry point outside the suffix scheme. Add $(UCX_LT_RELEASE) here as well, or explicitly document that this option is limited to the four core libraries.
What?
Adds --with-soname-suffix option in configure which when set adds:
-release SUFFIX
for example:
libucp_la_LDFLAGS = -ldl -version-info $(SOVERSION) -release
examplewill produce:
libucp-example.so.0.0.0
libucp-example.so.0 -> libucp-example.so.0.0.0
libucp.so -> libucp-example.so.0.0.0
Why?
This allows creating purpose-specific
.sofiles to avoid collisions with already loaded UCX versions when binding to specific versions or binaries is required.This by itself won't provide a full isolation without using
RTLD_DEEPBINDduringdlopen.