On Fri, 2013-11-01 at 09:22 +0800, yin.yao wrote: > Hi, > I want to transplant netsnmp into my embedded device. > Here is my configure option: > CC=arm-none-linux-gnueabi-gcc ./configure > --prefix=/usr/local/net-snmp-5.7.2/yaoyin > --with-default-snmp-version="2" --with-logfile="/var/log/snmpd.log" > --with-persistent-directory="/var/net-snmp" > --host=arm-none-linux-gnueabi --disable-ipv6 --with-endianness=little > --disable-embedded-perl --disable-perl-cc-checks > --with-mib-modules="IPCBA-MIB" --disable-debugging > --disable-applications --with-ldflags=-Bstatic > For some reason,I don't use --enable-mini-agent . > when I run snmpd in my embedded device,I encounter an error like > this: > Inconsistency detected by ld.so: dl-deps.c: 622: _dl_map_object_deps: > Assertion `nlist > 1' failed! > Then,I copy all libs into /usr/lib of my embedded device,these libs > are below: > libnetsnmp.a libnetsnmp.so.30.0.2 libnetsnmpagent.so.30 > libnetsnmp.la libnetsnmpagent.a > libnetsnmpagent.so.30.0.2 > libnetsnmp.so libnetsnmpagent.la > libnetsnmp.so.30 libnetsnmpagent.so > After I do this, I run snmpd again. This time,everything is ok. > But these lib are 16M . It's too large for my embedded device. > Please help me solove this problem!!
The libraries contains parts of the application code so they are necessary, but see below. I will try to list your options in order of increasing painfulness :-) * Add "CFLAGS=-Os" to the configure command line. This tell the compiler to optimize for size. * You do not need the .a and .la files, so do not copy those. * Add "--enable-minimalist" to the configure command line, this will remove a bunch of unused code. Note that this option implicitly sets --enable-mini-agent so you have to disable that manually with an extra --disable-mini-agent after it on the configure command line. * Add "--without-opaque-special-types" to the configure command line, this removes an extension to the snmp protocol that you probably won't need. * Add "--disable-deprecated" to the configure command line, this removes compatibility code that provided older interfaces that shouldn't be used. * You do not say it outright but if snmpd is the only program on your device that uses the net-snmp libs then you could try to link the application statically, this is done through the configure flag "--disable-shared". * Do consider using --enable-mini-agent - it's effect is to remove some mib modules that aren't required. Good luck. /MF ------------------------------------------------------------------------------ Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders