Bug #4828
closedBuilding osmo-trx-lms fails due to linker errors
100%
Description
I have no idea why this is happening:
$ autoreconf -fi $ ./configure --with-lms --with-uhd $ make ... CXXLD osmo-trx-uhd CXXLD osmo-trx-lms /usr/bin/ld: ./device/lms/.libs/libdevice.a(LMSDevice.o): in function `LMSDevice::do_clock_src_freq(ReferenceType, double)': /home/wmn/wmn/osmocom/osmo-trx/Transceiver52M/device/lms/LMSDevice.cpp:493: undefined reference to `get_value_string(value_string const*, unsigned int)' /usr/bin/ld: ./device/lms/.libs/libdevice.a(LMSDevice.o): in function `LMSDevice::assign_band_desc(gsm_band)': /home/wmn/wmn/osmocom/osmo-trx/Transceiver52M/device/lms/LMSDevice.cpp:237: undefined reference to `osmo_panic(char const*, ...)' collect2: error: ld returned 1 exit status
while both osmo-trx-{ipc,uhd} seem to compile just fine. Here is more detailed output:
$ make V=s /bin/sh ../libtool --tag=CXX --mode=link g++ -lpthread -I/usr/local/include/ -pthread -I/usr/local/include/ -I/usr/local/include/ -g -O2 -o osmo-trx-lms osmo_trx_lms-osmo-trx.o ./device/lms/libdevice.la libtransceiver_common.la ../Transceiver52M/arch/x86/libarch.la ../GSM/libGSM.la ../CommonLibs/libcommon.la -lfftw3f -L/usr/local/lib -Wl,-rpath,/usr/lib -ltalloc -losmocore -L/usr/local/lib -Wl,-rpath,/usr/lib -ltalloc -losmoctrl -losmogsm -losmocore -L/usr/local/lib -Wl,-rpath,/usr/lib -ltalloc -losmovty -losmocore -lLimeSuite libtool: link: g++ -I/usr/local/include/ -pthread -I/usr/local/include/ -I/usr/local/include/ -g -O2 -o osmo-trx-lms osmo_trx_lms-osmo-trx.o -Wl,-rpath -Wl,/usr/lib -Wl,-rpath -Wl,/usr/lib -Wl,-rpath -Wl,/usr/lib ./device/lms/.libs/libdevice.a ./.libs/libtransceiver_common.a ../Transceiver52M/arch/x86/.libs/libarch.a ../GSM/.libs/libGSM.a ../CommonLibs/.libs/libcommon.a -lpthread -L/usr/local/lib -lfftw3f /usr/local/lib/libosmoctrl.so /usr/local/lib/libosmogsm.so -lgnutls /usr/local/lib/libosmovty.so /usr/local/lib/libosmocore.so -ltalloc -lsctp -ldl -lsystemd -lLimeSuite -pthread /usr/bin/ld: ./device/lms/.libs/libdevice.a(LMSDevice.o): in function `LMSDevice::do_clock_src_freq(ReferenceType, double)': /home/wmn/wmn/osmocom/osmo-trx/Transceiver52M/device/lms/LMSDevice.cpp:493: undefined reference to `get_value_string(value_string const*, unsigned int)' /usr/bin/ld: ./device/lms/.libs/libdevice.a(LMSDevice.o): in function `LMSDevice::assign_band_desc(gsm_band)': /home/wmn/wmn/osmocom/osmo-trx/Transceiver52M/device/lms/LMSDevice.cpp:237: undefined reference to `osmo_panic(char const*, ...)' collect2: error: ld returned 1 exit status
See also: https://jenkins.osmocom.org/jenkins/job/gerrit-osmo-trx/1007/.
Updated by fixeria over 3 years ago
- Category set to LimeSDR
- Status changed from New to In Progress
- Assignee set to fixeria
Updated by fixeria over 3 years ago
- Status changed from In Progress to Feedback
- % Done changed from 0 to 100
C++ is amazing (of course not), especially when mixed up with C:
https://gerrit.osmocom.org/c/osmo-trx/+/20881 device/lms: fix: 'trx_vty.h' header requires C linkage
We probably need to back-port this change to latest v1.2.0 and tag a patch release.
Updated by fixeria over 3 years ago
While trying to understand why the hell it fails, I also submitted a bunch of misc changes:
https://gerrit.osmocom.org/c/osmo-trx/+/20882 device/lms: fix missing semicolon in LMSDevice::assign_band_desc()
https://gerrit.osmocom.org/c/osmo-trx/+/20876 device/lms: get rid of 'using namespace std'
https://gerrit.osmocom.org/c/osmo-trx/+/20874 device/uhd: re-introduce OSMO_ASSERT() in async_event_loop()
https://gerrit.osmocom.org/c/osmo-trx/+/20873 device/common/Makefile.am: remove $(LMS_CFLAGS) from AM_CXXFLAGS
https://gerrit.osmocom.org/c/osmo-trx/+/20875 device: drop unreasonable LIBOSMO{CTRL,VTY}_{CFLAGS,LIBS}
https://gerrit.osmocom.org/c/osmo-trx/+/20878 Transceiver: use size_t and ARRAY_SIZE() in constructor
https://gerrit.osmocom.org/c/osmo-trx/+/20879 Transceiver: explicitly set m{Rx,Tx}LowerLoopThread to NULL
Updated by fixeria over 3 years ago
- Status changed from Feedback to Resolved
We probably need to back-port this change to latest v1.2.0 and tag a patch release.
Nope, this regression was actually introduced after the release tag. Patches merged, closing.
[1] I7658615787c5bc41c365bab9c11733b701ac2ae5 https://gerrit.osmocom.org/c/osmo-trx/+/16876