toolchain/gcc: fix build errors on macOS with Xcode 15.3
authorGeorgi Valkov <gvalkov@gmail.com>
Sat, 30 Mar 2024 20:10:27 +0000 (22:10 +0200)
committerRobert Marko <robimarko@gmail.com>
Tue, 2 Apr 2024 09:10:32 +0000 (11:10 +0200)
commit631014d9b097b533920d3dbf120218ab735716cc
tree694e854b72fcae3ea6bfad7334fea3e25dabecb1
parent7236d4f82b57680d76a52abc934130cb02cc913c
toolchain/gcc: fix build errors on macOS with Xcode 15.3

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:550:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
    _LIBCPP_INLINE_VISIBILITY
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:891:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
 #  define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
                                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:870:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
          __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))

Fixed using backport of upstream commits [1-2] as discussed here
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111632#c21

[1] Include safe-ctype.h after C++ standard headers, to avoid over-poisoning
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=9970b576b7e4ae337af1268395ff221348c4b34a

[2] libcc1: fix <vector> include
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5213047b1d50af63dfabb5e5649821a6cb157e33

Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
toolchain/gcc/patches-11.x/020-Include-safe-ctype.h-after-C-standard-headers-to-avo.patch [new file with mode: 0644]
toolchain/gcc/patches-12.x/020-Include-safe-ctype.h-after-C-standard-headers-to-avo.patch [new file with mode: 0644]
toolchain/gcc/patches-12.x/021-libcc1-fix-vector-include.patch [new file with mode: 0644]
toolchain/gcc/patches-13.x/020-Include-safe-ctype.h-after-C-standard-headers-to-avo.patch [new file with mode: 0644]
toolchain/gcc/patches-13.x/021-libcc1-fix-vector-include.patch [new file with mode: 0644]