[Bug bootstrap/89864] [9 regression] gcc fails to build/bootstrap with XCode 10.2

schnetter at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Apr 4 15:01:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89864

--- Comment #31 from Erik Schnetter <schnetter at gmail dot com> ---
Here is an updated version of the patch that fixincludes both
<sys/sysctl.h> and <sys/ucred.h>, and does not need to touch any sources
files in GCC any more:

Index: fixincludes/inclhack.def
===================================================================
--- fixincludes/inclhack.def (revision 270127)
+++ fixincludes/inclhack.def (working copy)
@@ -1298,6 +1298,69 @@ fix = {
 };

 /*
+ *  macOS 10.14.4 <sys/ucred.h> uses the C _Atomic keyword in C++
+ *  code, and this file is included by <sys/sysctl.h>.
+ */
+fix = {
+    hackname  = darwin_sysctl3__Atomic;
+    mach      = "*-*-darwin18.5.*";
+    files     = sys/sysctl.h;
+    select    = "#include <sys/ucred.h>";
+
+    c_fix     = wrap;
+
+    c_fix_arg = <<- _EOArg_
+
+ #if defined(__cplusplus) && __cplusplus >= 201103L
+        #  define _Atomic volatile
+ #endif
+
+ _EOArg_;
+
+    c_fix_arg = <<- _EOArg_
+
+ #if defined(__cplusplus) && __cplusplus >= 201103L
+ #  undef _Atomic
+ #endif
+
+ _EOArg_;
+
+    test_text = "#include <sys/sysctl.h>\n";
+};
+
+
+/*
+ *  macOS 10.14.4 <sys/ucred.h> uses the C _Atomic keyword in C++
+ *  code.
+ */
+fix = {
+    hackname  = darwin_ucred__Atomic;
+    mach      = "*-*-darwin18.5.*";
+    files     = sys/ucred.h;
+    select    = "_Atomic";
+
+    c_fix     = wrap;
+
+    c_fix_arg = <<- _EOArg_
+
+ #if defined(__cplusplus) && __cplusplus >= 201103L
+        #  define _Atomic volatile
+ #endif
+
+ _EOArg_;
+
+    c_fix_arg = <<- _EOArg_
+
+ #if defined(__cplusplus) && __cplusplus >= 201103L
+ #  undef _Atomic
+ #endif
+
+ _EOArg_;
+
+    test_text = "#include <sys/ucred.h>\n";
+};
+
+/*
  *  For the AAB_darwin7_9_long_double_funcs fix to be useful,
  *  you have to not use "" includes.
  */


--
Erik Schnetter <schnetter@gmail.com>
http://www.perimeterinstitute.ca/personal/eschnetter/


More information about the Gcc-bugs mailing list