[uClibc]Compiling iptables with uClibc

Andrew Mashchak admash at southern.edu
Wed Mar 21 16:52:45 UTC 2001


On Wed, Mar 21, 2001 at 10:16:49AM +0200, michaels at jungo.com wrote:
> Andrew,
> 
> What you see is not really a problem. I have seen similar behaviour when
> creating dependencies (make dep) for several packages, when gcc is used
> with -M flag. The warning just says: "I am not linking any object, so
> why did you specify me a linker  and an object file?". 
Now that I don't have to worry about the warnings, I get this error at the end:

Something wrong... deleting dependencies.
make: *** [/usr/src/linux/include/dlfcn.h] Error 1

However, there is no dlfcn.h file in the whole kernel source. There is a dlfcn.h in sysdeps/linux/i386/bits/dlfcn.h in the uClibc sources. But it has the line:

# error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."

So I assume that in and of itself won't work. I found /usr/include/dlfcn.h and copied it into iptables' include/ directory. Running make this time got a lot farther, but resulted in these errors:

include/dlfcn.h:45: parse error before `__THROW'
include/dlfcn.h:45: warning: type defaults to `int' in declaration of `__THROW'
include/dlfcn.h:45: warning: data definition has no type or storage class
<snip repeated warnings/errors>
iptables.c: In function `find_match':
iptables.c:655: warning: implicit declaration of function `dlopen'
iptables.c:667: warning: implicit declaration of function `dlerror'
iptables.c:667: warning: format argument is not a pointer (arg 4)
iptables.c: In function `find_target':
iptables.c:920: warning: format argument is not a pointer (arg 4)

I assume that the implicit declaraton warnings are due to the parse errors...
I'm not sure what the problem with __THROW is, however. After a bit a net searching and educated guessing, I've put the following files/dirs into iptables' include dir (primarily because libc-version.h includes some pertinent looking __THROW stuff):

/usr/include/features.h
/usr/include/gnu/
/usr/include/gnu/stubs.h
/usr/include/gnu/lib-names.h
/usr/include/gnu/libc-version.h

This seems to fix the __THROW errors. (I have no idea if this is actually a valid fix. ;)  ) Now make returns these:

In file included from /usr/local/uClibc/include/stdio.h:473,
   from extensions/libip6t_multiport.c:2:
   /usr/local/uClibc/include/bits/stdio.h:40: arguments given to macro `getchar'
<snip repeated errors>
In file included from /usr/local/uClibc/include/stdio.h:473,
   from iptables.c:25:
   /usr/local/uClibc/include/bits/stdio.h:40: arguments given to macro `getchar'

The referenced snippet of code from bits/stdio.h is: 

__STDIO_INLINE int
getchar (void) __THROW
{
  return _IO_getc (stdin);
}

At this point, I'm not sure whether what I've done is Correct(tm) or what I should do next.  Please advise. :)

TIA,

 -Andrew

> Andrew Mashchak wrote:
> > 
> > Running make results in many repetitions of these lines:
> > 
> > gcc: /usr/local/uClibc/crt0.o: linker input file unused since linking not done
> > gcc: --dynamic-linker: linker input file unused since linking not done
> > gcc: /lib/ld-linux.so.1: linker input file unused since linking not done
> > gcc: -luClibc: linker input file unused since linking not done

--
admash at southern.edu






More information about the uClibc mailing list