[Bug target/83531] New: Build broken on macOS 10.13.2

fxcoudert at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 21 14:04:00 GMT 2017


            Bug ID: 83531
           Summary: Build broken on macOS 10.13.2
           Product: gcc
           Version: 5.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fxcoudert at gcc dot gnu.org
  Target Milestone: ---

Build of GCC 5 is currently broken on x86_64-apple-darwin17.3.0 (macOS 10.13.2)
because of a failure in building libsanitizer:

In file included from ../../../../libsanitizer/asan/asan_malloc_mac.cc:17:0:
error: expected initializer before 'API_AVAILABLE'
 CFTypeRef CFAutorelease(CFTypeRef CF_RELEASES_ARGUMENT arg)
API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));

The failure comes from the header file CoreFoundation/CFBase.h, which uses the
API_AVAILABLE macro, which should be defined in /usr/include/os/availability.h
but isn't: in that system header, the path followed by any non-clang compiler
(such as GCC) ends up defining
where it should define the corresponding API_AVAILABLE/etc macros (without
leading underscores).

I reported this bug to Apple (radar #36176941). Hopefully, they will fix their
system headers. In the mean time, we can get bootstrap working again by
fixinclud'ing the header in question. Patch to do so is available at

More information about the Gcc-bugs mailing list