Bug 212612 - dhcp won't compile with RHEL4 gcc
Summary: dhcp won't compile with RHEL4 gcc
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: dhcp
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: David Cantrell
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-10-27 18:42 UTC by Jeff Johnson
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-10-30 21:07:18 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jeff Johnson 2006-10-27 18:42:23 UTC
dcantrell: Thank you *very* much for cleaning up the mess in dhcp.

Here's a simple patch that works around an arcane compilation problem
with gcc shipped in RHEL4. All the patch does is rearrange a generated
include to define an enum before using in a typedef and prototypes.

The better fix would be to generate the file correctly, as there's another identical
patch I'm about to post against dhcpv6, exactly the same issue.

If you're *really* energetic, the gcc problem should be fixed as well ;-)

Comment 1 David Cantrell 2006-10-27 18:51:39 UTC
No problem.  I had to make the source RPM more manageable.  The previous
maintainer was a bit sloppy with patches and history and didn't care about
making use of CVS and tags.

Anyways, where is the patch?

I'll go ahead and fix up dhcp and dhcpv6 as well since I own both of those.

Comment 2 Jeff Johnson 2006-10-27 19:04:02 UTC
I've sent the patch privately, otherwise fish the patch out of
    http://wraptastic.org/pub/jbj/dhcp-3.0.4-23.src.rpm
which I just built. The spec file application is a bit wonky
since the patch has to be applied after the file is generated.

Comment 3 David Cantrell 2006-10-27 19:13:58 UTC
Sent it privately to what address?

Comment 4 Jeff Johnson 2006-10-27 19:26:11 UTC
Hehe, yours: <dcantrell>

Patch also copied to
    http://wraptastic.org/pub/jbj/dhcp-3.0.4-tklc.patch
and eixstence at that URI verified.

Comment 5 Jeff Johnson 2006-10-27 19:42:04 UTC
Same patch to libdhcp as well.

I've copied patches and *.src.rpm's for all of the above to http://wraptastic.org/pub/jbj,
but its all exatly the same rearrangement.

Note that libdhcpv6 "compiles", but installs the boogered file, so libdhcp build fails later.

Comment 6 David Cantrell 2006-10-30 21:07:18 UTC
I've built new dhcp and libdhcp packages that fix these issues.  They are in
rawhide now:

dhcp-3.0.4-24.fc7
libdhcp-1.17-1.fc7

Comment 7 Jeff Johnson 2006-10-30 23:20:39 UTC
Yes, thanks.

The dhcpv6 package needs the same patch as dhcp. The failure
comes when linking libdhcp from including
     /usr/include/dhcp6client/libdhcp_control.h

libdhcp has other issues, needs a modern <sys/queue.h> as
well as modern <linux/netlink.h> and <linux/rtnetlink.h>

There are copies of the changes I'm making to compile with
RHEL4/CentOS4 at http://wraptastic.org/pub/jbj

There's also mkinitrd fiddles there to compile. I'll know in
the next day or two whether "functional" and then will
attempt better than slamming a private copy of queue.h et al
into libdhcp/mkinitrd.

Meanwhile, the same dhcp patch is also needed in dhcpv6.

Comment 8 David Cantrell 2006-10-31 22:04:49 UTC
libdhcp uses <sys/queue.h>.  dhcpv6 has a static copy of an old BSD queue.h, but
I've removed that and have it using the glibc queue.h.

Both libdhcp and dhcpv6 include the netlink headers in /usr/include.  There are
no static copies.

Comment 9 Jeff Johnson 2006-11-01 13:14:08 UTC
Using <sys/queue.h> creates instant legacy, as the queue.h from RHLE4 glibc
is not updated. Including private "new" queue.h is one solution, rewriting the
code to not depend on silly BSD macros is another.

I'll send you a patch to internalize the macros from <sys/queue.h> so
that the "old" vs "new" issue disappears if you want. Otherwise, slamming
a later queue.h into libdhcp and mkinitrd is an efficient solution, just pugly.

netlink.h and rtnetlink.h are trickier. In my case I'm building for 2.6.18 and
cannot change the development environment. So I include netlink.h from
rtnetlink.h from 2.6.18. Perfectly understood why that is a crazy thing to do.

Thanks for dhcpv6 fixing.

Comment 10 David Cantrell 2006-11-01 17:18:42 UTC
I'm not a fan of carrying forward archaic BSD code.  Using the glibc-provided
queue.h seemed fine to me, but I'm not opposed to rewriting the code to not use
the BSD stuff.

I would much prefer a rewrite than to drop a later queue.h in the code.  Send
patches on over for other ways to fix this problem.

Regarding the netlink.h and rtnetlink.h...I'm going to say that's a side effect
of your development environment requirements.  I don't want to drop specific
versions of those in to the source since they are provided on the target build
system anyway.  But I think you understand that.

Thanks for the help.

Comment 11 Jeff Johnson 2006-11-01 17:27:59 UTC
Perfectly understood. I ain't happy carrying around private copies of include files either.

I'll drop you a patch to rewrite dhcp* without including <sys/queue.h>
down the road a bit. I gotta figger mkinitrd functionality first.

Thanks for fixing, less code I have to maintain.

Wotta bloody mess dhcp code is, sigh. Its amazing that so much depends
on this ugly rotten code base.


Note You need to log in before you can comment on or make changes to this bug.