osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hlr/+/43578?usp=email )
Change subject: gsupclient: add LIBOSMOGSM_LIBS to LIBADD ......................................................................
gsupclient: add LIBOSMOGSM_LIBS to LIBADD
libosmo-gsup-client calls osmo_gsup_*, osmo_oap_client_* and osmo_imsi_str_valid(), all exported by libosmogsm, but libosmo_gsup_client_la_LIBADD in src/gsupclient/Makefile.am lists only talloc, libosmocore and libosmoabis.
GNU ld accepts undefined symbols in a shared library and defers them to whatever the executable happens to pull in, so the missing dependency is invisible on Linux. Darwin's ld64 refuses at link time and the library fails to build with "symbol(s) not found for architecture arm64".
The same Makefile.am already passes -no-undefined in LDFLAGS, which is the promise that the library resolves its own symbols. Adding LIBOSMOGSM_LIBS is what makes that promise true.
With the fix, otool -L on the resulting libosmo-gsup-client.dylib lists libosmogsm among its dependencies, and the osmo_gsup_* references resolve through it.
Change-Id: I413ff47aa1e8034ea86c61134d3d6784942b0e3b Signed-off-by: Andrei Gosman andrei.gosman@gmail.com --- M src/gsupclient/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: osmith: Looks good to me, approved pespin: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified
diff --git a/src/gsupclient/Makefile.am b/src/gsupclient/Makefile.am index 7611f6e..89533f4 100644 --- a/src/gsupclient/Makefile.am +++ b/src/gsupclient/Makefile.am @@ -16,7 +16,7 @@ $(NULL)
libosmo_gsup_client_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined -libosmo_gsup_client_la_LIBADD = $(TALLOC_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOABIS_LIBS) +libosmo_gsup_client_la_LIBADD = $(TALLOC_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOABIS_LIBS)
noinst_PROGRAMS = gsup-test-client