Change in libosmocore[master]: fix tests linking: don't use system installed libs

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Tue Sep 11 21:21:55 UTC 2018


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 (0x00007f26c26d4000)
    libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f26c22bb000)
    libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f26c2171000)

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 (0x00007f25fc3c2000)
    libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f25fbfa9000)
    libosmocodec.so.0 => /usr/local/lib/libosmocodec.so.0 (0x00007f25fbf9b000)

  ./codec/.libs/libosmocodec.so
    libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007fb4c900d000)

  ./ctrl/.libs/libosmoctrl.so
    libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f5df5129000)
    libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f5df4d10000)
    libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f5df4bc6000)

  ./gb/.libs/libosmogb.so
    libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f788e536000)
    libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f788e3ec000)
    libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f788dfd3000)

  ./vty/.libs/libosmovty.so
    libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f3b7ed21000)

  ./gsm/.libs/libosmogsm.so
    libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007fc69472e000)

  ./sim/.libs/libosmosim.so
    libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f2f6412d000)
    libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f2f63d14000)

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 <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180911/79d94720/attachment.htm>


More information about the gerrit-log mailing list