Re: [PATCH RFC] kbuild: Prevent compiler mismatch with external modules

2021-03-05 Thread Josh Poimboeuf
On Sat, Mar 06, 2021 at 01:28:22AM +0900, Masahiro Yamada wrote: > > +orig_name := $(if $(CONFIG_CC_IS_GCC),GCC,CLANG) > > +orig_minor := $(shell expr $(if > > $(CONFIG_CC_IS_GCC),$(CONFIG_GCC_VERSION),$(CONFIG_CLANG_VERSION)) / 100) > > +cur_namever := $(shell $(srctree)/scripts/cc-version.sh

Re: [PATCH RFC] kbuild: Prevent compiler mismatch with external modules

2021-03-05 Thread Masahiro Yamada
On Tue, Feb 2, 2021 at 6:13 AM Josh Poimboeuf wrote: > > On Fri, Jan 29, 2021 at 08:17:51AM +0900, Masahiro Yamada wrote: > > [3] > > Peterz already pointed out asm-goto as an example of ABI mismatch. > > > > I remember a trouble reported in the past due > > to the mismatch of -mstack-protector-gu

Re: [PATCH RFC] kbuild: Prevent compiler mismatch with external modules

2021-02-01 Thread Josh Poimboeuf
On Fri, Jan 29, 2021 at 08:17:51AM +0900, Masahiro Yamada wrote: > [3] > Peterz already pointed out asm-goto as an example of ABI mismatch. > > I remember a trouble reported in the past due > to the mismatch of -mstack-protector-guard-offset. > > https://bugzilla.kernel.org/show_bug.cgi?id=201891

Re: [PATCH RFC] kbuild: Prevent compiler mismatch with external modules

2021-01-28 Thread Masahiro Yamada
On Fri, Jan 29, 2021 at 7:08 AM Josh Poimboeuf wrote: > > On Thu, Jan 28, 2021 at 01:45:51PM -0800, Linus Torvalds wrote: > > 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

Re: [PATCH RFC] kbuild: Prevent compiler mismatch with external modules

2021-01-28 Thread Josh Poimboeuf
On Thu, Jan 28, 2021 at 01:45:51PM -0800, Linus Torvalds wrote: > 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 gc

Re: [PATCH RFC] kbuild: Prevent compiler mismatch with external modules

2021-01-28 Thread Linus Torvalds
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

Re: [PATCH RFC] kbuild: Prevent compiler mismatch with external modules

2021-01-28 Thread Josh Poimboeuf
On Thu, Jan 28, 2021 at 01:23:11PM -0800, Linus Torvalds wrote: > On Thu, Jan 28, 2021 at 1:03 PM Linus Torvalds > wrote: > > > > I really think the whole compiler version check is purely voodoo > > programming. > > .. but there are obviously potentially things we - in the kernel - do > that may

Re: [PATCH RFC] kbuild: Prevent compiler mismatch with external modules

2021-01-28 Thread Linus Torvalds
On Thu, Jan 28, 2021 at 1:03 PM Linus Torvalds wrote: > > I really think the whole compiler version check is purely voodoo programming. .. but there are obviously potentially things we - in the kernel - do that may make certain compiler versions incompatible. We long long ago used to have things

Re: [PATCH RFC] kbuild: Prevent compiler mismatch with external modules

2021-01-28 Thread Linus Torvalds
On Thu, Jan 28, 2021 at 12:52 PM Josh Poimboeuf wrote: > > Huh? Why would you do a "make oldconfig" on a distro-released kernel > before building an OOT module? I guarantee you that this patch will *make* people do that. > Hm? Are you saying the check is too strict, since GCC9 binaries _might_

Re: [PATCH RFC] kbuild: Prevent compiler mismatch with external modules

2021-01-28 Thread Josh Poimboeuf
On Thu, Jan 28, 2021 at 12:24:45PM -0800, Linus Torvalds wrote: > On Thu, Jan 28, 2021 at 12:08 PM Josh Poimboeuf wrote: > > > > Add a check for compiler mismatch, but only check the major version. > > I think this is wrong for multiple reasons. > > The most fundamental reason is that it's point

Re: [PATCH RFC] kbuild: Prevent compiler mismatch with external modules

2021-01-28 Thread Linus Torvalds
On Thu, Jan 28, 2021 at 12:08 PM Josh Poimboeuf wrote: > > Add a check for compiler mismatch, but only check the major version. I think this is wrong for multiple reasons. The most fundamental reason is that it's pointless and doesn't actually do what you claim it does. Just doing a "make oldco

[PATCH RFC] kbuild: Prevent compiler mismatch with external modules

2021-01-28 Thread Josh Poimboeuf
When building an external module, if the compiler version differs from what the kernel was built with, bad things can happen. Many kernel features change based on available compiler features. Silently removing a compiler-dependent feature in the external module build can cause unpredictable behav