Linux kernel -stable discussions
 help / color / mirror / Atom feed
* Regression: cannot compile kernel 4.14 with old gcc
@ 2019-06-28 15:53 Tony Battersby
  2019-06-28 16:42 ` Nick Desaulniers
  0 siblings, 1 reply; 3+ messages in thread
From: Tony Battersby @ 2019-06-28 15:53 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman, Sasha Levin, Nick Desaulniers
  Cc: Miguel Ojeda, Nathan Chancellor, Josh Poimboeuf, Andy Lutomirski

Old versions of gcc cannot compile 4.14 since 4.14.113:

./include/asm-generic/fixmap.h:37: error: implicit declaration of function ‘__builtin_unreachable’

The stable commit that caused the problem is 82017e26e515 ("compiler.h:
update definition of unreachable()") (upstream commit fe0640eb30b7). 
Reverting the commit fixes the problem.

Kernel 4.17 dropped support for older versions of gcc in upstream commit
cafa0010cd51 ("Raise the minimum required gcc version to 4.6").  This
was not backported to 4.14 since that would go against the stable kernel
rules.

Upstream commit 815f0ddb346c ("include/linux/compiler*.h: make
compiler-*.h mutually exclusive") was a fix for cafa0010cd51.  This was
not backported to 4.14.

Upstream commit fe0640eb30b7 ("compiler.h: update definition of
unreachable()") was a fix for 815f0ddb346c.  This is the commit that was
backported to 4.14.  But it only fixed a problem introduced in the other
commits, and without those commits, it ends up introducing a problem
instead of fixing one.  So I recommend reverting that patch in 4.14,
which will enable old gcc to compile 4.14 again.  If I understand
correctly, I believe that clang will still be able to compile 4.14 with
the patch reverted, although I haven't tried to compile with clang.

The problematic commit is not present in 4.9.x, 4.4.x, 3.18.x, or 3.16.x.

Tony Battersby
Cybernetics


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-28 20:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-28 15:53 Regression: cannot compile kernel 4.14 with old gcc Tony Battersby
2019-06-28 16:42 ` Nick Desaulniers
2019-06-28 20:37   ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox