You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macOS clang base missing __GCC_DESTRUCTIVE_SIZE and __GCC_CONSTRUCTIVE_SIZE #319
Clang 19 and later predefine __GCC_DESTRUCTIVE_SIZE and __GCC_CONSTRUCTIVE_SIZE. libc++ uses them unconditionally from C++17 on, in <__new/interference_size.h>, to define std::hardware_destructive_interference_size and std::hardware_constructive_interference_size.
The native macOS bases for clang mode
(bases/cmake-native/macos-arm/clang/lib/predefined_macros.txt, the x86_64
one, and their byte-identical copies in the target-configuration directories lib_macos_arm64/ and lib_macos_x86_64/) do not define them. The Linux docker bases do (for example bases/docker/dev-env/clang/lib_linux_riscv64/predefined_macros.txt).
The macOS file appears to be a snapshot of Apple clang 15: it sets __apple_build_version__ 15000309. That stays so even when the front end
emulates a newer clang with --clang_version, as HACKING.md says to do
with the scraped version. The current Command Line Tools ship Apple clang 21
and its libc++, so every C++17 or later translation unit that reaches <new>
fails.
Reproducer
#ifndef __GCC_DESTRUCTIVE_SIZE
#error "__GCC_DESTRUCTIVE_SIZE is not defined"
#endif
#ifndef __GCC_CONSTRUCTIVE_SIZE
#error "__GCC_CONSTRUCTIVE_SIZE is not defined"
#endifint x = __GCC_DESTRUCTIVE_SIZE + __GCC_CONSTRUCTIVE_SIZE;
Activity
Define __GCC_CONSTRUCTIVE/DESTRUCTIVE_SIZE on macOS [GH edgcpp#319]