[quagga-dev 10295] Re: FreeBSD 4.11 support -- patches included
jim at carroll.com
Sun Mar 3 15:42:34 GMT 2013
Your right about FreeBSD 4 being old. But we still have a large number of
these systems in operation -- some plugged into proprietary hardware with
specific driver/OS requirements and others installed at far remote
facilities without easy access. For the most part, we have been comfortably
running the older Zebra package with no trouble, but we recently began
introducing RIPv2 into our OSPF domain and discovered a serious bug in route
distribution. I'll spare you the long bug story, but the short version is
that modern quagga does not exhibit the bug.
As for why we couldn't just upgrade FreeBSD to use a more modern toolchain.
Unfortunately, upgrading GCC on FreeBSD has always been quite complex. BSD
is inexorably tied to a specific edition of GCC, and trying to introduce a
newer version is no easy feat -- not to mention, the latest editions of GCC
refuse to compile without significant amounts of support code (such as gimp)
-- which are themselves quite difficult to get working on FreeBSD 4x. (FYI
-- we did try this first).
In general, most of the patches inserted '#ifdef...' statements to
selectively enable/disable those features that relied on GCC. The only
exception to this was the 'configure' script dropping --std=gnu99. I
suppose we could remove this from the patch, and add some sort of
README/PORTING note about specifying CFLAGS to effectively configure on
FreeBSD? Does that seem like a reasonable compromise?
Finally, regarding why we targeted the __FreeBSD__ define, rather than
trying to identify the GCC edition. It seemed to me that the limitation was
an OS issue, but one could easily (and rightly) suggest it was compiler. We
checked the defines available and here is what we found available:
$ gcc -dM -E - </dev/null
#define __FreeBSD__ 4
#define __FreeBSD_cc_version 460001
#define __i386__ 1
#define __i386 1
#define __GNUC_MINOR__ 95
#define i386 1
#define __unix 1
#define __unix__ 1
#define __GNUC__ 2
#define __ELF__ 1
#define unix 1
If you think the GCC #ifdef would be better, we'd be happy to alter the
patch and resubmit.
Thanks for your comments.
> -----Original Message-----
> From: Greg Troxel [mailto:gdt at ir.bbn.com]
> Sent: Saturday, March 02, 2013 12:21 PM
> To: Jim Carroll
> Cc: quagga-dev at lists.quagga.net
> Subject: Re: [quagga-dev 10291] FreeBSD 4.11 support -- patches
> FreeBSD 4 was obsoleted by FreeBSD 5.0, released in January 2003, which
> is now 10 years ago. (I realize that FreeBSD 5 was a much more
> significant change compared to many others, and that it gave rise to
> I am not really clear on the history, but I think quagga made a
> to require C99.
> It's not clear if your patch changes behavior on other platforms
> (dropping --std=gnu99). (Actually, that should perhaps be c99 not
> gnu99, but that's a separate issue.)
> Your patch is mangled (extra blank lines).
> Have you tried using a modern compiler on 4.11? Or are you only using
> the provided compiler?
> If there is support for old gcc, that should probably be ifdefed for
> that, and that define set of FreeBSD 4, rather than open coding that
> FreeBSD 4 needs it.
> In general though, I'm not sure there is much enthusiasm for supporting
> pre-C99 compilers.
> Can you explain the above issues a bit more, in particular why using
> FreeBSD 4 leads to using an ancient compiler?
More information about the Quagga-dev