[S] Change in osmo-iuh[master]: hnbap, rua, sabp: link against libosmo-ranap
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-iuh/+/43589?usp=email ) Change subject: hnbap, rua, sabp: link against libosmo-ranap ...................................................................... hnbap, rua, sabp: link against libosmo-ranap libosmo-hnbap, libosmo-rua and libosmo-sabp call asn1_xer_print() and talloc_asn1_ctx, both defined in iu_helpers.c and shipped in libosmo-ranap, but none of the three declares that dependency. GNU ld leaves such references unresolved in a shared object and lets the executable supply them later, even with -no-undefined, so nothing shows on GNU/Linux. Darwin's ld64 refuses: Undefined symbols for architecture arm64: _asn1_xer_print, _talloc_asn1_ctx while linking libosmo-rua.la, libosmo-hnbap.la and libosmo-sabp.la. Add libosmo-ranap.la to the LIBADD of each library and "Requires: libosmo-ranap" to the three .pc.in files, so both the library itself and a consumer that links only one of them record the dependency. There is no cycle: nm on the built libosmo-ranap shows it defines both symbols and references nothing from hnbap, rua or sabp. On GNU/Linux the only change is an explicit DT_NEEDED entry. The lib_LTLIBRARIES list places libosmo-ranap first, so libtool installs the shared dependency before its consumers. The three -dev packages in debian/control gain libosmo-ranap-dev in Depends to match the .pc Requires. Change-Id: Ic936829788536bc1b1973a5ed3082a82cbf90d04 --- M debian/control M libosmo-hnbap.pc.in M libosmo-rua.pc.in M libosmo-sabp.pc.in M src/Makefile.am 5 files changed, 14 insertions(+), 7 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve diff --git a/debian/control b/debian/control index cd7b287..479b9db 100644 --- a/debian/control +++ b/debian/control @@ -40,7 +40,7 @@ Section: libdevel Architecture: any Multi-Arch: same -Depends: libosmo-hnbap0 (= ${binary:Version}), ${misc:Depends} +Depends: libosmo-hnbap0 (= ${binary:Version}), libosmo-ranap-dev, ${misc:Depends} Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) Package: libosmo-ranap7 @@ -84,7 +84,7 @@ Section: libdevel Architecture: any Multi-Arch: same -Depends: libosmo-rua0 (= ${binary:Version}), ${misc:Depends} +Depends: libosmo-rua0 (= ${binary:Version}), libosmo-ranap-dev, ${misc:Depends} Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) Package: libosmo-sabp1 @@ -106,7 +106,7 @@ Section: libdevel Architecture: any Multi-Arch: same -Depends: libosmo-sabp1 (= ${binary:Version}), ${misc:Depends} +Depends: libosmo-sabp1 (= ${binary:Version}), libosmo-ranap-dev, ${misc:Depends} Description: Osmocom code for the Iuh interface (SABP) Package: libosmo-iuh-dev diff --git a/libosmo-hnbap.pc.in b/libosmo-hnbap.pc.in index db05756..49eae7c 100644 --- a/libosmo-hnbap.pc.in +++ b/libosmo-hnbap.pc.in @@ -6,5 +6,6 @@ Name: Osmocom HNBAP protocol library Description: C Utility Library Version: @VERSION@ +Requires: libosmo-ranap Libs: -L${libdir} -losmo-hnbap Cflags: -I${includedir}/ diff --git a/libosmo-rua.pc.in b/libosmo-rua.pc.in index b9bd1d4..893e4b5 100644 --- a/libosmo-rua.pc.in +++ b/libosmo-rua.pc.in @@ -6,5 +6,6 @@ Name: Osmocom RUA protocol library Description: C Utility Library Version: @VERSION@ +Requires: libosmo-ranap Libs: -L${libdir} -losmo-rua Cflags: -I${includedir}/ diff --git a/libosmo-sabp.pc.in b/libosmo-sabp.pc.in index fd0c2d4..7cd6a6d 100644 --- a/libosmo-sabp.pc.in +++ b/libosmo-sabp.pc.in @@ -6,5 +6,6 @@ Name: Osmocom SABP protocol library Description: C Utility Library Version: @VERSION@ +Requires: libosmo-ranap Libs: -L${libdir} -losmo-sabp Cflags: -I${includedir}/ diff --git a/src/Makefile.am b/src/Makefile.am index 343fa53..ffb6ca8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -65,10 +65,14 @@ RANAP_LIBVERSION=12:0:5 RUA_LIBVERSION=2:0:2 SABP_LIBVERSION=3:0:2 -lib_LTLIBRARIES = libosmo-hnbap.la libosmo-ranap.la libosmo-rua.la libosmo-sabp.la +# libosmo-hnbap, libosmo-rua and libosmo-sabp use asn1_xer_print and +# talloc_asn1_ctx, both defined in iu_helpers.c of libosmo-ranap, so they +# depend on it. Link it explicitly: GNU ld lets a shared object keep such a +# reference unresolved despite -no-undefined, ld64 on Darwin does not. +lib_LTLIBRARIES = libosmo-ranap.la libosmo-hnbap.la libosmo-rua.la libosmo-sabp.la libosmo_hnbap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(HNBAP_LIBVERSION) -no-undefined libosmo_hnbap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOSIGTRAN_LIBS) \ - $(ASN1C_LIBS) hnbap/libosmo-asn1-hnbap.la + $(ASN1C_LIBS) hnbap/libosmo-asn1-hnbap.la libosmo-ranap.la libosmo_hnbap_la_SOURCES = hnbap_common.c hnbap_encoder.c hnbap_decoder.c libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION) -no-undefined @@ -79,12 +83,12 @@ libosmo_rua_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RUA_LIBVERSION) -no-undefined libosmo_rua_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOSIGTRAN_LIBS) \ - $(ASN1C_LIBS) rua/libosmo-asn1-rua.la + $(ASN1C_LIBS) rua/libosmo-asn1-rua.la libosmo-ranap.la libosmo_rua_la_SOURCES = rua_common.c rua_encoder.c rua_decoder.c rua_msg_factory.c libosmo_sabp_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(SABP_LIBVERSION) -no-undefined libosmo_sabp_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOSIGTRAN_LIBS) \ - $(ASN1C_LIBS) sabp/libosmo-asn1-sabp.la + $(ASN1C_LIBS) sabp/libosmo-asn1-sabp.la libosmo-ranap.la libosmo_sabp_la_SOURCES = sabp_common.c sabp_encoder.c sabp_decoder.c -- To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/43589?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Change-Id: Ic936829788536bc1b1973a5ed3082a82cbf90d04 Gerrit-Change-Number: 43589 Gerrit-PatchSet: 3 Gerrit-Owner: andrei.gosman@gmail.com <andrei.gosman@gmail.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Reviewer: pespin <pespin@sysmocom.de>
participants (1)
-
pespin