public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6279] Add VxWworks fixincludes hack, don't expect yvals.h from gcc
@ 2022-01-06 12:04 Olivier Hainque
  0 siblings, 0 replies; only message in thread
From: Olivier Hainque @ 2022-01-06 12:04 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:75b8a726171bcb2e06d70e6179e9926a7ffd73cc

commit r12-6279-g75b8a726171bcb2e06d70e6179e9926a7ffd73cc
Author: Olivier Hainque <hainque@adacore.com>
Date:   Thu Dec 16 13:50:25 2021 +0000

    Add VxWworks fixincludes hack, don't expect yvals.h from gcc
    
    yvals.h on VxWorks expects the toolchain to provide its own
    version of the header, which we don't do. Arrange to fallback
    on the common system definitions instead.
    
    2021-12-16  Olivier Hainque  <hainque@adacore.com>
    
    fixincludes/
            * inclhack.def (vxworks_next_yvals): New hack.
            * tests/base/yvals.h: New expected test result.
            * fixincl.x: Regenerate.

Diff:
---
 fixincludes/fixincl.x          | 58 ++++++++++++++++++++++++++++++++++++++----
 fixincludes/inclhack.def       | 22 ++++++++++++++++
 fixincludes/tests/base/yvals.h | 17 +++++++++++++
 3 files changed, 92 insertions(+), 5 deletions(-)

diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index 16b15c045d0..87175fe0205 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -2,11 +2,11 @@
  *
  * DO NOT EDIT THIS FILE   (fixincl.x)
  *
- * It has been AutoGen-ed  January  4, 2022 at 10:24:34 AM by AutoGen 5.18.16
+ * It has been AutoGen-ed  January  6, 2022 at 11:59:22 AM by AutoGen 5.18.16
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT SVN-MERGE THIS FILE, EITHER Tue Jan  4 10:24:34 UTC 2022
+/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Jan  6 11:59:22 UTC 2022
  *
  * 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 262 fixup descriptions.
+ * This file contains 263 fixup descriptions.
  *
  * See README for more information.
  *
@@ -10325,6 +10325,48 @@ static const char* apzVxworks_Needs_VxworksPatch[] = { sed_cmd_z,
 #include <types/vxTypesOld.h>\n",
     (char*)NULL };
 
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Vxworks_Next_Yvals fix
+ */
+tSCC zVxworks_Next_YvalsName[] =
+     "vxworks_next_yvals";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zVxworks_Next_YvalsList[] =
+  "yvals.h\0";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzVxworks_Next_YvalsMachs[] = {
+        "*-*-vxworks*",
+        (const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zVxworks_Next_YvalsSelect0[] =
+       "#include_next <yvals.h>";
+
+#define    VXWORKS_NEXT_YVALS_TEST_CT  1
+static tTestDesc aVxworks_Next_YvalsTests[] = {
+  { TT_EGREP,    zVxworks_Next_YvalsSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Vxworks_Next_Yvals
+ */
+static const char* apzVxworks_Next_YvalsPatch[] = {
+    "format",
+    "#if 0 /* GCC does not provide yvals.h.  */\n\
+%1",
+    "#if .*\n\
+/\\* .*\n\
+(#include_next <yvals.h>\n\
+)",
+    (char*)NULL };
+
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
  *  Description of Vxworks_Regs fix
@@ -10648,9 +10690,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          300
+#define REGEX_COUNT          301
 #define MACH_LIST_SIZE_LIMIT 187
-#define FIX_COUNT            262
+#define FIX_COUNT            263
 
 /*
  *  Enumerate the fixes
@@ -10910,6 +10952,7 @@ typedef enum {
     VXWORKS_POSIX_MKDIR_FIXIDX,
     VXWORKS_NEEDS_VXTYPES_FIXIDX,
     VXWORKS_NEEDS_VXWORKS_FIXIDX,
+    VXWORKS_NEXT_YVALS_FIXIDX,
     VXWORKS_REGS_FIXIDX,
     VXWORKS_TIME_FIXIDX,
     VXWORKS_WRITE_CONST_FIXIDX,
@@ -12191,6 +12234,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      VXWORKS_NEEDS_VXWORKS_TEST_CT, FD_MACH_ONLY,
      aVxworks_Needs_VxworksTests,   apzVxworks_Needs_VxworksPatch, 0 },
 
+  {  zVxworks_Next_YvalsName,    zVxworks_Next_YvalsList,
+     apzVxworks_Next_YvalsMachs,
+     VXWORKS_NEXT_YVALS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aVxworks_Next_YvalsTests,   apzVxworks_Next_YvalsPatch, 0 },
+
   {  zVxworks_RegsName,    zVxworks_RegsList,
      apzVxworks_RegsMachs,
      VXWORKS_REGS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 8f056adef68..4643678026d 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -5210,6 +5210,28 @@ fix = {
     "# define\t__INCstath <sys/stat.h>";
 };
 
+/*
+ * yvals.h on VxWorks-6 expects the toolchain to provide its own
+ * version of the header, which we don't do.  Arrange to fallback
+ * on the system definition.
+ */
+fix = {
+    hackname  = vxworks_next_yvals;
+    mach      = "*-*-vxworks*";
+    files     = yvals.h;
+    select    = "#include_next <yvals.h>";
+    c_fix     = format;
+    c_fix_arg = "#if 0 /* GCC does not provide yvals.h.  */\n%1";
+    c_fix_arg = "#if .*\n"
+                "/\\* .*\n"
+                "(#include_next <yvals.h>\n)";
+
+    test_text = "#if (defined(__cplusplus) && defined(__GNUC__))\n"
+                "/* GCC C++ has it's own yvals.h */\n"
+                "#include_next <yvals.h>\n"
+                "#else\n";
+};
+
 /*
  *  Make it so VxWorks does not include gcc/regs.h accidentally
  */
diff --git a/fixincludes/tests/base/yvals.h b/fixincludes/tests/base/yvals.h
new file mode 100644
index 00000000000..ea384d9cf9e
--- /dev/null
+++ b/fixincludes/tests/base/yvals.h
@@ -0,0 +1,17 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+	"fixinc/tests/inc/yvals.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+
+
+#if defined( VXWORKS_NEXT_YVALS_CHECK )
+#if 0 /* GCC does not provide yvals.h.  */
+#include_next <yvals.h>
+#else
+
+#endif  /* VXWORKS_NEXT_YVALS_CHECK */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-06 12:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-06 12:04 [gcc r12-6279] Add VxWworks fixincludes hack, don't expect yvals.h from gcc Olivier Hainque

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).