When compiling xen-tools (4.14 and 4.15) with gcc-11 the following kind of
errors are produced:

linux.c:164:50: error: argument 7 of type 'const xen_pfn_t[]' {aka 'const long 
unsigned int[]'} declared as an ordinary array [-Werror=vla-parameter]
  164 |                                  const xen_pfn_t arr[/*num*/], int 
err[/*num*/])
      |                                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~

Workaround it by passing -Wno-vla-parameter to the compiler.

Signed-off-by: Diego Sueiro <[email protected]>
---
 recipes-extended/xen/xen-tools.inc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/recipes-extended/xen/xen-tools.inc 
b/recipes-extended/xen/xen-tools.inc
index 3560e79..e939c45 100644
--- a/recipes-extended/xen/xen-tools.inc
+++ b/recipes-extended/xen/xen-tools.inc
@@ -725,9 +725,12 @@ do_configure() {
     do_configure_common
 }
 
+# Workaround when compiling with gcc-11
+EXTRA_CFLAGS_XEN_TOOLS_append = " -Wno-vla-parameter"
+
 do_compile() {
     cd ${S}
-    oe_runmake tools PYTHON="${PYTHON}"
+    oe_runmake tools EXTRA_CFLAGS_XEN_TOOLS="${EXTRA_CFLAGS_XEN_TOOLS}" 
PYTHON="${PYTHON}"
 }
 
 do_install() {
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#6488): 
https://lists.yoctoproject.org/g/meta-virtualization/message/6488
Mute This Topic: https://lists.yoctoproject.org/mt/82633036/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to