Re: solaris 10 x86 problem building snmptrapd 5.4.1-pre3

Thomas Anders <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Ed Ravin wrote:
> This is weird.  I can't build snmptrapd on my Solaris 10 x86 box - see
> below.  Had no such problems with 5.4.  netsnmphelpers.a exists
> and has the entry points defined:
> 
>   # nm /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers/.libs/libnetsnmphelpers.a | grep -i register_null_context
>   [13]    |         0|     132|FUNC |GLOB |0    |2      |netsnmp_register_null_context
> 
> But when I build, it's as if it wasn't there:
> 
> /bin/sh ../libtool  --mode=link /usr/local/bin/gcc -g -O2 -Usolaris2 -Dsolaris2=solaris2 -Wall -Winline -Wstrict-prototypes -Wwrite-strings -Wcast-qual -Wno-char-subscripts -o snmptrapd snmptrapd.lo  libnetsnmptrapd.la -L../snmplib/.libs -L../snmplib -L../agent/.libs -L../agent -L../agent/helpers/.libs -L../agent/helpers -L/usr/local/ssl/lib -R/usr/local/ssl/lib/  ../agent/libnetsnmpmibs.la ../agent/helpers/libnetsnmphelpers.la ../agent/libnetsnmpagent.la ../snmplib/libnetsnmp.la  -lelf  -lnsl -lsocket 
> /usr/local/bin/gcc -g -O2 -Usolaris2 -Dsolaris2=solaris2 -Wall -Winline -Wstrict-prototypes -Wwrite-strings -Wcast-qual -Wno-char-subscripts -o snmptrapd snmptrapd.o  -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers/.libs -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/snmplib/.libs ./.libs/libnetsnmptrapd.a /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpmibs.a -L/usr/local/ssl/lib -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/snmplib -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers ../agent/.libs/libnetsnmpmibs.a /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers/.libs/libnetsnmphelpers.a -ladm ../agent/helpers/.libs/libnetsnmphelpers.a /build/SunOS/netsnmp/net-snmp-5.
 4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a ../agent/.libs/libnetsnmpagent.a /build/
Su
>  nOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/snmplib/.libs/libnetsnmp.a -lwrap -lkvm ../snmplib/.libs/libnetsnmp.a -lkstat -lcrypto -lelf -lnsl -lsocket -R/usr/local/ssl/lib/
> Undefined                       first referenced
>  symbol                             in file
> netsnmp_register_null_context       /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_registry.o)
> netsnmp_register_old_api            /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_registry.o)
> netsnmp_init_helpers                /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(snmp_vars.o)
> netsnmp_get_bulk_to_next_handler    /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_handler.o)
> netsnmp_bulk_to_next_fix_requests   /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(master.o)
> netsnmp_register_null               /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_registry.o)
> ld: fatal: Symbol referencing errors. No output written to snmptrapd
> collect2: ld returned 1 exit status

Interesting. FWIW, this works fine for me on Solaris/Sparc 8/9/10. Not
sure why x86 treats things differently.

Can you please try whether shuffling the order of libnetsnmpagent.[l]a
and libnetsnmphelpers.[l]a around changes things here? Also, do you have
 cc available on this box? If so, does it make a difference if you build
with cc?

The problem is that these five symbols violate the dependency chain (see
http://www.net-snmp.org/wiki/index.php/Library_layering). We'd need to
merge libnetsnmpagent and libnetsnmphelpers to fix this, but feel like
this change is too significant for 5.4.x.


+Thomas

-- 
Thomas Anders (thomas.anders at blue-cable.de)

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.