Re: [RFC PATCH] x86/boot: Get rid of linux/init.h include

From: Brian Gerst
Date: Mon Nov 25 2024 - 12:31:25 EST


On Mon, Nov 25, 2024 at 12:09 PM Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> On Mon, Nov 25, 2024 at 11:57:37AM -0500, Brian Gerst wrote:
> > How about removing the kernel headers that you don't want from the
> > include path? This is a part of a broader issue where different parts
> > of the kernel need different compiler flags (main kernel, VDSO, boot,
> > etc.) and the current makefile structure doesn't handle that very
> > well.
>
> Right, the idea is to remove *all* include/linux/ headers from the
> decompressor and have the build break if someone includes new ones, forcing
> her/him to properly split such header and use asm/shared for the common stuff.
>
> There are examples in asm/shared/ for that already.

To clarify, what I meant was to remove the -Iinclude/linux flag from
the compiler command line, instead of messing around with ifdefs.


Brian Gerst