[OE-core] [PATCH] classes/meson.bbclass: Explicitly mark functions as missing in MinGW

Joshua Watt jpewhacker at gmail.com
Thu Feb 20 18:51:50 UTC 2020


meson (with some help from GCC) misdetects certain builtin functions as
being present on MinGW, when in fact they are not. Fix it by explicitly
marking the functions as missing. This requires rearranging the
meson.cross file to put the [properties] section at the end so the
append works properly (meson can't handle duplicate sections).

Signed-off-by: Joshua Watt <JPEWhacker at gmail.com>
---
 meta/classes/meson.bbclass | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index 06034e8b47..5c74658d01 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -96,14 +96,6 @@ readelf = ${@meson_array('READELF', d)}
 pkgconfig = 'pkg-config'
 llvm-config = 'llvm-config${LLVMVERSION}'
 
-[properties]
-needs_exe_wrapper = true
-c_args = ${@meson_array('CFLAGS', d)}
-c_link_args = ${@meson_array('LDFLAGS', d)}
-cpp_args = ${@meson_array('CXXFLAGS', d)}
-cpp_link_args = ${@meson_array('LDFLAGS', d)}
-gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper'
-
 [host_machine]
 system = '${@meson_operating_system('HOST_OS', d)}'
 cpu_family = '${@meson_cpu_family('HOST_ARCH', d)}'
@@ -115,6 +107,23 @@ system = '${@meson_operating_system('TARGET_OS', d)}'
 cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}'
 cpu = '${TARGET_ARCH}'
 endian = '${@meson_endian('TARGET', d)}'
+
+[properties]
+needs_exe_wrapper = true
+c_args = ${@meson_array('CFLAGS', d)}
+c_link_args = ${@meson_array('LDFLAGS', d)}
+cpp_args = ${@meson_array('CXXFLAGS', d)}
+cpp_link_args = ${@meson_array('LDFLAGS', d)}
+gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper'
+EOF
+}
+
+do_write_config_append_mingw32() {
+    # meson mis-detects the presence of several builtin functions in MinGW
+    # (see https://github.com/mesonbuild/meson/issues/3672).
+    # Explicitly mark these functions as missing in the cross file
+    cat >>${WORKDIR}/meson.cross <<EOF
+has_function_strndup = false
 EOF
 }
 
-- 
2.17.1



More information about the Openembedded-core mailing list