How to cross compile NET-SNMP

Hector Oron <[email protected]>
Newsgroups gmane.linux.debian.devel.embedded,gmane.network.net-snmp.user
Message-ID <[email protected]>
Hello folks,

 I've been trying to cross-compile net-snmp for ppc over i386. I have build
a script with some of the options that we should select. I'm able to
generate my binary file, but when i start snmpd agent it doesn't work as I
expect.

Target: MPC-855 (ppc), glibc-1.99, kernel-2.4.18
Host: i686 (pentium4), glibc-2.3.2, kernel-2.6.8 and kernel-2.4.27 (i have
tried both)
Toolchain: 1) Crosstool - gcc-3.4.0 - glibc-2.3.2
                 2) Emdebian toolchain - gcc-3.3 - glibc-2.3.2

I have build a script with several switches for cross compilation, "mytool"
(see attachment)
I have been able to generate a binary file by several ways, but i got stuck
starting snmpd agent:

$ file usr/sbin/snmpd
usr/sbin/snmpd: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1
(SYSV), for GNU/Linux 2.2.0, statically linked, not stripped

$ cat /etc/snmp/snmpd.conf
rocommunity open_public

When I start daemon as: / # snmpd -DALL -Le -f -C -c /etc/snmp/snmpd.conf
[...]
wtest: oid cmp: .2 --- off = 1, in off = 1 test = 1
trace: netsnmp_ds_set_string(): default_store.c, 283:
netsnmp_ds_set_string: Setting LIB:6 = "snmpd"
trace: snmpd_register_config_handler(): agent_read_config.c, 281:
snmpd_register_app_config_handler: registering .conf token for
"injectHandler"
trace: netsnmp_register_callback(): callback.c, 159:
callback: registered (0,0) at 0x101997a8 with priority 0
trace: netsnmp_callback_transport(): snmpCallbackDomain.c, 416:
transport_callback: initialized master listening on 1
%----  here it doesn't show any more output

On my host (working fine), it continues as follows:
trace: which_module(): parse.c, 3590:
parse-mibs: Module SNMPv2-SMI not found
trace: which_module(): parse.c, 3590:
parse-mibs: Module RFC1155-SMI not found
trace: which_module(): parse.c, 3590:
parse-mibs: Module RFC1213-MIB not found
trace: netsnmp_tdomain_init(): snmp_transport.c, 191:
tdomain: netsnmp_tdomain_init() called
trace: netsnmp_tdomain_dump(): snmp_transport.c, 236:
tdomain: domain_list -> { iso.3.6.1.6.1.1, "udp" } -> { iso.3.6.1.3.91.1.1,
"tcp" } -> { iso.3.6.1.4.1.8072.3.3.2, "unix" } -> {
iso.3.6.1.4.1.8072.3.3.4, "udp6/ipv6/udpv6/udpipv6" } -> {
iso.3.6.1.4.1.8072.3.3.5, "tcp6/tcpv6/tcpipv6" } -> [NIL]
[...]

That happens when compiling statically, but when i compile dinamically it is
missing some libraries, some of them included in glibc (libm, libwrap0,
libz, ...)

I have try all the posible configurations on "mytool" and some more, with
same results, some help would be appreciated, also i'd give some cash in
case of submitting a working binary (or working solution) for my target
board.

You have a explanation of the problem here:
http://linuxupc.upc.es/~hecormar/netsnmp/ with config.log files and debug
messages when starting snmpd agent.

Please, ask for extra information if you need it.

Best Regards,
 Hector Oron
mytool (application/octet-stream, 5.9 KB) - not displayed
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.