Kernel 4.14.304 and newer can not be built. I get the following error while compiling: arch/x86/kernel/fpu/init.c: In function 'fpu__init_task_struct_size': arch/x86/kernel/fpu/init.c:177: error: implicit declaration of function '_Alignof' arch/x86/kernel/fpu/init.c:177: error: expected expression before 'struct' arch/x86/kernel/fpu/init.c:177: error: expected expression before 'struct' arch/x86/kernel/fpu/init.c:178: error: expected expression before 'struct' arch/x86/kernel/fpu/init.c:178: error: expected expression before 'struct' arch/x86/kernel/fpu/init.c:179: error: expected expression before 'struct' arch/x86/kernel/fpu/init.c:179: error: expected expression before 'struct' Kernel 4.14.303 is compiling/running without errors - so it must be this commit: commit 67c6d79777cf5d3165d6d2e2d7c5e37333d1a76e Author: YingChi Long <me@inclyc.cn> Date: Fri Nov 18 08:55:35 2022 +0800 x86/fpu: Use _Alignof to avoid undefined behavior in TYPE_ALIGN
Does it build fine if you revert this commit ontop? What toolchain are you using to build?
It builds fine without this commit, yes. I'm using standard (debian) tools for compiling (make) - but older versions because the OS is not up2date (and can not be updated).
What does gcc --version say?
gcc (Debian 4.4.5-8) 4.4.5
Looks like _Alignof came with gcc 4.7: https://gcc.gnu.org/gcc-4.7/changes.html According to Documentation/Changes, min gcc version for building 4.14 is 3.2 so I guess this patch needs to be reverted from stable. Assigning to Greg.
Ick, yeah, that's not good. Using old compilers usually isn't a good idea, but for this one we should probably revert it. Can you send email to stable@vger.kernel.org and we can take it from there.
If this showed up in 4.7, we'll need to also handle this for 4.19 if someone complains as the "minimum" gcc for that is 4.6 right now.