Altera_Forum
Honored Contributor
20 years agoBuilding net-snmp for uClinux in FLT format
Hi all. I'm trying to build net-snmp for Nios II uClinux (specifically its agent, snmpd). I found an account of how to do this from forum member "temex" at http://forum.niosforum.com/forum/index.php?showtopic=2955 (http://forum.niosforum.com/forum/index.php?showtopic=2955) (see post# 5 in that topic)), but I seem to be missing the final step and I'm hoping someone here can help.
I downloaded the same version of net-snmp mentioned by temex (5.2.2), but I don't have the (expensive) Microtronix Nios II Linux CDK, so I downloaded what appears to be a very similar thing from http://scorpius.homelinux.org/~marc/nios2.html (http://scorpius.homelinux.org/~marc/nios2.html) (see "binary snapshot of the toolchain", near the bottom of that page). I installed that on a Linux PC and then followed the instructions from temex to build net-snmp for Nios II Linux, which went fine. However, the binaries that it produced were in the ELF format, and uClinux only accepts FLT. So, my problem is: "what do I have to do to get FLT binaries?" I've already tried one approach. I've got the Microtronix Nios II Linux Distribution 1.4 on a Windows PC (which has Quartus II 5.1 and the Nios II Development Kit 5.0), so I tried looking at what its tools do to make FLT binaries. In the Rules.mak for a Nios II Linux Application Project, it uses a program called elf2flt to do this, but when I tried to use that program on the ELF binary that I'd made for snmpd, it died complaining that "Input file contains no relocation info". I noticed that the Rules.mak file used some linker options that might be needed to make elf2flt work on the resulting ELF file (it uses -r, -d, -Ur, and -T <a particular linker script>), so I tried making the net-snmp build process use those options by giving --with-ldflags="..." to ./configure. (I had to leave out -d because, when I supplied it, ./configure complained that nios2-linux-gcc couldn't make executables and wouldn't proceed.) However, when I built with these extra flags and tried to convert the ELFs, elf2flt still died with the same complaint. This seems odd to me, because the -r flag means to make a relocatable file, which is what elf2flt was demanding. I think the resulting ELF files might have been the same size as before, too ... So ... does anyone know what I've done wrong? http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif Thanks in advance.