#2415 [patch] 5.7.2 build failure without /dev/kmem

freeBSD
open
nobody
5
2012-11-08
2012-10-14
No

The attached patch resolves this issue.

In a FreeBSD jail or other scenario where /dev/kmem is not present, the build fails with the following error message:
/bin/sh ../libtool --mode=link clang -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -fno-strict-aliasing -pipe -march=native -Ufreebsd9 -Dfreebsd9=freebsd9 -o snmpd snmpd.lo -L/usr/lib -lm -lkvm -ldevstat libnetsnmpagent.la libnetsnmpmibs.la ../snmplib/libnetsnmp.la -lelf -lssp_nonshared
libtool: link: clang -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -fno-strict-aliasing -pipe -march=native -Ufreebsd9 -Dfreebsd9=freebsd9 -o .libs/snmpd .libs/snmpd.o -L/usr/lib ./.libs/libnetsnmpagent.so ./.libs/libnetsnmpmibs.so /usr/ports/net-mgmt/net-snmp/work/net-snmp-5.7.2/agent/.libs/libnetsnmpagent.so -lwrap /usr/ports/net-mgmt/net-snmp/work/net-snmp-5.7.2/snmplib/.libs/libnetsnmp.so ../snmplib/.libs/libnetsnmp.so -lm -lkvm -ldevstat -lcrypto -lelf -lssp_nonshared -Wl,-rpath -Wl,/usr/local/lib
./.libs/libnetsnmpmibs.so: undefined reference to `kd'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop in /usr/ports/net-mgmt/net-snmp/work/net-snmp-5.7.2/agent.
*** Error code 1

Stop in /usr/ports/net-mgmt/net-snmp/work/net-snmp-5.7.2.
*** Error code 1

Stop in /usr/ports/net-mgmt/net-snmp.
*** Error code 1

Stop in /usr/ports/net-mgmt/net-snmp.

Discussion

  • Thomas Anders

    Thomas Anders - 2012-10-15

    What's your exact configure line? Did you include the "--without-kmem-usage" option?

     
  • Ryan Steinmetz

    Ryan Steinmetz - 2012-10-24

    --without-kmem-usage was included in the configure arguments, however, did not resolve the issue.

    $ ./configure --enable-shared --enable-internal-md5 --with-default-snmp-version=3 --with-sys-contact=nobody@nowhere.invalid --with-sys-location=somewhere --with-logfile=/var/log/snmpd.log --with-persistent-directory=/var/net-snmp --with-gnu-ld --with-libwrap --with-ldflags=-lm -lkvm -ldevstat --with-openssl=/usr --with-dummy-values --with-perl-modules --disable-embedded-perl --with-dmalloc=/usr/local --with-libs=-lssp_nonshared --with-mib-modules=host disman/event-mib smux mibII/mta_sendmail mibII/tcpTable ucd-snmp/diskio sctp-mib --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/ --build=i386-portbld-freebsd9.0

     
  • Ryan Steinmetz

    Ryan Steinmetz - 2012-10-24

    Oops, the configure line pasted was from another version of the port. The correct line is:
    $ ./configure --enable-shared --enable-internal-md5 --with-default-snmp-version=3 --with-sys-contact=nobody@nowhere.invalid --with-sys-location=somewhere --with-logfile=/var/log/snmpd.log --with-persistent-directory=/var/net-snmp --with-gnu-ld --with-libwrap --with-ldflags=-lm -lkvm -ldevstat --without-kmem-usage --with-openssl=/usr --with-dummy-values --with-perl-modules --disable-embedded-perl --with-dmalloc=/usr/local --with-libs=-lssp_nonshared --with-mib-modules=host disman/event-mib smux mibII/mta_sendmail mibII/tcpTable ucd-snmp/diskio sctp-mib --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/ --build=i386-portbld-freebsd9.0

     

Log in to post a comment.