[Bug target/119590] macOS 15.4 SDK is not GCC compatible
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119590 --- Comment #9 from Francois-Xavier Coudert --- The very good news is that Apple has fixed the issue in the 15.5 SDK and later (including the 16.0 SDK). So, this issue was only ever present for the macOS 15.4 SDK.
[Bug target/119590] macOS 15.4 SDK is not GCC compatible
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119590 --- Comment #8 from Iain Sandoe --- (In reply to Alisdair Meredith from comment #7) > For a short term workaround adding `-D_Alignof=alignof` to your command > lines should work -- at least according to my quick testing. > > If gcc were to add `_Alignof` support in C++, For the macOS development branches (on my GH) I have added an option to support this clang extension (which defaults to 'on' for macOS targets) - whether there will be any appetite for accepting it 'upstream' remains to be seen. >we might still need that -D > hack in order to build the initial compiler --- but that assumes we do not > wait for Apple to update their SDK, if they believe that this is an issue > they are concerned about. If the initial/host bootstrap compiler is GCC, (necessary to support Ada or D) then yes; if that compiler is clang, then the extension should already be accepted.
[Bug target/119590] macOS 15.4 SDK is not GCC compatible
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119590 Alisdair Meredith changed: What|Removed |Added CC||alisdairm at me dot com --- Comment #7 from Alisdair Meredith --- For a short term workaround adding `-D_Alignof=alignof` to your command lines should work -- at least according to my quick testing. If gcc were to add `_Alignof` support in C++, we might still need that -D hack in order to build the initial compiler --- but that assumes we do not wait for Apple to update their SDK, if they believe that this is an issue they are concerned about.
[Bug target/119590] macOS 15.4 SDK is not GCC compatible
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119590 --- Comment #6 from Francois-Xavier Coudert --- Reported to Apple as FB17100494.
[Bug target/119590] macOS 15.4 SDK is not GCC compatible
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119590 Iain Sandoe changed: What|Removed |Added Status|NEW |SUSPENDED --- Comment #5 from Iain Sandoe --- Current trunk (2025-04-02) builds on x86_64 macOS 15.4 using Xcode CLT 16.3. So the extension is not needed there. Moving this to the development branch issues an suspending here (pending upstreaming of the the debit work). devt issue #142 "SDK 15.4 uses C-specific functionality in C++ compiles. "
[Bug target/119590] macOS 15.4 SDK is not GCC compatible
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119590 --- Comment #4 from Iain Sandoe --- (In reply to Jakub Jelinek from comment #3) > So something fixincludes should fix? looks like another case where having a single FE for c-family makes it easy to mistakenly accept C in C++ and vice versa At the moment, I am very reluctant to add more fixincludes, since the SDKs are changing fast, which gives us other problems in maintaining stability - I'll take a look at what we might do as another "clang compatibility" extension for Darwin - if that proves too hard than we might have to fall back to fixincludes. Unless it repeats somehow with x86_64 (which I will check later)... then this probably belongs as an issue against the aarch64-darwin devt branch.
[Bug target/119590] macOS 15.4 SDK is not GCC compatible
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119590 Francois-Xavier Coudert changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed||2025-04-02 Status|UNCONFIRMED |NEW --- Comment #1 from Francois-Xavier Coudert --- I can also reproduce this, using a compiler built against an earlier SDK, but compiling against macOS 15.4 SDK: $ cat a.c #include $ g++-14 a.c In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/machine/_structs.h:35, from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/arm/_mcontext.h:36, from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/machine/_mcontext.h:34, from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/sys/signal.h:146, from a.c:1: /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:627:35: error: expected primary-expression before 'unsigned' 627 | } __attribute__((aligned(_Alignof(unsigned int; | ^~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:627:26: error: '_Alignof' was not declared in this scope 627 | } __attribute__((aligned(_Alignof(unsigned int; | ^~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:633:35: error: expected primary-expression before 'unsigned' 633 | } __attribute__((aligned(_Alignof(unsigned int; | ^~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:633:26: error: '_Alignof' was not declared in this scope 633 | } __attribute__((aligned(_Alignof(unsigned int; | ^~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:639:35: error: expected primary-expression before 'unsigned' 639 | } __attribute__((aligned(_Alignof(unsigned int; | ^~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:639:26: error: '_Alignof' was not declared in this scope 639 | } __attribute__((aligned(_Alignof(unsigned int; | ^~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:645:35: error: expected primary-expression before 'unsigned' 645 | } __attribute__((aligned(_Alignof(unsigned int; | ^~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:645:26: error: '_Alignof' was not declared in this scope 645 | } __attribute__((aligned(_Alignof(unsigned int; | ^~~~
[Bug target/119590] macOS 15.4 SDK is not GCC compatible
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119590 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek --- So something fixincludes should fix?
[Bug target/119590] macOS 15.4 SDK is not GCC compatible
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119590 --- Comment #2 from Andrew Pinski --- For c++ alignof should be used. But for c _Alignof needs to be used.