On 12/01/2022 19:50, Jan Kiszka wrote:
On 12.01.22 14:54, Ralf Ramsauer wrote:


On 12/01/2022 07:56, Peng Fan (OSS) wrote:
From: Peng Fan <[email protected]>

With gcc 5.15, met the following error

hypervisor/arch/arm64/control.c:33:9:
error: ‘memset’ offset [0, 255] is out of the bounds [0, 0] [-Werror=array-bounds]     33 |         memset(&this_cpu_data()->guest_regs, 0, sizeof(union registers));        | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I see the same error on gcc-11.1.

My local workaround is to add -ffreestanding to hypervisor/Makefile, as this avoids builtin gcc-magic such as undesired inlining of memsets with constant size.

We already use -ffreestanding for inmates, and I guess we should do it for the hypervisor as well.


The kernel uses -ffreestanding at least for its (generic) string functions. So for us maybe

CFLAGS_lib.o := -freestanding

Which only helps against odd optimisation /within/ that compilation unit. It will not affect users of exported standard string routines.

  Ralf


Jan


--
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/a636946f-a28f-1aed-3050-87df64b1eba7%40oth-regensburg.de.

Reply via email to