[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 3/6] configure: add option to enable LTO
From: |
Alex Bennée |
Subject: |
Re: [PATCH v2 3/6] configure: add option to enable LTO |
Date: |
Wed, 28 Oct 2020 09:35:36 +0000 |
User-agent: |
mu4e 1.5.6; emacs 28.0.50 |
Daniele Buono <dbuono@linux.vnet.ibm.com> writes:
> In terms of ar and linker, if you don't have the right mix it will just
> stop at link time with an error.
>
> In terms of using gcc the errors may be a bit more subtle, similar to
> what Daniel mentioned. Succesfully compiling but then showing issues at
> runtime or in the test suite.
>
> I'm using ubuntu 18.04 and the stock compiler (based on gcc 7.5) issues
> a bunch of warnings but compile succesfully with LTO.
> However, the tcg binary for sparc64 is broken.
sparc64-linux-user? I think that might be in a bit of a bit rotted state
- we had to disable running check-tcg on it in CI because of instability
so I wouldn't be surprised if messing around with LTO has dug up even
more gremlins.
> System-wide emulation
> stops in OpenFirmware with an exception. User emulation triggers a
> segmentation fault in some of the test cases. If I compile QEMU with
> --enable-debug the tests magically work.
Breakage in both system and linux-user emulation probably points at
something in the instruction decode being broken. Shame we don't have a
working risu setup for sparc64 to give the instruction handling a proper
work out.
>
> I briefly tested with gcc-9 and that seemed to work ok, buy your mileage
> may vary
>
> On 10/26/2020 11:50 AM, Daniel P. Berrangé wrote:
>> On Mon, Oct 26, 2020 at 10:51:43AM +0100, Paolo Bonzini wrote:
>>> On 23/10/20 22:06, Daniele Buono wrote:
>>>> This patch allows to compile QEMU with link-time optimization (LTO).
>>>> Compilation with LTO is handled directly by meson. This patch adds checks
>>>> in configure to make sure the toolchain supports LTO.
>>>>
>>>> Currently, allow LTO only with clang, since I have found a couple of issues
>>>> with gcc-based LTO.
>>>>
>>>> In case fuzzing is enabled, automatically switch to llvm's linker (lld).
>>>> The standard bfd linker has a bug where function wrapping (used by the
>>>> fuzz*
>>>> targets) is used in conjunction with LTO.
>>>>
>>>> Tested with all major versions of clang from 6 to 12
>>>>
>>>> Signed-off-by: Daniele Buono <dbuono@linux.vnet.ibm.com>
>>>
>>> What are the problems like if you have GCC or you ar/linker are not up
>>> to the job? I wouldn't mind omitting the tests since this has to be
>>> enabled explicitly by the user.
>>
>> We temporarily disabled LTO in Fedora rawhide due to GCC bugs causing
>> wierd test suite asserts. Those were pre-release versions of GCC/binutils
>> though. I've just tested again and LTO works correctly, so I've enabled
>> LTO once again.
>>
>> Regards,
>> Daniel
>>
--
Alex Bennée
- Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings, (continued)
- [PATCH v2 3/6] configure: add option to enable LTO, Daniele Buono, 2020/10/23
- Re: [PATCH v2 3/6] configure: add option to enable LTO, Paolo Bonzini, 2020/10/26
- Re: [PATCH v2 3/6] configure: add option to enable LTO, Daniel P . Berrangé, 2020/10/26
- Re: [PATCH v2 3/6] configure: add option to enable LTO, Daniele Buono, 2020/10/27
- Re: [PATCH v2 3/6] configure: add option to enable LTO, Daniel P . Berrangé, 2020/10/27
- Re: [PATCH v2 3/6] configure: add option to enable LTO, Daniele Buono, 2020/10/27
- Re: [PATCH v2 3/6] configure: add option to enable LTO, Paolo Bonzini, 2020/10/28
- Re: [PATCH v2 3/6] configure: add option to enable LTO, Daniele Buono, 2020/10/28
- Re: [PATCH v2 3/6] configure: add option to enable LTO, Paolo Bonzini, 2020/10/29
- Re: [PATCH v2 3/6] configure: add option to enable LTO,
Alex Bennée <=
- Re: [PATCH v2 3/6] configure: add option to enable LTO, Daniele Buono, 2020/10/28
[PATCH v2 4/6] cfi: Initial support for cfi-icall in QEMU, Daniele Buono, 2020/10/23
[PATCH v2 5/6] check-block: enable iotests with cfi-icall, Daniele Buono, 2020/10/23
[PATCH v2 6/6] configure: add support for Control-Flow Integrity, Daniele Buono, 2020/10/23
Re: [PATCH v2 0/6] Add support for Control-Flow Integrity, Eric Blake, 2020/10/23