Re: Cannot build net-snmp for target using cross-compile

Kavita Raghunathan <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <C83EB2BF.35B9%[email protected]>
Please note that I am using net-snmp-5.5, and the with-ld option is not supported: Wish it was.

“
The Net-SNMP project uses the standard configure mechanism, so the usual cross-compilation options are available - in particular --host and --target. It is also possible to specify the compiler and linker to use (--with-cc and --with-ld), and any special flags to pass to them (--with-cflags and --with-ldflags). There shouldn't be anything particularly special about compiling the Net-SNMP code, so see the documentation for your target environment for more information.
“


On 6/16/10 4:37 PM, "Kavita Raghunathan" <[email protected]> wrote:

Hello,
How do I specify the right ld for the build to work ? I’m using linux and while linking with a library that contains the calls from SNMP agent, it uses the wrong link path : /usr/bin/ld

The configure line:
./configure  LD=${CROSS_COMPILE}ld CC=${CROSS_COMPILE}gcc CXX=${CROSS_COMPILE}g++ CFLAGS="-g3 -O0" --prefix=${FILESYSTEM_ROOT_DIR} --host=m68k-linux-gnu --build=i686 --target=m68k-linux-gnu --disable-embedded-perl --without-perl-modules --with-endianness=big --with-default-snmp-version="3" --disable-des --disable-debugging --with-sys-contact="who@where" --with-logfile="/sf_rfs/logs/snmp" --with-transports="UDP TCP" -with-defaults  --with-mib-modules=skyfiber-olu-mib --with-ldflags=LDFLAGS  --with-libs="$NETSNMPDIR/libui.a $NETSNMPDIR/libutl.a /usr/lib/libpthread.a"  > logfile

The link error:
ibtool: link: g++ -g -O2 -Ulinux -Dlinux=linux -o .libs/snmpd .libs/snmpd.o  -L/home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/agent/.libs -L/home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/agent/helpers/.libs -L/home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/snmplib/.libs -L/home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/snmplib -L/home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/agent/helpers -L/home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/agent ./.libs/libnetsnmpagent.so helpers/.libs/libnetsnmphelpers.so ./.libs/libnetsnmpmibs.so /home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/agent/helpers/.libs/libnetsnmphelpers.so /home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/agent/.libs/libnetsnmpagent.so /home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/snmplib/.libs/libnetsnmp.so -ldl ../snmplib/.libs/libnetsnmp.so -lcrypto /home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/libui.a /home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/libutl.a /usr/lib/libpthread.a  -Wl,-rpath -Wl,/home/kraghunathan/views/sfdev-2.0.snmplatest/../ltib/ltib-mcfv4m-20090730//rootfs/lib
/usr/bin/ld: /home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/libui.a(ui_snmp_stubs.o): Relocations in generic ELF (EM: 4)
/usr/bin/ld: /home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/libui.a(ui_snmp_stubs.o): Relocations in generic ELF (EM: 4)
/usr/bin/ld: /home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/libui.a(ui_snmp_stubs.o): Relocations in generic ELF (EM: 4)
/usr/bin/ld: /home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/libui.a(ui_snmp_stubs.o): Relocations in generic ELF (EM: 4)
/usr/bin/ld: /home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/libui.a(ui_snmp_stubs.o): Relocations in generic ELF (EM: 4)
/usr/bin/ld: /home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/libui.a(ui_snmp_stubs.o): Relocations in generic ELF (EM: 4)
/usr/bin/ld: /home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/libui.a(ui_snmp_stubs.o): Relocations in generic ELF (EM: 4)
/home/kraghunathan/views/sfdev-2.0.snmplatest/src/thirdparty/net-snmp-5.5/libui.a: could not read symbols: File in wrong format

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo

_______________________________________________
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.