[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72mYSPA_S6hT4B2U8Sgt2QTJekuVEKqjJDgQxGVmMX64jA@mail.gmail.com>
Date: Fri, 20 Jun 2025 15:00:01 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Nathan Chancellor <nathan@...nel.org>, Tony Ambardar <tony.ambardar@...il.com>,
Daniel Borkmann <daniel@...earbox.net>, Arnd Bergmann <arnd@...db.de>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>, Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>, Kees Cook <kees@...nel.org>,
Miguel Ojeda <ojeda@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] kbuild: change __retain macro for gcc-11
On Fri, Jun 20, 2025 at 1:14 PM Arnd Bergmann <arnd@...nel.org> wrote:
>
> Building kernels with CONFIG_LD_DEAD_CODE_DATA_ELIMINATION using gcc-11
> causes compiler warnings:
>
> kernel/cgroup/rstat.c:65:1: error: 'retain' attribute ignored [-Werror=attributes]
>
> It appears that this version reports __has_attribute(__retain__) as true
> but doesn't actually support the feature.
Hmm... I can't reproduce the error in Compiler Explorer:
https://godbolt.org/z/roMrfjxGM
And locally with a GCC 11.4 I can see the attribute keeping a function
in the final binary when marked as `retain` against `retain` against
`-ffunction-sections -Wl,--gc-sections`.
Is something else going on?
Cheers,
Miguel
Powered by blists - more mailing lists