PATCH: FreeBSD system header didn't like the move to __GNUC__ == 3
Loren James Rittle
rittle@latour.rsch.comm.mot.com
Mon Feb 19 22:10:00 GMT 2001
To whomever had the great idea of upping __GNUC__ last week instead of
waiting until the day before the 3.0 release, I salute you. Other
developers that support an OS where gcc is the default system compiler
may want to assign someone to carefully check their system headers and
assumptions on __GNUC__ usage. We only found this breakage on FreeBSD
since it impeded bootstrapping (by design?).
This patch was constructed and tested per the instructions in
fixinc/README in an already bootstrapped tree on
i386-unknown-freebsd4.2 (that had the system header in question
"fixed" by hand for bootstrapping purposes and then reverted to test
this new fix). I studied the complete change history of
/usr/include/sys/cdefs.h on *-*-freebsd* to ensure this fix doesn't
make matters worse on any older version of that file and plays nice
with David's preferred OS-level fix.
Bruce, if you approve it and it is no bother to you, then please apply
to both 3.0 branch and the mainline.
Regards,
Loren
2001-02-19 Loren J. Rittle <ljrittle@acm.org>
* fixinc/inclhack.def (freebsd_gcc3_breakage): New fix.
Index: fixinc/inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.101
diff -c -r1.101 inclhack.def
*** inclhack.def 2001/02/06 22:17:08 1.101
--- inclhack.def 2001/02/20 05:00:14
***************
*** 1031,1036 ****
--- 1031,1051 ----
/*
+ * Between 8/24/1998 and 2/17/2001, FreeBSD system headers presume
+ * neither the existence of GCC 3 nor its exact feature set yet break
+ * (by design?) when __GNUC__ is set beyond 2.
+ */
+ fix = {
+ hackname = freebsd_gcc3_breakage;
+ mach = *-*-freebsd*;
+ files = sys/cdefs.h;
+ bypass = '__GNUC__ [>=]= 3';
+ sed = 's@^#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7$@& || __GNUC__ == 3@';
+ test_text = '#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7';
+ };
+
+
+ /*
* Fix HP & Sony's use of "../machine/xxx.h"
* to refer to: <machine/xxx.h>
*/
More information about the Gcc-patches
mailing list