Skip to content

Commit

Permalink
ubus: backport SOVERSION support
Browse files Browse the repository at this point in the history
Add a support for setting of new `ABIVERSION` CMake define which allows
to control the SOVERSION used for the built shared library. This is
needed for downstream packaging to properly track breaking ABI changes
when updating to newer versions of the library.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(backported from commit 8edb179)
  • Loading branch information
ynezz committed Jul 29, 2021
1 parent e902d11 commit 92e341d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions package/system/ubus/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git
PKG_SOURCE_DATE:=2019-12-27
PKG_SOURCE_VERSION:=041c9d1c052bb4936fd03240f7d0dd64aedda972
PKG_MIRROR_HASH:=7febbe78dd178d8d7ccacff54c00fb2d19a53624005920db8cd85236f54f8324
PKG_ABI_VERSION:=20191227
CMAKE_INSTALL:=1

PKG_LICENSE:=LGPL-2.1
Expand Down Expand Up @@ -36,7 +37,7 @@ define Package/libubus
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libubox
ABI_VERSION:=20191227
ABI_VERSION:=$(PKG_ABI_VERSION)
TITLE:=OpenWrt RPC client library
endef

Expand All @@ -51,7 +52,8 @@ TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -flto
TARGET_LDFLAGS += -flto

CMAKE_OPTIONS = \
-DLUAPATH=/usr/lib/lua
-DLUAPATH=/usr/lib/lua \
-DABIVERSION="$(PKG_ABI_VERSION)"

define Package/ubus/install
$(INSTALL_DIR) $(1)/bin
Expand All @@ -65,7 +67,7 @@ endef

define Package/libubus/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libubus.so.* $(1)/lib/

This comment has been minimized.

Copy link
@tisrico

tisrico Nov 9, 2021

The new copy command would not copy the symbolic link libubus.so -> libubus.so.20210603, is this an intended behaviour or a bug?

We found this problem as it caused a bug in a system which expects libubus.so.

This comment has been minimized.

Copy link
@ynezz

ynezz Nov 9, 2021

Author Member

is this an intended behaviour

Yes, otherwise it would defeat the purpose of ABI versioned libraries. In other words, applications link against the versioned libraries, so the symlink is not needed.

$ ldd /sbin/procd | grep libubus
libubus.so.20210630 => /lib/libubus.so.20210630 (0x77d6b000)
endef

define Package/libubus-lua/install
Expand Down

0 comments on commit 92e341d

Please sign in to comment.