Change in libosmocore[master]: fix tests linking: don't use system installed libs
Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/5844 ) Change subject: fix tests linking: don't use system installed libs .. fix tests linking: don't use system installed libs Do not link against the system-wide installed libosmo* libs when building the regression test programs. Always use the locally built ones. Linking some libosmo libraries causes libtool to pull in other libosmo libs even though they were not explicitly named. For example, ctrl_test explicitly links libosmoctrl, but this also has dependencies to libosmovty and libosmogsm: ldd src/ctrl/.libs/libosmoctrl.so | grep osmo libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f26c26d4000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f26c22bb000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f26c2171000) If we omit explicit LDADD of these dependencies in the Makefile.am, libtool will take the first canonical place to find them, which may just be the already installed older versions of the same libs, which may or may not be compatible with the current build. In any case, it is never intended to link installed libs. All library dependencies are listed by this quick script: cd libosmocore for l in $(find . -name "*.so") ; do echo; echo "$l"; ldd $l | grep libosmo; done ./.libs/libosmocore.so ./coding/.libs/libosmocoding.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f25fc3c2000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f25fbfa9000) libosmocodec.so.0 => /usr/local/lib/libosmocodec.so.0 (0x7f25fbf9b000) ./codec/.libs/libosmocodec.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7fb4c900d000) ./ctrl/.libs/libosmoctrl.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f5df5129000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f5df4d1) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f5df4bc6000) ./gb/.libs/libosmogb.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f788e536000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f788e3ec000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f788dfd3000) ./vty/.libs/libosmovty.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f3b7ed21000) ./gsm/.libs/libosmogsm.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7fc69472e000) ./sim/.libs/libosmosim.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f2f6412d000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f2f63d14000) Add all explicit linking of all required library dependencies in all regression test programs, as shown by above listing. Example for reproducing a problem: In libosmocore.a, introduce a new function, and call that from libosmovty code. For example, I made loglevel_strs non-static in logging.c, and used that in logging_vty.c. Build and install this in a place where libtool can find it. Then go back to before this change and rebuild. You will see that linking ctrl_test (before this patch) then complains about libosmovty requiring the loglevel_strs symbol which it cannot find in libosmocore.so. Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 --- M tests/Makefile.am 1 file changed, 13 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/tests/Makefile.am b/tests/Makefile.am index 072bb4a..5d07695 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -76,7 +76,10 @@ abis_abis_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la ctrl_ctrl_test_SOURCES = ctrl/ctrl_test.c -ctrl_ctrl_test_LDADD = $(LDADD) $(top_builddir)/src/ctrl/libosmoctrl.la +ctrl_ctrl_test_LDADD = $(LDADD) \ + $(top_builddir)/src/ctrl/libosmoctrl.la \ + $(top_builddir)/src/gsm/libosmogsm.la \ + $(top_builddir)/src/vty/libosmovty.la gea_gea_test_SOURCES = gea/gea_test.c gea_gea_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la @@ -130,20 +133,24 @@ gb_bssgp_fc_test_SOURCES = gb/bssgp_fc_test.c gb_bssgp_fc_test_LDADD = $(LDADD) $(top_builddir)/src/gb/libosmogb.la \ +$(top_builddir)/src/vty/libosmovty.la \ $(top_builddir)/src/gsm/libosmogsm.la gb_gprs_bssgp_test_SOURCES = gb/gprs_bssgp_test.c gb_gprs_bssgp_test_LDADD = $(LDADD) $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DLSYM) \ + $(top_builddir)/src/vty/libosmovty.la \ $(top_builddir)/src/gsm/libosmogsm.la gb_gprs_ns_test_SOURCES = gb/gprs_ns_test.c gb_gprs_ns_test_LDADD = $(LDADD) $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DLSYM) \ + $(top_builddir)/src/vty/libosmovty.la \
Change in libosmocore[master]: fix tests linking: don't use system installed libs
Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/5844 ) Change subject: fix tests linking: don't use system installed libs .. Patch Set 6: So, let's try to figure out the reason of this strange behavior first, before merging this change? -- To view, visit https://gerrit.osmocom.org/5844 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 Gerrit-Change-Number: 5844 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 12 Sep 2018 08:11:33 + Gerrit-HasComments: No Gerrit-HasLabels: No
Change in libosmocore[master]: fix tests linking: don't use system installed libs
Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/5844 ) Change subject: fix tests linking: don't use system installed libs .. Patch Set 6: Doing the following: > $ cd libosmocore/tests/ > $ ldd gb/.libs/bssgp_fc_test | grep osmo results in the following: > libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7fd995723000) > libosmogb.so.6 => /usr/local/lib/libosmogb.so.6 (0x7fd9952fb000) > libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7fd994b0e000) > libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7fd9948b5000) but there is also an 'lt-*' version, so: > $ ldd gb/.libs/lt-bssgp_fc_test | grep osmo results in: > libosmocore.so.11 => /opt/osmocom/libosmocore/src/.libs/libosmocore.so.11 > (0x7fab7bd22000) > libosmogb.so.6 => /opt/osmocom/libosmocore/src/gb/.libs/libosmogb.so.6 > (0x7fab7b8fa000) > libosmovty.so.4 => /opt/osmocom/libosmocore/src/vty/.libs/libosmovty.so.4 > (0x7fab7b10d000) > libosmogsm.so.10 => /opt/osmocom/libosmocore/src/gsm/.libs/libosmogsm.so.10 > (0x7fab7aeb4000) -- To view, visit https://gerrit.osmocom.org/5844 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 Gerrit-Change-Number: 5844 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 12 Sep 2018 08:09:38 + Gerrit-HasComments: No Gerrit-HasLabels: No
Change in libosmocore[master]: fix tests linking: don't use system installed libs
Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/5844 ) Change subject: fix tests linking: don't use system installed libs .. Patch Set 6: Hi Neels, > Vadim, I don't understand why you can't reproduce this problem, Well, does anyone else experience this problem too? > maybe your installed libraries are simply not in the LD_LIBRARY_PATH? My LD_LIBRARY_PATH is empty, all libraries are installed to the default '/usr/local/lib/' location, that is configured for most Debian based distributions in '/etc/ld.so.conf.d/libc.conf'. I just even tried to explicitly set LD_LIBRARY_PATH to '/usr/local/lib/', but the result is the same, not matching your output: $ for l in $(find . -name "*.so") ; do echo; echo "$l"; ldd $l | grep libosmo; done ./src/coding/.libs/libosmocoding.so libosmocore.so.11 => /opt/osmocom/libosmocore/src/.libs/libosmocore.so.11 (0x7f8fac718000) libosmogsm.so.10 => /opt/osmocom/libosmocore/src/gsm/.libs/libosmogsm.so.10 (0x7f8fac4bf000) libosmocodec.so.0 => /opt/osmocom/libosmocore/src/codec/.libs/libosmocodec.so.0 (0x7f8fac2bb000) ./src/sim/.libs/libosmosim.so libosmocore.so.11 => /opt/osmocom/libosmocore/src/.libs/libosmocore.so.11 (0x7f0439542000) libosmogsm.so.10 => /opt/osmocom/libosmocore/src/gsm/.libs/libosmogsm.so.10 (0x7f04392e9000) ./src/.libs/libosmocore.so ./src/gsm/.libs/libosmogsm.so libosmocore.so.11 => /opt/osmocom/libosmocore/src/.libs/libosmocore.so.11 (0x7f68f8339000) ./src/gb/.libs/libosmogb.so libosmocore.so.11 => /opt/osmocom/libosmocore/src/.libs/libosmocore.so.11 (0x7f2989c75000) libosmovty.so.4 => /opt/osmocom/libosmocore/src/vty/.libs/libosmovty.so.4 (0x7f2989a55000) libosmogsm.so.10 => /opt/osmocom/libosmocore/src/gsm/.libs/libosmogsm.so.10 (0x7f29897fc000) ./src/vty/.libs/libosmovty.so libosmocore.so.11 => /opt/osmocom/libosmocore/src/.libs/libosmocore.so.11 (0x7f064ba63000) ./src/codec/.libs/libosmocodec.so libosmocore.so.11 => /opt/osmocom/libosmocore/src/.libs/libosmocore.so.11 (0x7f973165) ./src/ctrl/.libs/libosmoctrl.so libosmocore.so.11 => /opt/osmocom/libosmocore/src/.libs/libosmocore.so.11 (0x7f187bd94000) libosmogsm.so.10 => /opt/osmocom/libosmocore/src/gsm/.libs/libosmogsm.so.10 (0x7f187bb3b000) libosmovty.so.4 => /opt/osmocom/libosmocore/src/vty/.libs/libosmovty.so.4 (0x7f187b91b000) where '/opt/osmocom/libosmocore/' is exactly the build directory... -- To view, visit https://gerrit.osmocom.org/5844 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 Gerrit-Change-Number: 5844 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 12 Sep 2018 08:01:40 + Gerrit-HasComments: No Gerrit-HasLabels: No
Change in libosmocore[master]: fix tests linking: don't use system installed libs
Hello Vadim Yanitskiy, Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5844 to look at the new patch set (#6). Change subject: fix tests linking: don't use system installed libs .. fix tests linking: don't use system installed libs Do not link against the system-wide installed libosmo* libs when building the regression test programs. Always use the locally built ones. Linking some libosmo libraries causes libtool to pull in other libosmo libs even though they were not explicitly named. For example, ctrl_test explicitly links libosmoctrl, but this also has dependencies to libosmovty and libosmogsm: ldd src/ctrl/.libs/libosmoctrl.so | grep osmo libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f26c26d4000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f26c22bb000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f26c2171000) If we omit explicit LDADD of these dependencies in the Makefile.am, libtool will take the first canonical place to find them, which may just be the already installed older versions of the same libs, which may or may not be compatible with the current build. In any case, it is never intended to link installed libs. All library dependencies are listed by this quick script: cd libosmocore for l in $(find . -name "*.so") ; do echo; echo "$l"; ldd $l | grep libosmo; done ./.libs/libosmocore.so ./coding/.libs/libosmocoding.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f25fc3c2000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f25fbfa9000) libosmocodec.so.0 => /usr/local/lib/libosmocodec.so.0 (0x7f25fbf9b000) ./codec/.libs/libosmocodec.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7fb4c900d000) ./ctrl/.libs/libosmoctrl.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f5df5129000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f5df4d1) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f5df4bc6000) ./gb/.libs/libosmogb.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f788e536000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f788e3ec000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f788dfd3000) ./vty/.libs/libosmovty.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f3b7ed21000) ./gsm/.libs/libosmogsm.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7fc69472e000) ./sim/.libs/libosmosim.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f2f6412d000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f2f63d14000) Add all explicit linking of all required library dependencies in all regression test programs, as shown by above listing. Example for reproducing a problem: In libosmocore.a, introduce a new function, and call that from libosmovty code. For example, I made loglevel_strs non-static in logging.c, and used that in logging_vty.c. Build and install this in a place where libtool can find it. Then go back to before this change and rebuild. You will see that linking ctrl_test (before this patch) then complains about libosmovty requiring the loglevel_strs symbol which it cannot find in libosmocore.so. Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 --- M tests/Makefile.am 1 file changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/5844/6 -- To view, visit https://gerrit.osmocom.org/5844 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 Gerrit-Change-Number: 5844 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy
Change in libosmocore[master]: fix tests linking: don't use system installed libs
Hello Vadim Yanitskiy, Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5844 to look at the new patch set (#5). Change subject: fix tests linking: don't use system installed libs .. fix tests linking: don't use system installed libs Do not link against the system-wide installed libosmo* libs when building the regression test programs. Always use the locally built ones. Linking some libosmo libraries causes libtool to pull in other libosmo libs even though they were not explicitly named. For example, ctrl_test explicitly links libosmoctrl, but this also has dependencies to libosmovty and libosmogsm: ldd src/ctrl/.libs/libosmoctrl.so | grep osmo libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f26c26d4000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f26c22bb000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f26c2171000) If we omit explicit LDADD of these dependencies in the Makefile.am, libtool will take the first canonical place to find them, which may just be the already installed older versions of the same libs, which may or may not be compatible with the current build. In any case, it is never intended to link installed libs. All library dependencies are listed by this quick script: cd libosmocore for l in $(find . -name "*.so") ; do echo; echo "$l"; ldd $l | grep libosmo; done ./.libs/libosmocore.so ./coding/.libs/libosmocoding.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f25fc3c2000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f25fbfa9000) libosmocodec.so.0 => /usr/local/lib/libosmocodec.so.0 (0x7f25fbf9b000) ./codec/.libs/libosmocodec.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7fb4c900d000) ./ctrl/.libs/libosmoctrl.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f5df5129000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f5df4d1) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f5df4bc6000) ./gb/.libs/libosmogb.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f788e536000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f788e3ec000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f788dfd3000) ./vty/.libs/libosmovty.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f3b7ed21000) ./gsm/.libs/libosmogsm.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7fc69472e000) ./sim/.libs/libosmosim.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f2f6412d000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f2f63d14000) Add all explicit linking of all required library dependencies in all regression test programs, as shown by above listing. Example for reproducing a problem: In libosmocore.a, introduce a new function, and call that from libosmovty code. For example, I made loglevel_strs non-static in logging.c, and used that in logging_vty.c. Build and install this in a place where libtool can find it. Then go back to before this change and rebuild. You will see that linking ctrl_test (before this patch) then complains about libosmovty requiring the loglevel_strs symbol which it cannot find in libosmocore.so. Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 --- M tests/Makefile.am 1 file changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/5844/5 -- To view, visit https://gerrit.osmocom.org/5844 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 Gerrit-Change-Number: 5844 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy