Re: [uCsimm] snmpd from coldfire

From: Erwin Authried (eauth@softsys.co.at)
Date: Tue May 22 2001 - 12:09:13 EDT


Tom Walsh[SMTP:tom@cyberiansoftware.com] wrote:
> Joaquin Garay wrote:
> >
> > Hi,
> >
> > I'm trying to port the snmpd from the coldfire distribution to the
> > ucsimm. So far, I've compiled all the objs and tried to link them. Using
> > the makefile below, it returns the following error:
> >
> > snmpd.o(.text+0x3e8):snmpd.c: undefined reference to `__ntohs'
> > /opt/uClinux/lib/gcc-lib/m68k-pic-coff/2.7.2.3-pic-060999/libgcc.a(_exit.o):
> > In function `exit':
> > libgcc2.c(.text+0xc): relocation truncated to fit: DISP16 _cleanup
> > snmpd.o(.text+0x3e8):snmpd.c: undefined reference to `__ntohs'
> > /opt/uClinux/lib/gcc-lib/m68k-pic-coff/2.7.2.3-pic-060999/libgcc.a(_exit.o):
> > In function `exit':
> > libgcc2.c(.text+0xc): relocation truncated to fit: DISP16 _cleanup
> > mv: cannot stat `snmpd': No such file or directory
> > Can't open snmpd.coff
> > make: *** [snmpd] Error 1
> >
>
> You didn't say which kernel that you are compiling against, the
> assumption is that you are using the 2.0.38 kernel? You are missing a
> header file somplace. If you do some research on the libc, you will
> find that it has no function named 'ntohs', try this: 'grep ntohs
> libc.a', nothing found. Now do this: 'find linux/include -type f | xargs
> fgrep ntohs', lots of hits. Look at
> linux/include/asm/byteorder.h...
>
>
> TomW

Yeah, just include <asm/byteorder.h>. And don't forget to compile with -O or -O2,
otherwise the ntohs function will not be inlined. And since you are obviously
using the gcc with my 32-bit PIC patch, don't forget to add a _cleanup() dummy
function at the end of your object files, or add it to libc so that you can forget
this nasty problem forever.

-Erwin

This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:43 EST