Re: Patchset to fix ipfilter build breakage

From: Ruslan Ermilov <ru_at_FreeBSD.org>
Date: Thu, 28 Apr 2005 11:06:43 +0300
Hi Darren,

On Wed, Apr 27, 2005 at 04:32:06PM +0000, Darren Reed wrote:
> On Tue, Apr 26, 2005 at 06:56:08PM +0300, Ruslan Ermilov wrote:
> > - rescue is still broken: the libipf library is a
> >   culprit -- it has a lot of undefined symbols that
> >   consumers are expected to provide, thus preventing
> >   it to be used in rescue.  When compiling a rescue
> >   binary, it fails with the following:
> ...
> 
> I've been thinking and discussing this.
> 
> Firstly, we don't need all the tools, just ipf should be ok.
> 
> So the trick then is to compile all of the libipf .o's into ipf.lo or
> link libipf.a into ipf.lo
> 
> How's that sound to you?  Can you please supply patch to fix that ? O:-)
> 
The attached patch does this, plus the following:

- removes NetBSD'ism from makefiles, such as including bsd.own.mk,
- fixes one of the compile warnings (easy one),
- adds NO_WERROR to sbin/ipf/Makefile.inc as there's still some
  number of compile warnings, most of them are real bugs on 64-bit
  platforms (see below),
- makes libipf an internal (compile-time only) library,

The unfixed warnings (on amd64) are:

: Script started on Thu Apr 28 10:24:07 2005
: 
: --------------------------------------------------------------
: >>> stage 4.4: building everything
: --------------------------------------------------------------
: ===> sbin/ipf (all)
: ===> sbin/ipf/libipf (all)
: /usr/src/sbin/ipf/libipf/../../../contrib/ipfilter/lib/printstate.c: In function `printstate':
: /usr/src/sbin/ipf/libipf/../../../contrib/ipfilter/lib/printstate.c:71: warning: long long int format, long unsigned int arg (arg 2)
: /usr/src/sbin/ipf/libipf/../../../contrib/ipfilter/lib/printstate.c:71: warning: long long int format, long unsigned int arg (arg 3)
: /usr/src/sbin/ipf/libipf/../../../contrib/ipfilter/lib/printstate.c:71: warning: long long int format, long unsigned int arg (arg 4)
: /usr/src/sbin/ipf/libipf/../../../contrib/ipfilter/lib/printstate.c:71: warning: long long int format, long unsigned int arg (arg 5)
: /usr/src/sbin/ipf/libipf/../../../contrib/ipfilter/lib/printstate.c:71: warning: long long int format, long unsigned int arg (arg 6)
: /usr/src/sbin/ipf/libipf/../../../contrib/ipfilter/lib/printstate.c:71: warning: long long int format, long unsigned int arg (arg 7)
: /usr/src/sbin/ipf/libipf/../../../contrib/ipfilter/lib/printstate.c:71: warning: long long int format, long unsigned int arg (arg 8)
: /usr/src/sbin/ipf/libipf/../../../contrib/ipfilter/lib/printstate.c:71: warning: long long int format, long unsigned int arg (arg 9)

Fixing the format specifiers to %qu doesn't work, I don't know if this is a bug or
not that %qu produces a warning when supplied a u_quad_t argument, but I see a
deprecation warning.  I think uint64_t should be used explicitly.

: ===> sbin/ipf/ipf (all)
: ===> sbin/ipf/ipfs (all)
: ===> sbin/ipf/ipfstat (all)
: ===> sbin/ipf/ipftest (all)
: /usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c: In function `fr_ipid_newfrag':
: /usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c:397: warning: cast to pointer from integer of different size
: /usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c: In function `fr_ipid_knownfrag':
: /usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c:582: warning: cast from pointer to integer of different size

This should be easy to fix.  These same (and only these) warnings also prevent the
ipf.ko from being compiled on amd64.

: ===> sbin/ipf/ipmon (all)
: /usr/src/sbin/ipf/ipmon/../../../contrib/ipfilter/tools/ipmon.c: In function `print_statelog':
: /usr/src/sbin/ipf/ipmon/../../../contrib/ipfilter/tools/ipmon.c:887: warning: long long int format, long unsigned int arg (arg 3)
: /usr/src/sbin/ipf/ipmon/../../../contrib/ipfilter/tools/ipmon.c:887: warning: long long int format, long unsigned int arg (arg 4)
: /usr/src/sbin/ipf/ipmon/../../../contrib/ipfilter/tools/ipmon.c:887: warning: long long int format, long unsigned int arg (arg 5)
: /usr/src/sbin/ipf/ipmon/../../../contrib/ipfilter/tools/ipmon.c:887: warning: long long int format, long unsigned int arg (arg 6)
: /usr/src/sbin/ipf/ipmon/../../../contrib/ipfilter/tools/ipmon.c:887: warning: long long int format, long unsigned int arg (arg 7)
: /usr/src/sbin/ipf/ipmon/../../../contrib/ipfilter/tools/ipmon.c:887: warning: long long int format, long unsigned int arg (arg 8)
: /usr/src/sbin/ipf/ipmon/../../../contrib/ipfilter/tools/ipmon.c:887: warning: long long int format, long unsigned int arg (arg 9)
: /usr/src/sbin/ipf/ipmon/../../../contrib/ipfilter/tools/ipmon.c:887: warning: long long int format, long unsigned int arg (arg 10)

This is like the above warning.

: ===> sbin/ipf/ipnat (all)
: ===> sbin/ipf/ippool (all)
: ===> sbin/ipf/ipresend (all)
: 
: Script done on Thu Apr 28 10:24:56 2005


Hope this helps,
-- 
Ruslan Ermilov
ru_at_FreeBSD.org
FreeBSD committer

Received on Thu Apr 28 2005 - 06:06:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:33 UTC