Re: [PATCH 3/3] isystem: delete global -isystem compile option

From: Nathan Chancellor
Date: Mon Aug 02 2021 - 16:38:16 EST


On 8/2/2021 1:32 PM, Alexey Dobriyan wrote:
On Mon, Aug 02, 2021 at 11:18:32AM -0700, Nathan Chancellor wrote:
On Sun, Aug 01, 2021 at 11:13:36PM +0300, Alexey Dobriyan wrote:
In theory, it enables "leakage" of userspace headers into kernel which
may present licensing problem.

In practice, only stdarg.h was used, stdbool.h is trivial and SIMD
intrinsics are contained to a few architectures and aren't global
problem.

In general, kernel is very self contained code and -isystem removal
will further isolate it from Ring Threeland influence.

nds32 keeps -isystem globally due to intrisics used in entrenched header.

-isystem is selectively reenabled for some files.

Not compile tested on hexagon.

With this series on top of v5.14-rc4 and a tangential patch to fix
another issue, ARCH=hexagon defconfig and allmodconfig show no issues.

Tested-by: Nathan Chancellor <nathan@kernel> # build (hexagon)

Oh wow, small miracle. Thank you!

Where can I find a cross-compiler? This link doesn't seem to have one
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/11.1.0/

Hexagon only builds with LLVM now because of the bump to require gcc 4.9: https://lore.kernel.org/r/20210623141854.GA32155@xxxxxx/

Brian Cain has a link in that thread to an LLVM toolchain that works well for defconfig (allmodconfig requires LLVM 13/14 from git). Otherwise, https://apt.llvm.org or LLVM from your package manager should be sufficient for the same targets.

$ make -skj"$(nproc)" ARCH=hexagon CROSS_COMPILE=hexagon-linux-musl- LLVM=1 LLVM_IAS=1 defconfig all

should work fine as long as the bin folder for whatever toolchain you download is in your PATH.

Cheers,
Nathan