Compiling kernel-3.4.xxx with gcc-9.x. Need some help.

Willy Tarreau w at 1wt.eu
Sun Apr 18 14:36:59 EDT 2021


On Sun, Apr 18, 2021 at 07:25:08PM +0200, Fawad Lateef wrote:
> I tried booting the userspace compiled with gcc-9.1 and kernel
> compiled with gcc-5.5. But seems like the kernel 3.4.111 is not
> compatible with user-space compiled with gcc-9.1.
> During boot getting error: "FATAL: kernel too old." (from init I
> believe) and then kernel Panics. Log (part) below:

That's not a compiler issue, it's a libc issue. When you built your
toolchain you have likely (or accidently) selected a minimum kernel
version that is more recent than this one. The init code in the linker
checks the kernel version and refuses to start in such a case. If your
init depends on this libc, you simply cannot boot.

I don't know how far recent libcs can go on kernel support, but
you may possibly need to rebuild an older one, and sometimes older
libc will not build with modern gcc. So you should use the most
recent libc that still claims to support that kernel, and use the
most recent compiler your libc can be built with (maybe yours is
OK but I don't know).

Hoping this helps,
Willy



More information about the Kernelnewbies mailing list