fixinc/inclhack.def (svr4_krnl): Rename from svr4_kernel.
authorNathanael Nerode <neroden@gcc.gnu.org>
Tue, 12 Aug 2003 07:11:38 +0000 (07:11 +0000)
committerNathanael Nerode <neroden@gcc.gnu.org>
Tue, 12 Aug 2003 07:11:38 +0000 (07:11 +0000)
fixinc/inclhack.def (svr4_krnl): Rename from svr4_kernel.  Enable
for selected machines.  Comment heavily.
fixinc/fixincl.x: Rebuild.
fixinc/tests/base/fs/rfs/rf_cache.h: New file.

From-SVN: r70362

gcc/ChangeLog
gcc/fixinc/fixincl.x
gcc/fixinc/inclhack.def
gcc/fixinc/tests/base/fs/rfs/rf_cache.h [new file with mode: 0644]

index a9c4046cbfd01a2156500f897d9c4e360cbc5a2b..9fcf7448361d962b89c93676fa3d9b12e6ca0de1 100644 (file)
@@ -1,3 +1,10 @@
+2003-08-12  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+       fixinc/inclhack.def (svr4_krnl): Rename from svr4_kernel.  Enable
+       for selected machines.  Comment heavily.
+       fixinc/fixincl.x: Rebuild.
+       fixinc/tests/base/fs/rfs/rf_cache.h: New file.
+
 2003-08-12  Richard Sandiford  <rsandifo@redhat.com>
 
        * config/mips/mips.h: Tweak various comments.
