Skip to contentSkip to conversation

classes/meson.bbclass: Explicitly mark functions as missing in MinGW

PATCH In review Joshua Watt 2 participants 5 messages Feb 20, 2020 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 classes/meson.bbclass: Explicitly mark functions as missing in MinGW

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).

---
 meta/classes/meson.bbclass | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)
meta/classes/meson.bbclass +17 -8
index 06034e8b47..5c74658d01 100644
@@ -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
 }
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 6 lines · Joshua Watt

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).

patch is fine workaround, but I think meson should look for strndup in string.h

Quoted 49 lines
---
  meta/classes/meson.bbclass | 25 +++++++++++++++++--------
  1 file changed, 17 insertions(+), 8 deletions(-)
meta/classes/meson.bbclass +17 -8
index 06034e8b47..5c74658d01 100644
@@ -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 lore raw
Quoted 10 lines · Khem Raj
Quoted 6 lines · Joshua Watt

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).

Quoted 3 lines

patch is fine workaround, but I think meson should look for strndup in string.h

Agreed. I think the upstream fix would be better, and I will look at that also.

Quoted 57 lines

meta/classes/meson.bbclass system = '${@meson_operating_system('TARGET_OS',

Quoted 25 lines
---
  meta/classes/meson.bbclass | 25 +++++++++++++++++--------
  1 file changed, 17 insertions(+), 8 deletions(-)
meta/classes/meson.bbclass +0 -8
index 06034e8b47..5c74658d01 100644
@@ -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)}'

Quoted 6 lines
meta/classes/meson.bbclass +3 -0
  cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}'
  cpu = '${TARGET_ARCH}'
  endian = '${@meson_endian('TARGET', d)}'
+
+[properties]
+needs_exe_wrapper = true

meta/classes/meson.bbclass system = '${@meson_operating_system('TARGET_OS', d)}'

Quoted 10 lines
meta/classes/meson.bbclass +10 -0
+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

meta/classes/meson.bbclass system = '${@meson_operating_system('TARGET_OS', d)}' · line 129

Quoted 8 lines
meta/classes/meson.bbclass +4 -0
+    # (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
  }
 

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 15 lines · Joshua Watt
Quoted 11 lines · Khem Raj
Quoted 6 lines · Joshua Watt

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).

Quoted 5 lines
Quoted 2 lines

patch is fine workaround, but I think meson should look for strndup in string.h

Agreed. I think the upstream fix would be better, and I will look at that also.

Fixed in http://lists.openembedded.org/pipermail/openembedded-core/2020-February/293233.html
if that is preferable.

Quoted 56 lines
Quoted 56 lines
Quoted 41 lines
---
  meta/classes/meson.bbclass | 25 +++++++++++++++++--------
  1 file changed, 17 insertions(+), 8 deletions(-)
meta/classes/meson.bbclass +10 -8
index 06034e8b47..5c74658d01 100644
@@ -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
+}

meta/classes/meson.bbclass system = '${@meson_operating_system('TARGET_OS', d)}' · line 129

Quoted 10 lines
meta/classes/meson.bbclass +7 -0
+
+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
  }
 

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#4 lore raw
Quoted 22 lines · Joshua Watt
Quoted 20 lines · Joshua Watt
Quoted 16 lines · Khem Raj
Quoted 9 lines · Joshua Watt

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).

patch is fine workaround, but I think meson should look for strndup in
string.h

Quoted 6 lines
Quoted 2 lines

Agreed. I think the upstream fix would be better, and I will look at that also.

Fixed in
http://lists.openembedded.org/pipermail/openembedded-core/2020-February/293233.html
if that is preferable.

sounds good. Thanks for taking time to fix it

Quoted 59 lines
Quoted 59 lines
Quoted 59 lines
Quoted 50 lines
---
  meta/classes/meson.bbclass | 25 +++++++++++++++++--------
  1 file changed, 17 insertions(+), 8 deletions(-)
meta/classes/meson.bbclass +0 -8
index 06034e8b47..5c74658d01 100644
@@ -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('TARGE

T_OS', d)}'
cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}' cpu = '${TARGET_ARCH}'
endian = '${@meson_endian('TARGET', d)}'

meta/classes/meson.bbclass +13 -0
+
+[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

meta/classes/meson.bbclass +2 -0
+    # (see https://github.com/mesonbuild/meson/issues/3672).
+    # Explicitly mark these functions as missing in the cross

file

meta/classes/meson.bbclass system = '${@meson_operating_system('TARGET_OS', d)}' · line 128

Quoted 4 lines
meta/classes/meson.bbclass +2 -0
+    cat >>${WORKDIR}/meson.cross <<EOF
+has_function_strndup = false
  EOF
  }

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core