Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure with tests in 3.6.0 (check-direct.c:17: undefined reference to `_nltst_map_stat_id_from_IPSTATS_MIB_v2') #306

Closed
thesamesam opened this issue Apr 15, 2022 · 7 comments

Comments

@thesamesam
Copy link
Contributor

Hit this when packaging the new 3.6.0 for Gentoo:

libtool: link: x86_64-pc-linux-gnu-gcc -m32 -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -ggdb3 -Wl,-O1 -Wl,--defsym=__gentoo_check_ldflags__=0 -o tests/check-direct tests/check_direct-check-direct.o  -Wl,--as-needed lib/.libs/libnl-3.so lib/.libs/libnl-nf-3.so lib/.libs/libnl-genl-3.so lib/.libs/libnl-route-3.so tests/.libs/libnl-test-util.a /var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0-abi_x86_32.x86/lib/.libs/libnl-nf-3.so /var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0-abi_x86_32.x86/lib/.libs/libnl-genl-3.so /var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0-abi_x86_32.x86/lib/.libs/libnl-route-3.so /var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0-abi_x86_32.x86/lib/.libs/libnl-3.so -lcheck -lpthread -Wl,-rpath -Wl,/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0-abi_x86_32.x86/lib/.libs
[...]
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: tests/check_direct-check-direct.o: in function `static_checks_fn':
/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0/tests/check-direct.c:17: undefined reference to `_nltst_map_stat_id_from_IPSTATS_MIB_v2'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:3668: tests/check-direct] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0-abi_x86_32.x86'
make: *** [Makefile:7125: check-am] Error 2
 * ERROR: dev-libs/libnl-3.6.0::gentoo failed (test phase):
 *   Make check failed. See above for details.

I think the deal here is that check-direct is an external executable and _nltst_map_stat_id_from_IPSTATS_MIB_v2 is (rightly) a private symbol, so when following libnl-route-3.sym, it's not going to be exported, and hence not available.

/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0-abi_x86_32.x86 $ nm -D ./lib/.libs/libnl-route-3.so.200 | grep _nlt
/var/tmp/portage/dev-libs/libnl-3.6.0/work/libnl-3.6.0-abi_x86_32.x86 $ echo $?
1

Let me know if I can provide any other information. Full build.log here: build.log

@thesamesam thesamesam changed the title Build failure with tests in 3.6.0 (tests/check-direct.c:17: undefined reference to `_nltst_map_stat_id_from_IPSTATS_MIB_v2') Build failure with tests in 3.6.0 (tests/check-direct.c:17: undefined reference to _nltst_map_stat_id_from_IPSTATS_MIB_v2'`) Apr 15, 2022
@thesamesam thesamesam changed the title Build failure with tests in 3.6.0 (tests/check-direct.c:17: undefined reference to _nltst_map_stat_id_from_IPSTATS_MIB_v2'`) Build failure with tests in 3.6.0 (check-direct.c:17: undefined reference to `_nltst_map_stat_id_from_IPSTATS_MIB_v2') Apr 15, 2022
@thom311
Copy link
Owner

thom311 commented Apr 15, 2022

hi. Thanks for the report, I just noticed too.

the problem is that check-direct wants to statically link the the libs, and when configuring with --disable-static, it fails.

the solution will be, that check-direct only gets build, when static libraries are enabled...

thom311 added a commit that referenced this issue Apr 15, 2022
"check-direct" needs to statically link with the libraries, because
it wants to test internal ABI, which is hidden in the share libraries.
When configuring with "--disable-static", static libs are not build
and the test tool cannot be build.

Just skip the test in that case.

#306
@thom311
Copy link
Owner

thom311 commented Apr 15, 2022

fixed by fa7f97f.

@thom311 thom311 closed this as completed Apr 15, 2022
@thesamesam
Copy link
Contributor Author

Thank you!

@thom311
Copy link
Owner

thom311 commented Apr 15, 2022

well, such a plunder... I kept checking things before the release... turned out, immediately an issue can be found.

if it's too severe, we can do a 3.7.0 soon after (no need to wait another 2.5 years) :)

@kloczek
Copy link

kloczek commented Apr 20, 2022

Thx .. indeed that commit fixed linking issue but now again test suite is failing in one unit 😄

===================================
   libnl 3.6.0: ./test-suite.log
===================================

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tests/check-all
=====================

Running suite(s): main
 Abstract addresses
 Netlink attributes
 Clone ematch tree
 netns
90%: Checks: 11, Failures: 1, Errors: 0
tests/nl-test-util.c:98:S:Core:cache_and_clone:0: assert(r == 0) failed (errno=1, Operation not permitted)
FAIL tests/check-all (exit status: 1)

============================================================================
Testsuite summary for libnl 3.6.0
============================================================================
# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See ./test-suite.log
============================================================================
make[2]: *** [Makefile:6799: test-suite.log] Error 1
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libnl-3.6.0'
make[1]: *** [Makefile:6907: check-TESTS] Error 2

@kloczek
Copy link

kloczek commented Apr 20, 2022

FYI I'm runnig my builds in LXC zones which have stripped down some capabilities.

@thesamesam
Copy link
Contributor Author

Maybe the same as #308?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants