simonjwright / distributing-gcc

Binary releases of GCC (native and cross) on macOS; also, the scripts/Makefiles used for producing them.
BSD 3-Clause "New" or "Revised" License
40 stars 0 forks source link

C Compilation failures #22

Open simonjwright opened 3 months ago

simonjwright commented 3 months ago

With the GCC 14.1.0 (aarch64) release, a user got

% gcc -c tprintf.c
In file included from tprintf.c:2:
/Applications/[Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h:198:67](http://xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h:198:67): error: macro "__API_AVAILABLE2" passed 4 arguments, but takes just 3
  198 | __API_AVAILABLE(macosx(10.15), ios(13.0), tvos(13.0), watchos(6.0))
      |                                                                   ^
In file included from /Applications/[Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h:173](http://xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h:173),
                 from /Applications/[Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h:68](http://xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h:68):
/opt/gcc-14.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/14.1.0/include-fixed/AvailabilityInternal.h:256:13: note: macro "__API_AVAILABLE2" defined here
  256 |     #define __API_AVAILABLE2(arg0,arg1,arg2) __API_A(arg0) __API_A(arg1) __API_A(arg2)
      |             ^~~~~~~~~~~~~~~~
/Applications/[Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h:199:1](http://xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h:199:1): error: expected ';' before 'int'
  199 | int timespec_get(struct timespec *ts, int base);
      | ^~~

The user had Xcode 15.2. It turns out that

The aarch64-modified sources have been fixed here, and a compiler built from that code base doesn’t have this issue.

RajaSrinivasan commented 3 months ago

Wow. How is that for a response. Much appreciated.