Hello,

We identified compilation errors for xen-tools (4.14 and 4.15) with GCC 11.1 
due to `-Werror=vla-parameter`.

There are a couple of source files with similar errors like this:
```
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*/])
      |                                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
```

The quick fix for is to have the following:
```
diff --git a/recipes-extended/xen/xen-tools.inc 
b/recipes-extended/xen/xen-tools.inc
index 3560e79..5a054af 100644
--- a/recipes-extended/xen/xen-tools.inc
+++ b/recipes-extended/xen/xen-tools.inc
@@ -725,9 +725,11 @@ do_configure() {
     do_configure_common
}

+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() {
```

I'd like to know if this is an acceptable solution or if you have any other 
suggestions other than fixing the actual code
since this might take some time and I think that the Xen community will be 
looking at this soon.

Cheers,

--
Diego Sueiro


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

Reply via email to