]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Darwin, backport fixes for PR 89864 (with 90379 included)
authorIain Sandoe <iain@sandoe.co.uk>
Mon, 3 Jun 2019 19:13:46 +0000 (19:13 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Mon, 3 Jun 2019 19:13:46 +0000 (19:13 +0000)
2019-06-03  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline.
2019-05-11  Iain Sandoe  <iain@sandoe.co.uk>

PR bootstrap/89864
* inclhack.def (darwin_ucred__Atomic): Do not supply test_text
for wrap fixes.
* fixincl.x: Regenerated.

Backport from mainline.
2019-04-18  Erik Schnetter  <schnetter@gmail.com>
    Jakub Jelinek  <jakub@redhat.com>
    Iain Sandoe  <iain@sandoe.co.uk>

PR bootstrap/89864
* inclhack.def (darwin_ucred__Atomic): New, work around _Atomic keyword
use in headers included by C++.
* fixincl.x: Regenerated.

From-SVN: r271881

fixincludes/ChangeLog
fixincludes/fixincl.x
fixincludes/inclhack.def

index 1157c939e6cdc10c1da1561354a3d73dbb406c4f..af533dcf025d104802b943a073d6366c584c10ac 100644 (file)
@@ -1,3 +1,23 @@
+2019-06-03  Iain Sandoe  <iain@sandoe.co.uk>
+
+       Backport from mainline.
+       2019-05-11  Iain Sandoe  <iain@sandoe.co.uk>
+
+       PR bootstrap/89864
+       * inclhack.def (darwin_ucred__Atomic): Do not supply test_text
+       for wrap fixes.
+       * fixincl.x: Regenerated.
+
+       Backport from mainline.
+       2019-04-18  Erik Schnetter  <schnetter@gmail.com>
+                   Jakub Jelinek  <jakub@redhat.com>
+                   Iain Sandoe  <iain@sandoe.co.uk>
+
+       PR bootstrap/89864
+       * inclhack.def (darwin_ucred__Atomic): New, work around _Atomic keyword
+       use in headers included by C++.
+       * fixincl.x: Regenerated.
+
 2018-12-06  Release Manager
 
        * GCC 7.4.0 released.
index c5be74f2832025b25940f2b713ab2e017ca01056..c9173519c081579ce1e3482b55ff50b9ed2db490 100644 (file)
@@ -1,12 +1,12 @@
 /*  -*- buffer-read-only: t -*- vi: set ro:
- * 
+ *
  * DO NOT EDIT THIS FILE   (fixincl.x)
- * 
- * It has been AutoGen-ed  Saturday February 25, 2017 at 03:25:44 PM EST
+ *
+ * It has been AutoGen-ed  May 30, 2019 at 04:05:59 PM by AutoGen 5.17.4
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT SVN-MERGE THIS FILE, EITHER Sat 25 Feb 2017 15:25:44 EST
+/* DO NOT SVN-MERGE THIS FILE, EITHER Thu May 30 16:05:59 BST 2019
  *
  * 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 248 fixup descriptions.
+ * This file contains 249 fixup descriptions.
  *
  * See README for more information.
  *
@@ -3260,6 +3260,48 @@ static const char* apzDarwin_Stdint_7Patch[] = {
 #endif",
     (char*)NULL };
 
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Darwin_Ucred__Atomic fix
+ */
+tSCC zDarwin_Ucred__AtomicName[] =
+     "darwin_ucred__Atomic";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zDarwin_Ucred__AtomicList[] =
+  "sys/ucred.h\0";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzDarwin_Ucred__AtomicMachs[] = {
+        "*-*-darwin*",
+        (const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zDarwin_Ucred__AtomicSelect0[] =
+       "_Atomic";
+
+#define    DARWIN_UCRED__ATOMIC_TEST_CT  1
+static tTestDesc aDarwin_Ucred__AtomicTests[] = {
+  { TT_EGREP,    zDarwin_Ucred__AtomicSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Darwin_Ucred__Atomic
+ */
+static const char* apzDarwin_Ucred__AtomicPatch[] = {
+    "wrap",
+    "#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n\
+# define _Atomic volatile\n\
+#endif\n",
+    "#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n\
+# undef _Atomic\n\
+#endif\n",
+    (char*)NULL };
+
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
  *  Description of Dec_Intern_Asm fix
@@ -10139,9 +10181,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          285
+#define REGEX_COUNT          286
 #define MACH_LIST_SIZE_LIMIT 187
-#define FIX_COUNT            248
+#define FIX_COUNT            249
 
 /*
  *  Enumerate the fixes
@@ -10222,6 +10264,7 @@ typedef enum {
     DARWIN_STDINT_5_FIXIDX,
     DARWIN_STDINT_6_FIXIDX,
     DARWIN_STDINT_7_FIXIDX,
+    DARWIN_UCRED__ATOMIC_FIXIDX,
     DEC_INTERN_ASM_FIXIDX,
     DJGPP_WCHAR_H_FIXIDX,
     ECD_CURSOR_FIXIDX,
@@ -10773,6 +10816,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      DARWIN_STDINT_7_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aDarwin_Stdint_7Tests,   apzDarwin_Stdint_7Patch, 0 },
 
+  {  zDarwin_Ucred__AtomicName,    zDarwin_Ucred__AtomicList,
+     apzDarwin_Ucred__AtomicMachs,
+     DARWIN_UCRED__ATOMIC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aDarwin_Ucred__AtomicTests,   apzDarwin_Ucred__AtomicPatch, 0 },
+
   {  zDec_Intern_AsmName,    zDec_Intern_AsmList,
      apzDec_Intern_AsmMachs,
      DEC_INTERN_ASM_TEST_CT, FD_MACH_ONLY,
index 8a5514ffcabf4f4b1dc01929a2002632a8f7e3f8..4c3c23883516b324d40fabdddac49c48f0dbf708 100644 (file)
@@ -1688,6 +1688,25 @@ fix = {
                "#define UINTMAX_C(v) (v ## ULL)";
 };
 
+/*  The SDK included with XCode 10.2 has the file <sys/ucred.h> that uses the
+    C11 _Atomic keyword (exposing it to C++ code).  The work-around here follows
+    the header in declaring the entity volatile when _Atomic is not available.
+*/
+fix = {
+    hackname  = darwin_ucred__Atomic;
+    mach      = "*-*-darwin*";
+    files     = sys/ucred.h;
+    select    = "_Atomic";
+    c_fix     = wrap;
+    c_fix_arg = "#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n"
+               "# define _Atomic volatile\n"
+               "#endif\n";
+    c_fix_arg = "#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n"
+               "# undef _Atomic\n"
+               "#endif\n";
+    test_text = ""; /* Don't provide this for wrap fixes.  */
+};
+
 /*
  *  Fix <c_asm.h> on Digital UNIX V4.0:
  *  It contains a prototype for a DEC C internal asm() function,