This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug bootstrap/30678] sysmacros.h get currupt from Fixincludes with updated glibc.



------- Comment #7 from bkorb at gnu dot org  2007-02-03 20:37 -------
Subject: Re:  sysmacros.h get currupt from Fixincludes
 with updated glibc.

ron3763 at msn dot com wrote:
> ------- Comment #6 from ron3763 at msn dot com  2007-02-03 19:33 -------
> Well I guess is the intended purpose is to patch a much needed system file,
> even if glibc, hasn't been patched (aka updated), will in my case, I applied
> the patch set to jk or jh at glibc group.
> 
> I can upload the patch here if you like.  If you need sysmacros.h pre-patch,
> post-install (glibc) and munged file you may email me direct.
> 
> So my take is, you see fixed sysmacros.h file, bail-out??  is that possible? 
> Or do you need to create a test case to bail via 'else' clause.

If the current sysmacros.h header can be compiled by the current GCC
without any tweaking (fixinclude twiddling), then by far the simplest
method is to simply use ``__STDC_VERSION__'' somewhere in that header.
By using that string, you imply that the header is guarded against
semantic variations based on the version of STDC.  fixincludes is already
rigged to *not* apply the fix if this string is found in the header.

(BTW, simply adding:
    /* __STDC_VERSION__ < 19901L aware */
would be sufficient.)

If it looks too ugly to add a "fixincludes-skip-me" marker, then
you need to say exactly how a fixed header can be identified.
Perhaps just finding no existence of " extern " is sufficient,
in which case the attached patch is all that is needed.

Thanks - Bruce
Index: tests/base/sys/sysmacros.h
===================================================================
--- tests/base/sys/sysmacros.h  (revision 120553)
+++ tests/base/sys/sysmacros.h  (working copy)
@@ -10,9 +10,10 @@


 #if defined( GLIBC_C99_INLINE_4_CHECK )
-__extension__ 
+__extension__
 #if __STDC_VERSION__ < 19901L
 extern
 #endif
- __inline unsigned int
+__inline unsigned int
+__extension__ __extern_inline unsigned int
 #endif  /* GLIBC_C99_INLINE_4_CHECK */
Index: inclhack.def
===================================================================
--- inclhack.def        (revision 120553)
+++ inclhack.def        (working copy)
@@ -1359,12 +1369,13 @@
     hackname  = glibc_c99_inline_4;
     files     = sys/sysmacros.h, '*/sys/sysmacros.h';
     bypass    = "__STDC_VERSION__";
+    select    = ' extern ';
     c_fix     = format;
     c_fix_arg = "\n#if __STDC_VERSION__ < 19901L\nextern\n#endif\n";
-    c_fix_arg = "extern";
     test_text = <<-EOT
-__extension__ extern __inline unsigned int
-EOT;
+       __extension__ extern __inline unsigned int
+       __extension__ __extern_inline unsigned int
+       EOT;
 };


Index: fixincl.x
===================================================================
--- fixincl.x   (revision 120553)
+++ fixincl.x   (working copy)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Saturday January  6, 2007 at 10:08:19 AM PST
+ * It has been AutoGen-ed  Saturday February  3, 2007 at 11:59:48 AM PST
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Jan  6 10:08:19 PST 2007
+/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Feb  3 11:59:48 PST 2007
  *
  * You must regenerate it.  Use the ./genfixes script.
  *
@@ -2318,14 +2318,21 @@
 #define apzGlibc_C99_Inline_4Machs (const char**)NULL

 /*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zGlibc_C99_Inline_4Select0[] =
+       " extern ";
+
+/*
  *  content bypass pattern - skip fix if pattern found
  */
 tSCC zGlibc_C99_Inline_4Bypass0[] =
        "__STDC_VERSION__";

-#define    GLIBC_C99_INLINE_4_TEST_CT  1
+#define    GLIBC_C99_INLINE_4_TEST_CT  2
 static tTestDesc aGlibc_C99_Inline_4Tests[] = {
-  { TT_NEGREP,   zGlibc_C99_Inline_4Bypass0, (regex_t*)NULL }, };
+  { TT_NEGREP,   zGlibc_C99_Inline_4Bypass0, (regex_t*)NULL },
+  { TT_EGREP,    zGlibc_C99_Inline_4Select0, (regex_t*)NULL }, };

 /*
  *  Fix Command Arguments for Glibc_C99_Inline_4
@@ -2336,7 +2343,6 @@
 #if __STDC_VERSION__ < 19901L\n\
 extern\n\
 #endif\n",
-    "extern",
     (char*)NULL };

 /* * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -8420,7 +8426,7 @@
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          250
+#define REGEX_COUNT          251
 #define MACH_LIST_SIZE_LIMIT 261
 #define FIX_COUNT            207



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30678


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]