commit: 1ed03f9079fac5c421eb8e6249490ada93f14950
parent c92f3e688d9523bc379a21e0c24d359d78c96f65
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sat, 23 Aug 2025 21:53:27 +0200
patches/dev-build/meson: test case fix
Diffstat:
1 file changed, 66 insertions(+), 0 deletions(-)
diff --git a/patches/dev-build/meson/0001-test-cases-common-32-has-header-disable-undef-with-c.patch b/patches/dev-build/meson/0001-test-cases-common-32-has-header-disable-undef-with-c.patch
@@ -0,0 +1,66 @@
+From 0abe2012c5426e83f66d8cc56603ad340d3a27dd Mon Sep 17 00:00:00 2001
+From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
+Date: Sat, 23 Aug 2025 21:50:26 +0200
+Subject: [PATCH] test cases/common/32 has header: disable undef with clang++
+
+Issue is in libcxx but not sure how exactly that could be
+detected properly, clang++ is the next best thing.
+
+ In file included from /usr/include/c++/v1/stdio.h:93:
+ In file included from /usr/include/c++/v1/__config:14:
+ In file included from /usr/include/c++/v1/__configuration/abi.h:15:
+ /usr/include/c++/v1/__configuration/platform.h:35:7: error: function-like macro '__has_include' is not defined
+ 35 | # if __has_include(<features.h>)
+ | ^
+ /usr/include/c++/v1/__configuration/platform.h:48:5: error: function-like macro '__has_include' is not defined
+ 48 | #if __has_include(<picolibc.h>)
+ | ^
+ 1 warning and 2 errors generated.
+ '
+ cpp compiler: header stdio.h found: ^[[31mNO^[[0m
+ err Stdio missing.
+ /var/tmp/portage/dev-build/muon-0.4.0/work/muon-v0.4.0/subprojects/meson-tests/common/32 has header/meson.build:24:9: error in assert
+ 24 | assert(comp.has_header('stdio.h', prefix: fallback), 'Stdio missing.')
+ ^_____________________________________________________________________
+---
+ test cases/common/32 has header/meson.build | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/test cases/common/32 has header/meson.build b/test cases/common/32 has header/meson.build
+index e6f6efb81..0c22c1a30 100644
+--- a/test cases/common/32 has header/meson.build
++++ b/test cases/common/32 has header/meson.build
+@@ -1,6 +1,7 @@
+ project('has header', 'c', 'cpp')
+
+ host_system = host_machine.system()
++cpp = meson.get_compiler('cpp')
+
+ non_existent_header = 'ouagadougou.h'
+
+@@ -10,15 +11,17 @@ configure_file(input : non_existent_header,
+ configuration : configuration_data())
+
+ # Test that the fallback to __has_include also works on all compilers
+-if host_system != 'darwin'
++#
++# darwin: can't redefine builtin macros so the above doesn't work
++# cpp clang: Undefining __has_include() breaks LLVM libstdcxx platform.h
++if host_system != 'darwin' and cpp.get_id() != 'clang'
+ fallbacks = ['', '\n#undef __has_include']
+ else
+- # On Darwin's clang you can't redefine builtin macros so the above doesn't work
+ fallbacks = ['']
+ endif
+
+ foreach fallback : fallbacks
+- foreach comp : [meson.get_compiler('c'), meson.get_compiler('cpp')]
++ foreach comp : [meson.get_compiler('c'), cpp]
+ assert(comp.has_header('stdio.h', prefix : fallback), 'Stdio missing.')
+
+ # stdio.h doesn't actually need stdlib.h, but just test that setting the
+
+base-commit: 0f5cd5fd8426241ab1d5371af553c9c0b5f165fc
+--
+2.49.1
+