summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2025-10-28 09:55:40 +0000
committerEli Schwartz <eschwartz93@gmail.com>2025-10-31 01:24:46 -0400
commit5403a9dea78eee5e42267aaeeb1609ec5c9db18a (patch)
tree2ca897ef04d3a88624a117355b47bc33894067a5
parent92b60413e23109fe9c32a8b82ddd1df0d198ac05 (diff)
downloadmeson-5403a9dea78eee5e42267aaeeb1609ec5c9db18a.tar.gz
compilers: cpp: stop trying to handle old libc++ for assertions
This has two problems: 1) it keeps breaking with Apple Clang (bug #14440, bug #14856) 2) it gets confused when using GCC with libc++ (a rare configuration) because compiler version != libc++ version There's no reason to keep catering for old libc++ here. The feature was somewhat immature in older libc++ anyway. Just rip it out and then we can go back and restore it for the niche case later. Bug: https://github.com/mesonbuild/meson/issues/14440 Bug: https://github.com/mesonbuild/meson/issues/14856 Closes: https://github.com/mesonbuild/meson/issues/13978
-rw-r--r--mesonbuild/compilers/cpp.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index d550e2091..57da4dfae 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -312,9 +312,6 @@ class ClangCPPCompiler(_StdCPPLibMixin, ClangCPPStds, ClangCompiler, CPPCompiler
return libs
return []
- def is_libcpp_enable_assertions_deprecated(self) -> bool:
- return version_compare(self.version, ">=18")
-
def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]:
if disable:
return ['-DNDEBUG']
@@ -326,13 +323,8 @@ class ClangCPPCompiler(_StdCPPLibMixin, ClangCPPStds, ClangCompiler, CPPCompiler
if self.language_stdlib_provider(env) == 'stdc++':
return ['-D_GLIBCXX_ASSERTIONS=1']
- else:
- if self.is_libcpp_enable_assertions_deprecated():
- return ['-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST']
- elif version_compare(self.version, '>=15'):
- return ['-D_LIBCPP_ENABLE_ASSERTIONS=1']
- return []
+ return ['-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST']
def get_pch_use_args(self, pch_dir: str, header: str) -> T.List[str]:
args = super().get_pch_use_args(pch_dir, header)
@@ -347,13 +339,7 @@ class ArmLtdClangCPPCompiler(ClangCPPCompiler):
class AppleClangCPPCompiler(AppleCompilerMixin, AppleCPPStdsMixin, ClangCPPCompiler):
- def is_libcpp_enable_assertions_deprecated(self) -> bool:
- # Upstream libc++ deprecated _LIBCPP_ENABLE_ASSERTIONS
- # in favor of _LIBCPP_HARDENING_MODE from version 18 onwards,
- # but Apple Clang 16's libc++ has back-ported that change.
- # See: https://github.com/mesonbuild/meson/issues/14440 and
- # https://github.com/mesonbuild/meson/issues/14856
- return version_compare(self.version, ">=16")
+ pass
class EmscriptenCPPCompiler(EmscriptenMixin, ClangCPPCompiler):
@@ -547,8 +533,6 @@ class GnuCPPCompiler(_StdCPPLibMixin, GnuCPPStds, GnuCompiler, CPPCompiler):
# an experimental configure arg to expose that.
if version_compare(self.version, '>=18'):
return ['-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST']
- elif version_compare(self.version, '>=15'):
- return ['-D_LIBCPP_ENABLE_ASSERTIONS=1']
return []