Files
Khem Raj d1384edec1 net-snmp: Backport upstream fix for explicit library linking
libnetsnmptrapd uses symbols that live in libnetsnmpagent, but
apps/Makefile.in only passes $(MIBLIB) and $(USELIBS) to the link. That
works with GNU ld, which resolves symbols through the DT_NEEDED entries
of the libraries named on the command line, and libnetsnmpmibs records a
dependency on libnetsnmpagent. lld deliberately does not, so the link
fails:

| ld.lld: error: undefined symbol: init_vacm_config_tokens
| >>> referenced by snmptrapd_auth.c:51
| >>>               .libs/snmptrapd_auth.o:(init_netsnmp_trapd_auth)
| ld.lld: error: undefined symbol: send_v2trap
| >>> referenced by snmptrapd_handlers.c:886
| >>>               .libs/snmptrapd_handlers.o:(axforward_handler)

Backport upstream commit 5e66246bd994 which names $(AGENTLIB) explicitly
and additionally links libcrypto into libnetsnmpmibs and the apps, both
of which rely on the same transitive resolution. The libnetsnmptrapd.la
hunk is rebased because 5.9.5.2 still puts $(LDFLAGS) at the end of that
link command.

Verified on aarch64 for qemuarm64: do_compile fails before the change
with the errors above; after it do_compile and do_package succeed and
libnetsnmptrapd.so records DT_NEEDED on libnetsnmpmibs, libnetsnmpagent
and libnetsnmp directly.

Tested-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-08-06 23:32:03 -07:00
..