qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] exec: Build page-varry-common.c with -fno-lto


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] exec: Build page-varry-common.c with -fno-lto
Date: Mon, 22 Mar 2021 12:14:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0

On 3/21/21 10:15 PM, Richard Henderson wrote:
> In bbc17caf81f, we used an alias attribute to allow target_page
> to be declared const, and yet be initialized late.
> 
> This fails when using LTO with several versions of gcc.
> The compiler looks through the alias and decides that the const
> variable is statically initialized to zero, then propagates that
> zero to many uses of the variable.
> 
> This can be avoided by compiling one object file with -fno-lto.
> In this way, any initializer cannot be seen, and the constant
> propagation does not occur.
> 
> Since are certain to have this separate compilation unit, we can
> drop the alias attribute as well.  We simply have differing
> declarations for target_page in different compilation units.
> Drop the use of init_target_page, and drop the configure detection
> for CONFIG_ATTRIBUTE_ALIAS.
> 
> In order to change the compilation flags for a file with meson,
> we must use a static_library.  This runs into specific_ss, where
> we would need to create many static_library instances.
> 
> Fix this by splitting exec-page.c: the page-vary-common.c part is
> compiled once as a static_library, while the page-vary.c part is
> left in specific_ss in order to handle the target-specific value
> of TARGET_PAGE_BITS_MIN.
> 
> Reported-by: Gavin Shan <gshan@redhat.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  configure                |  19 -------
>  meson.build              |  18 ++++++-
>  include/exec/cpu-all.h   |  15 ++----
>  include/exec/page-vary.h |  34 ++++++++++++
>  exec-vary.c              | 108 ---------------------------------------
>  page-vary-common.c       |  54 ++++++++++++++++++++
>  page-vary.c              |  41 +++++++++++++++
>  7 files changed, 150 insertions(+), 139 deletions(-)
>  create mode 100644 include/exec/page-vary.h
>  delete mode 100644 exec-vary.c
>  create mode 100644 page-vary-common.c
>  create mode 100644 page-vary.c

In which MAINTAINERS section this files belong to?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]