index 46741b90ccc7cae94d1cd3c07db862d75e14791b..95c5dd7751069ed53c031a34a1ace360a867bb1b 100644 (file)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Monday August  4, 2003 at 03:26:31 PM EDT
+ * It has been AutoGen-ed  Tuesday August 12, 2003 at 03:04:53 AM EDT
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT CVS-MERGE THIS FILE, EITHER Mon Aug  4 15:26:31 EDT 2003
+/* DO NOT CVS-MERGE THIS FILE, EITHER Tue Aug 12 03:04:53 EDT 2003
  *
  * You must regenerate it.  Use the ./genfixes script.
  *
@@ -15,7 +15,7 @@
  * certain ANSI-incompatible system header files which are fixed to work
  * correctly with ANSI C and placed in a directory that GNU C will search.
  *
- * This file contains 156 fixup descriptions.
+ * This file contains 157 fixup descriptions.
  *
  * See README for more information.
  *
@@ -4902,6 +4902,46 @@ static const char* apzSvr4_GetcwdPatch[] = {
     "getcwd(char *, size_t)",
     (char*)NULL };
 
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Svr4_Krnl fix
+ */
+tSCC zSvr4_KrnlName[] =
+     "svr4_krnl";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zSvr4_KrnlList[] =
+  "|fs/rfs/rf_cache.h|sys/erec.h|sys/err.h|sys/char.h|sys/getpages.h|sys/map.h|sys/cmn_err.h|sys/kdebugger.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzSvr4_KrnlMachs[] = {
+        "*-*-sysv4*",
+        "i?86-sequent-ptx*",
+        "i?86-sequent-sysv3*",
+        (const char*)NULL };
+
+/*
+ *  content bypass pattern - skip fix if pattern found
+ */
+tSCC zSvr4_KrnlBypass0[] =
+       "_KERNEL";
+
+#define    SVR4_KRNL_TEST_CT  1
+static tTestDesc aSvr4_KrnlTests[] = {
+  { TT_NEGREP,   zSvr4_KrnlBypass0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Svr4_Krnl
+ */
+static const char* apzSvr4_KrnlPatch[] = {
+    "wrap",
+    "#ifdef _KERNEL\n",
+    "#endif /* _KERNEL */\n",
+    (char*)NULL };
+
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
  *  Description of Svr4_Profil fix
@@ -6193,9 +6233,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          176
+#define REGEX_COUNT          177
 #define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT            156
+#define FIX_COUNT            157
 
 /*
  *  Enumerate the fixes
@@ -6323,6 +6363,7 @@ typedef enum {
     SVR4__P_FIXIDX,
     SVR4_DISABLE_OPT_FIXIDX,
     SVR4_GETCWD_FIXIDX,
+    SVR4_KRNL_FIXIDX,
     SVR4_PROFIL_FIXIDX,
     SVR4_UNDECLARED_GETRNGE_FIXIDX,
     SYSV68_STRING_FIXIDX,
@@ -6970,6 +7011,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      SVR4_GETCWD_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aSvr4_GetcwdTests,   apzSvr4_GetcwdPatch, 0 },
 
+  {  zSvr4_KrnlName,    zSvr4_KrnlList,
+     apzSvr4_KrnlMachs,
+     SVR4_KRNL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aSvr4_KrnlTests,   apzSvr4_KrnlPatch, 0 },
+
   {  zSvr4_ProfilName,    zSvr4_ProfilList,
      apzSvr4_ProfilMachs,
      SVR4_PROFIL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
index c342f92a3eb1d682acf514553e67434237cf8e5a..374b860a9ed124e706136352445c914133c34bd1 100644 (file)
@@ -2788,11 +2788,22 @@ fix = {
 
 
 /*
- *  set ifdef _KERNEL
- */
-#ifdef SVR4
-fix = {
-    hackname = svr4_kernel;
+ *  Wrap some files on System V r4 and DYNIX/ptx systems with
+ *  #ifdef _KERNEL, presumably to prevent kernel headers from
+ *  leaking into userspace.  This may not be necessary at all,
+ *  but it was in the old scripts, so it seems safest to keep it for now.
+ */
+fix = {
+    /* Can't name this with _kernel, or the test case will hit the bypass! */
+    hackname = svr4_krnl;
+    /* Since I'm rather unsure about the validity of this, limit it
+     * to the specific systems it was operating on before.  It should
+     * also be bypassed for i?86-*-sysv4.3uw2, by that rule, but I didn't
+     * see an easy way to do that.  Hopefully it will be harmless
+     * in any case. -- Nathanael */
+    mach     = '*-*-sysv4*';
+    mach     = 'i?86-sequent-ptx*';
+    mach     = 'i?86-sequent-sysv3*';
     files    = fs/rfs/rf_cache.h;
     files    = sys/erec.h;
     files    = sys/err.h;
@@ -2801,14 +2812,21 @@ fix = {
     files    = sys/map.h;
     files    = sys/cmn_err.h;
     files    = sys/kdebugger.h;
+
+    /* This bypass will match _KERNEL, __KERNEL, __KERNEL__, etc.
+     * It will also match SVR4_KERNEL_CHECK, which means that the
+     * testsuite case will always be bypassed.  Which is fine with me. */
     bypass   = '_KERNEL';
-    c_fix     = wrap;
 
+    c_fix     = wrap;
     c_fix_arg = "#ifdef _KERNEL\n";
     c_fix_arg = "#endif /* _KERNEL */\n";
+
+    /* There's no reasonable test for this given that we don't know exactly
+     * what problem inspired it in the first place. */
     test_text = "";
 };
-#endif
+
 
 /*
  *  Delete any #defines of `__i386' which may be present in <ieeefp.h>.  They
diff --git a/gcc/fixinc/tests/base/fs/rfs/rf_cache.h b/gcc/fixinc/tests/base/fs/rfs/rf_cache.h
new file mode 100644 (file)
index 0000000..45fec63
--- /dev/null
@@ -0,0 +1,21 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+       "fixinc/tests/inc/fs/rfs/rf_cache.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+#ifndef FIXINC_WRAP_FS_RFS_RF_CACHE_H_SVR4_KRNL
+#define FIXINC_WRAP_FS_RFS_RF_CACHE_H_SVR4_KRNL 1
+
+#ifdef _KERNEL
+
+
+#if defined( SVR4_KRNL_CHECK )
+
+#endif  /* SVR4_KRNL_CHECK */
+#endif /* _KERNEL */
+
+#endif  /* FIXINC_WRAP_FS_RFS_RF_CACHE_H_SVR4_KRNL */