From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Sasha Levin <sashal@kernel.org>,
stable@vger.kernel.org, llvm@lists.linux.dev,
Nick Desaulniers <ndesaulniers@google.com>,
YingChi Long <me@inclyc.cn>, Borislav Petkov <bp@alien8.de>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: offsetof() backports for clang-16+
Date: Sun, 22 Jan 2023 15:20:29 +0100 [thread overview]
Message-ID: <Y81GLTbxc5NY6chR@kroah.com> (raw)
In-Reply-To: <Y8TWrJpb6Vn6E4+v@dev-arch.thelio-3990X>
On Sun, Jan 15, 2023 at 09:46:36PM -0700, Nathan Chancellor wrote:
> Hi Greg and Sasha,
>
> Clang 16 (current main, next major release) errors when offsetof() has a
> type defintion in it, in response to language in newer C standards
> stating it is undefined behavior.
>
> https://github.com/llvm/llvm-project/commit/e327b52766ed497e4779f4e652b9ad237dfda8e6
> https://reviews.llvm.org/D133574
>
> While this might be eventually demoted to just a warning, the kernel has
> already cleaned up places that had this construct, so we can apply them
> to the stable trees and avoid the issue altogether.
>
> Please find attached mbox files for all supported stable trees, which
> fix up the relevant instances for each tree using the upstream commits:
>
> 55228db2697c ("x86/fpu: Use _Alignof to avoid undefined behavior in TYPE_ALIGN")
> 09794a5a6c34 ("tracing: Use alignof__(struct {type b;}) instead of offsetof()")
>
> The fpu commit uses _Alignof, which as far as I can tell was only
> supported in GCC 4.7.0+. This is not a problem for mainline due to
> requiring GCC 5.1.0+ but it could be relevant for old trees like 4.14,
> which have an older minimum supported version. I hope people are not
> using ancient compilers like that but I suppose if they are using 4.14,
> they might just be stuck with old software...
>
> If there are any issues or comments, please let me know.
Now queued up, thanks.
greg k-h
prev parent reply other threads:[~2023-01-22 14:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-16 4:46 offsetof() backports for clang-16+ Nathan Chancellor
2023-01-22 14:20 ` Greg Kroah-Hartman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y81GLTbxc5NY6chR@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=bp@alien8.de \
--cc=llvm@lists.linux.dev \
--cc=me@inclyc.cn \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=rostedt@goodmis.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).