iains / gcc-14-branch

GCC 14 for Darwin with experimental Arm64 support. Current release 14.2-darwin-r2 [October 2024]
GNU General Public License v2.0
11 stars 3 forks source link

__API_AVAILABLE5 issues with 14.2? #9

Closed ilg-ul closed 3 months ago

ilg-ul commented 3 months ago

It seems that an issue similar to https://github.com/iains/gcc-14-branch/issues/7 is happening with gcc-14.2-darwin-r0.

I'm building it with the same build scripts as 14.1, which was fine.

My builds are performed on x64 10.14 (with -mmacosx-version-min=10.13) and on arm64 11.7 (with -mmacosx-version-min=11.0); the builds finish ok, and running the tests in the same environment is fine.

However, running the tests on a more recent system (macOS 14.5 with Xcode 15.4, the GitHub runner), fails with errors like:

/Users/runner/work/gcc-xpack/gcc-xpack/build-assets/build/darwin-arm64/aarch64-apple-darwin23.5.0/tests/xpack-gcc-14.2.0-1/lib/gcc/aarch64-apple-darwin20.6.0/14.2.0/include-fixed/stdio.h:367:153: error: macro "__API_AVAILABLE5" requires 5 arguments, but only 4 given
   367 | FILE *fmemopen(void * __restrict __buf, size_t __size, const char * __restrict __mode) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
      |                                                                                                                                                         ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/Availability.h:177,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:69,
                 from /Users/runner/work/gcc-xpack/gcc-xpack/build-assets/build/darwin-arm64/aarch64-apple-darwin23.5.0/tests/xpack-gcc-14.2.0-1/lib/gcc/aarch64-apple-darwin20.6.0/14.2.0/include-fixed/stdio.h:78:

Same for the x64 build.

I have the full build and test logs on GitHub, I can provide more details, if necessary.

To me It looks the same issue as https://github.com/iains/gcc-14-branch/issues/4, which was fixed for 14.1.

Can a similar fix be applied to 14.2?

iains commented 3 months ago

Hmm the branch builds fine on macOS14 with CLT 15.3 / macOSX14.4.sdk

I pushed an update to the branch, can you check that this solves the issue?

ilg-ul commented 3 months ago

the branch builds fine on macOS14 with CLT 15.3 / macOSX14.4.sdk

The branch builds fine on my both build machines too, which use older systems, just that the resulting toolchain fails to run on more recent systems.

I pushed an update to the branch, can you check that this solves the issue?

I'll try this tomorrow and let you know the result.

ilg-ul commented 3 months ago

This new commit (b50a0534) fixed the issue, now my tests passed on all macOS versions, new and old.

You can tag this as r1.

This seems to be the same problem that we had with 14.1, wouldn't it be possible to make it a permanent solution for future versions? Since I also expect it to occur with 14.[345], etc.

cjones051073 commented 3 months ago

We are also seeing the recurrence of this problem with the MacPorts builds of gcc using the r0 14.2 tag. An updated tag with the fix would be very much appreciated.

iains commented 3 months ago

ack ..

It was actually caused by a rebase mistake (i.e. I always intended to include it in 14.2) - unfortunately since the pre-releases built OK for me and no-one else apparently picked up the issue .. it went unnoticed until now.

I will push an r1 later today - testing is still running on macOS14

ilg-ul commented 3 months ago

since the pre-releases built OK for me

I think you can catch this kind of errors if you do a second build with -mmacosx-version-min=11.0 and run the resulting binaries on your recent machine.

I know that you do not recommend using a version-min that far away, but even for recent Xcode/CLT Apple lists macOS 10.13-15 as Deployment Targets:

iains commented 3 months ago

I could do an almost infinite number of test permutations - but only have limited resources - which are typically running flat out 24h a day .. so I do rely on some of you folks to test the pre-releases in your environments :)

iains commented 3 months ago

pushed the release.