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

Jack Howarth <howarth.at.gcc at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |---

--- Comment #3 from Jack Howarth <howarth.at.gcc at gmail dot com> ---
(In reply to Andrew Pinski from comment #2)
> GCC by default looks to /usr/local unless you use with-local-prefix option.

Actually on darwin this isn't that simple. If you use --with-local-prefix= set
to anything other than /usr/lcoal, a potential header/library mismatch
situation is made possible because the compiler no longer searches
/usr/local/include for headers bu the linker command does still search
/usr/local/lib. Fortunately, this glitch is trivial to solve without resorting
to the --with-local-prefix hack. The simple change...

--- gcc/incpath.c.bak   2015-01-05 07:33:28.000000000 -0500
+++ gcc/incpath.c       2016-11-06 07:25:20.000000000 -0500
@@ -256,7 +256,7 @@
       if (stat (cur->name, &st))
        {
          /* Dirs that don't exist are silently ignored, unless verbose.  */
-         if (errno != ENOENT)
+         if ((errno != ENOENT) && (errno != EPERM))
            cpp_errno (pfile, CPP_DL_ERROR, cur->name);
          else
            {

eliminates the compiler bootstrap failures and later compiler operation
failures when run under an Apple sandbox with file access to /usr/local denied.

Reply via email to