Skip to content

CONFIGURE: added a configure option to add SONAME suffix#11483

Open
roiedanino wants to merge 1 commit into
openucx:masterfrom
roiedanino:deepbind
Open

CONFIGURE: added a configure option to add SONAME suffix#11483
roiedanino wants to merge 1 commit into
openucx:masterfrom
roiedanino:deepbind

Conversation

@roiedanino
Copy link
Copy Markdown
Contributor

What?

Adds --with-soname-suffix option in configure which when set adds:

-release SUFFIX

for example:
libucp_la_LDFLAGS = -ldl -version-info $(SOVERSION) -release example

will 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 .so files 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_DEEPBIND during dlopen.

Signed-off-by: Roie Danino <rdanino@nvidia.com>
Comment thread configure.ac
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_.-@:>@*$'],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[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.

Comment thread src/ucs/Makefile.am
-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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[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.

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

Successfully merging this pull request may close these issues.

2 participants