Re: ./snmpd:not found
Sylvain Dery <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
The problem here was that I was trying to statically compile the snmpd. and obviously by looking at the size of snmpd it was dynamically linked. The size of snmpd was 32K, while it should be around 1Meg! So, the question is: why does it not statically compile despite the proper flags beeing set ? The answer is: DO NOT SPECIFY a "-v" flag (verbose output) in the CFLAGS!!! If you do so, the config script will think static linking is not supported and a dynamic version will be created instead, without properly warning you! If you look carefully in the generated output file, you will see a line warning you of the fact, but it is lost in soooo many other things... Anyways, many thanks for those of you who spent time trying to solve this issue with me. Sylvain ________________________________ From: Dave Shield <[email protected]> To: Sylvain Dery <[email protected]> Cc: [email protected] Sent: Mon, March 15, 2010 11:29:48 AM Subject: Re: ./snmpd:not found On 15 March 2010 15:22, Sylvain Dery <[email protected]> wrote: > $ ldd ./snmpd > not a dynamic executable > $ file ./snmpd > ./snmpd: ELF 32-bit LSB executable, ARM, version 1, > dynamically linked (uses shared libs) Hmmm... So one command states that it's not using shared libraries, while the other claims that it is? That sounds strange to me. I presume this is being built for some form of embedded system. Have you tried asking for advice from that community? They probably know more about the pitfalls of porting software to that environment than we do. Dave ________________________________ From: Sylvain Dery <[email protected]> To: [email protected] Sent: Fri, March 12, 2010 3:19:16 PM Subject: Re: snmpd: not found I did run make install, and copied everything but the many .h files (I had to remove the .h file since the target is limited in disk spave). Here is the script I am using to run the install command: MAKELEVEL=3 GATEWAY_COMPILATION_PLATFORM= arm MFLAGS=-w MAKEFLAGS=w LD_LIBRARY_PATH=$LD_LIBRARY_ PATH:/usr/local/lib CFLAGS="-v -W -Wall -fPIC -mcpu=ep9312 -mfix-crunch-d1 -Wno-deprecated -DUSE_PTHREADS -MMD -DVOCAL_USE_DEPRECATED" CPPFLAGS="-v -W -Wall -fPIC -mcpu=ep9312 -mfix-crunch-d1 -Wno-deprecated -DUSE_PTHREADS -MMD -DVOCAL_USE_DEPRECATED" CONFIGURE_ARGS="--target=arm- linux --host=i686-linux" export CONFIGURE_ARGS export CPPFLAGS export CFLAGS export LD_LIBRARY_PATH export MAKELEVEL export GATEWAY_COMPILATION_PLATFORM export MFLAGS export MAKEFLAGS ./configure --host=arm-linux --target=arm-linux --with-cc=/usr/local/arm/ ep93xx-d1/bin/arm-linux-gcc --disable-applications --disable-manuals --disable-scripts --disable-snmpv1 --disable-privacy --disable-md5 --without-openssl --enable-mini-agent --with-out-mib-modules=" examples/ucdDemoPublic" --with-persistent-directory="/ var/net-snmp" --with-logfile="/var/log/ snmpd.log" --with-default-snmp-version=" 2" --with-install-prefix="/home/ sylvain/Download/net- snmp-5.5/ARG-temp-install" --with-ldflags=-Bstatic ________________________________ From: Magnus Fromreide <[email protected]> To: Sylvain Dery <[email protected]> Cc: [email protected] Sent: Fri, March 12, 2010 1:41:22 PM Subject: Re: snmpd: not found On Fri, Mar 12, 2010 at 09:24:27AM -0800, Sylvain Dery wrote: > Hi, > > I'm compiling net-snmp for an arm-linux embedded system. However, when I try to run the snmp daemon on the embedded system, I get: > > /usr/local/sbin # ./snmpd > -sh: ./snmpd: not found > > But it is there!: > /usr/local/sbin # ls -la ./snmpd > -rwxr-xr-x 1 root root 32859 Mar 10 14:40 2010 ./snmpd > > Any idea what is going on? > Given the size of the object my guess would be that you did ./configure <options> make and then copied agent/.libs/snmpd to your device. Is that so? If that is the case then you have only the driver for the agent, you need the shared libraries as well since they contain the actual code of the agent. I would suggest that you do 'make install' and copy the generated tree to your device, then you could start removing things. I do not think you should need anything but the libraries and the binary. Please also see http://www.net-snmp.org/wiki/index.php/FAQ:Compiling_04 /MF ________________________________ From: Sylvain Dery <[email protected]> To: [email protected] Sent: Fri, March 12, 2010 12:24:27 PM Subject: snmpd: not found Hi, I'm compiling net-snmp for an arm-linux embedded system. However, when I try to run the snmp daemon on the embedded system, I get: /usr/local/sbin # ./snmpd -sh: ./snmpd: not found But it is there!: /usr/local/sbin # ls -la ./snmpd -rwxr-xr-x 1 root root 32859 Mar 10 14:40 2010 ./snmpd Any idea what is going on? Thanks! ------------------------------------------------------------------------------ _______________________________________________ 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