[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFULd4YZbK5bvLCfEnX7y0qZUgtQuw6FfGMBKm-qjVMZvH8XWw@mail.gmail.com>
Date: Wed, 7 Aug 2024 16:37:12 +0200
From: Uros Bizjak <ubizjak@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Bagas Sanjaya <bagasdotme@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>, x86@...nel.org,
Ingo Molnar <mingo@...nel.org>, Linus Torvalds <torvalds@...ux-foundation.org>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, "H. Peter Anvin" <hpa@...or.com>,
Josh Poimboeuf <jpoimboe@...nel.org>, Breno Leitao <leitao@...ian.org>,
Kent Overstreet <kent.overstreet@...ux.dev>, Takashi Iwai <tiwai@...e.de>,
"Russell King (Oracle)" <rmk+kernel@...linux.org.uk>, Mark Brown <broonie@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Arnd Bergmann <arnd@...db.de>,
Stas Sergeev <stsp2@...dex.ru>, mrwizardwizard <terrym3201@...tonmail.com>
Subject: Re: Fwd: error: 'const_pcpu_hot' causes a section type conflict with
'pcpu_hot' when compiling with -flto
On Wed, Aug 7, 2024 at 4:08 PM Thomas Gleixner <tglx@...utronix.de> wrote:
>
> On Sat, Aug 03 2024 at 10:55, Bagas Sanjaya wrote:
> >> when compiling linux kernel 6.9-6.10 with -flto
> >>
> >> compiler outputs:
> >>
> >> ./arch/x86/include/asm/current.h:42:25: error: 'const_pcpu_hot' causes a section type conflict with 'pcpu_hot' const_pcpu_hot);
> >
> > He could reproduce the build error on mainline:
>
> That's caused by:
>
> ed2f752e0e0a ("x86/percpu: Introduce const-qualified const_pcpu_hot to micro-optimize code generation")
>
> Uros?
I have taken the discussion to the bugreport, where the potential
patch is also posted.
For reference, my answer is as follows:
--cut here--
(In reply to mrwizardwizard from comment #0)
> when compiling linux kernel 6.9-6.10 with -flto
You need a whole lot more patches to successfully compile kernel with
GCC LTO. The last revision can be found at:
https://lore.kernel.org/lkml/20221114114344.18650-1-jirislaby@kernel.org/
The patchset defines CONFIG_LTO, which can be used to disable
offending optimization, something like the to-be attached patch.
Ideally, a LTO-compatible "const __seg_gs" qualified alias to struct
pcpu_hot should be declared, so LTO can retain the disabled
optimization, but ...
... the LTO patchset was rejected mainly due to:
- the performance is the same
- the resulting image is bigger
- we need a whole lot of ugly hacks to placate the linker.
--cut here--
Thanks,
Uros.
Powered by blists - more mailing lists