This repository provides a guide-first workflow for building a modern x86-64 Linux kernel with Intel oneAPI LLVM-based tooling.
It includes:
- A practical Intel
icxbuild guide - Scripts to patch Kbuild for Intel compiler detection
- Scripts to automate configure/build/install commands
- One end-to-end script to run the full flow
Kernel
.cfiles must useicx(C compiler).
icpxis the C++ compiler and is only optional for host-side C++ tools.
-
/home/runner/work/Linux-kernel-intel-c/Linux-kernel-intel-c/scripts/patch_kbuild_for_icx.py
Patches kernel source tree files:scripts/as-version.sh(treatsicxas LLVM IAS)- top-level
Makefile(selectsscripts/Makefile.clangfor Intel compiler text)
-
/home/runner/work/Linux-kernel-intel-c/Linux-kernel-intel-c/scripts/build_kernel_icx.sh
Runsmakewith recommended Intel/LLVM toolchain variables andKCFLAGS="-ffreestanding -fno-builtin". -
/home/runner/work/Linux-kernel-intel-c/Linux-kernel-intel-c/scripts/full_kernel_icx_flow.sh
One all-in-one script that checks tools, patches Kbuild, prepares config, builds, and optionally installs.
Intel icx is LLVM-based but its compiler identity is not always detected by kernel logic that expects typical Clang strings.
Two build-system touchpoints matter:
scripts/as-version.shmust classifyicxas LLVM integrated assembler- top-level
Makefilemust choosescripts/Makefile.clangfor Intel compiler version text
Also, to prevent unresolved Intel runtime symbols in kernel/module objects, use:
-ffreestanding-fno-builtin
- Prepare dependencies (kernel deps + LLVM tools + oneAPI with
icx/icpx) - Run the all-in-one script:
/home/runner/work/Linux-kernel-intel-c/Linux-kernel-intel-c/scripts/full_kernel_icx_flow.sh \
--kernel-src /path/to/linux \
--jobs 10- Optional install step:
/home/runner/work/Linux-kernel-intel-c/Linux-kernel-intel-c/scripts/full_kernel_icx_flow.sh \
--kernel-src /path/to/linux \
--jobs 10 \
--installpython3 /home/runner/work/Linux-kernel-intel-c/Linux-kernel-intel-c/scripts/patch_kbuild_for_icx.py \
--kernel-src /path/to/linux/home/runner/work/Linux-kernel-intel-c/Linux-kernel-intel-c/scripts/build_kernel_icx.sh \
--kernel-src /path/to/linux \
--jobs 10make -j10 \
CC=icx \
LD=ld.lld \
AR=llvm-ar \
NM=llvm-nm \
STRIP=llvm-strip \
OBJCOPY=llvm-objcopy \
OBJDUMP=llvm-objdump \
READELF=llvm-readelf \
LLVM_IAS=1 \
KCFLAGS="-ffreestanding -fno-builtin" \
bzImage modules- Use
CC=icxfor kernel C compilation. - Keep host tools on GCC/binutils unless you explicitly want Intel/LLVM host tools.
- If ORC/objtool issues appear, fallback to frame-pointer unwinder can be used in config.
- Prefer
INSTALL_MOD_STRIP=1during module install to avoid oversized.kofiles.