All of lore.kernel.org
 help / color / mirror / Atom feed
* xen-tools compilation errors with GCC 11
@ 2021-05-06  6:01 Diego Sueiro
  2021-05-06 12:21 ` Bruce Ashfield
  0 siblings, 1 reply; 2+ messages in thread
From: Diego Sueiro @ 2021-05-06  6:01 UTC (permalink / raw)
  To: meta-virtualization; +Cc: nd, christopher.w.clark, Bruce Ashfield

[-- Attachment #1: Type: text/plain, Size: 1342 bytes --]

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



[-- Attachment #2: Type: text/html, Size: 46461 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: xen-tools compilation errors with GCC 11
  2021-05-06  6:01 xen-tools compilation errors with GCC 11 Diego Sueiro
@ 2021-05-06 12:21 ` Bruce Ashfield
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2021-05-06 12:21 UTC (permalink / raw)
  To: Diego Sueiro; +Cc: meta-virtualization, nd, christopher.w.clark

On Thu, May 6, 2021 at 2:01 AM Diego Sueiro <Diego.Sueiro@arm.com> wrote:
>
> 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.
>

I'm ok with the workaround. The code hasn't changed, and we've lived
with it so far, so I'm not really concerned at the technical level
about the warning.

And I'd rather no one spend the time to do a fix that might be
different than the eventual upstream Xen solution.

Bruce

>
>
> Cheers,
>
>
>
> --
> Diego Sueiro
>
>



-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-06 12:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06  6:01 xen-tools compilation errors with GCC 11 Diego Sueiro
2021-05-06 12:21 ` Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.