Skip to content

Make it easier to set alternative SONAME for pjproject libraries.#4905

Open
jkroonza wants to merge 1 commit intopjsip:masterfrom
jkroonza:soname
Open

Make it easier to set alternative SONAME for pjproject libraries.#4905
jkroonza wants to merge 1 commit intopjsip:masterfrom
jkroonza:soname

Conversation

@jkroonza
Copy link
Copy Markdown
Contributor

@jkroonza jkroonza commented Apr 2, 2026

No description provided.

@jkroonza
Copy link
Copy Markdown
Contributor Author

jkroonza commented Apr 2, 2026

Since pjproject doesn't modify the so version on ABI changes, it's often difficult to detect breakage due to ABI changes. This makes it easier for packagers of pjproject to use an alternative SONAME resulting in distribution mechanisms like preserved-rebuild on Gentoo to maintain package consistency during upgrade processes.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces an overridable SONAME-version variable to allow customizing the shared-library version suffix, and updates selected component build Makefiles to use it when naming shared libraries.

Changes:

  • Add PJ_SONAME_VERSION (defaulting to PJ_VERSION_MAJOR) in version.mak.
  • Switch PJSIP shared library filename suffixes to $(PJ_SONAME_VERSION).
  • Switch PJMEDIA shared library filename suffixes to $(PJ_SONAME_VERSION).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
version.mak Adds an exported, overridable PJ_SONAME_VERSION variable.
pjsip/build/Makefile Uses PJ_SONAME_VERSION for PJSIP-related shared library filenames.
pjmedia/build/Makefile Uses PJ_SONAME_VERSION for PJMEDIA-related shared library filenames.

@jkroonza jkroonza force-pushed the soname branch 3 times, most recently from e592816 to c419b86 Compare April 2, 2026 20:16
@sauwming sauwming requested a review from Copilot April 3, 2026 00:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

else
APP_THIRD_PARTY_LIBS += -lwebrtc-aec3
APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libwebrtc-aec3.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libwebrtc.$(SHLIB_SUFFIX)
APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libwebrtc-aec3.$(SHLIB_SUFFIX).$(PJ_SONAME_VERSION) $(PJ_DIR)/third_party/lib/libwebrtc.$(SHLIB_SUFFIX)
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

In the webrtc-aec3 shared-library branch, APP_THIRD_PARTY_LIB_FILES lists the unversioned file as libwebrtc.$(SHLIB_SUFFIX) instead of libwebrtc-aec3.$(SHLIB_SUFFIX). This is inconsistent with the library name used elsewhere (libwebrtc-aec3) and will point to the wrong file when webrtc-aec3 is enabled with shared libs. Update the second path to reference libwebrtc-aec3.$(SHLIB_SUFFIX).

Suggested change
APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libwebrtc-aec3.$(SHLIB_SUFFIX).$(PJ_SONAME_VERSION) $(PJ_DIR)/third_party/lib/libwebrtc.$(SHLIB_SUFFIX)
APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libwebrtc-aec3.$(SHLIB_SUFFIX).$(PJ_SONAME_VERSION) $(PJ_DIR)/third_party/lib/libwebrtc-aec3.$(SHLIB_SUFFIX)

Copilot uses AI. Check for mistakes.
Most distribuions has a policy against embedded libraries.  This aims to
improve he life of package managers by allowing to override the
versionining portion of SONAME used in libraries such that we can have
multiple versions of pjproject installed concurrently during upgrade
processes.

For Gentoo this is managed by way of preserved-libs, which means we can
have libraries for both 2.15.1 and 2.16 (for example) installed
concurrently, without conflicting, and programs are linked against one
or the other.

Managing configurations (both ./configure and site_config.h) is left to
the packager.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Apr 6, 2026
pjproject is as per pjsip/pjproject#3420
highly resistent to ABI stability and does not want to set appropriate
SONAME's to change whenever the ABIs changes.

Alpine has already committed a similar patch in order to mitigate (which
can be found at
alpinelinux/aports@efdf202),
but that's a one-off hit and run type commit that will need to be
manually updated on every release version.

Thus my variation that just use the full release version as per
pjsip/pjproject#4905

This enables preserved-libs in Gentoo to function correctly, allowing
tools built against pjproject (including asterisk) to function correctly
on restart or re-exec.

Gentoo already had := in asterisk, but currently should asterisk (and
some other tools from ULS side not in tree - nor appropriate for public
release) be re-exec'ed or invoked between pjproject upgrade and asterisk
rebuild then things break in weird and wonderful ways, and if you're
lucky it breaks properly rather than causing corruption.

Signed-off-by: Jaco Kroon <jkroon@gentoo.org>
@sauwming sauwming requested a review from nanangizz April 9, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants