archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <>
To: Josh Poimboeuf <>
Cc: Masahiro Yamada <>,
	Michal Marek <>,
	Linux Kernel Mailing List <>,
	Kees Cook <>,,
	Linux Kbuild mailing list <>,
	Peter Zijlstra <>,
	Justin Forbes <>,
	Ondrej Mosnacek <>,
	Greg Kroah-Hartman <>,
	Christoph Hellwig <>,
	Miroslav Benes <>,
	David Laight <>,
	Jessica Yu <>
Subject: Re: [PATCH RFC] kbuild: Prevent compiler mismatch with external modules
Date: Thu, 28 Jan 2021 13:45:51 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <20210128213409.qxnclchjyq6v23up@treble>

On Thu, Jan 28, 2021 at 1:34 PM Josh Poimboeuf <> wrote:
> On Thu, Jan 28, 2021 at 01:23:11PM -0800, Linus Torvalds wrote:
> > THAT workaround is long gone, but I didn't check what other ones we
> > might have now. But the gcc version checks we _do_ have are not
> > necessarily about major versions at all (ie I trivially found checks
> > for 4.9, 4.9.2, 5.1, 7.2 and 9.1).
> Then maybe the check should be same major.minor?

Well, how many of them are actually about things that generate
incompatible object code?

The main one I can think of is the KASAN ABI version checks, but
honestly, I think that's irrelevant. I really hope no distros enable
KASAN in user kernels.

Another version check I looked at was the one that just checks whether
the compiler natively supports __builtin_mul_overflow() or not - it
doesn't generate incompatible object code, it just takes advantage of
a compiler feature if one exists. You can mix and match those kinds of
things well enough.

So I'd really like to hear actual hard technical reasons with
examples, for why you'd want to add this test in the first place.

No hand-waving "different compiler versions don't work together".
Because that's simply not true.

> And convert it to a strongly worded warning/disclaimer?

A warning might be better for the simple reason that it wouldn't cause
people to just fix it with "make oldconfig".

Maybe you haven't looked at people who compile external modules, but
they always have various "this is how to work around issues with
version XYZ". That "make oldconfig" would simply just become the
workaround for any build errors.

And a warning might be more palatable even if different compiler
version work fine together. Just a heads up on "it looks like you
might be mixing compiler versions" is a valid note, and isn't
necessarily wrong. Even when they work well together, maybe you want
to have people at least _aware_ of it.


  reply	other threads:[~2021-01-28 21:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 20:08 Josh Poimboeuf
2021-01-28 20:24 ` Linus Torvalds
2021-01-28 20:52   ` Josh Poimboeuf
2021-01-28 21:03     ` Linus Torvalds
2021-01-28 21:23       ` Linus Torvalds
2021-01-28 21:34         ` Josh Poimboeuf
2021-01-28 21:45           ` Linus Torvalds [this message]
2021-01-28 22:08             ` Josh Poimboeuf
2021-01-28 23:17               ` Masahiro Yamada
2021-02-01 21:13                 ` Josh Poimboeuf
2021-03-05 16:28                   ` Masahiro Yamada
2021-03-05 19:24                     ` Josh Poimboeuf

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH RFC] kbuild: Prevent compiler mismatch with external modules' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).