summaryrefslogtreecommitdiff
path: root/sources/linux/linux.spec
diff options
context:
space:
mode:
authorAlexander Hill <ahill@breadpudding.dev>2025-12-20 23:58:05 -0500
committerAlexander Hill <ahill@breadpudding.dev>2025-12-20 23:58:05 -0500
commite93c2168f531e65352352afe9ba590339014f5f6 (patch)
tree45ca92257afee77c48f69812f694a1e3d997e03d /sources/linux/linux.spec
parentd640c01cb14377d8a95dec1a1c5c53d83f46c334 (diff)
Made progress on building the kernel
Diffstat (limited to 'sources/linux/linux.spec')
-rwxr-xr-xsources/linux/linux.spec26
1 files changed, 26 insertions, 0 deletions
diff --git a/sources/linux/linux.spec b/sources/linux/linux.spec
index dd0b5a3..2032537 100755
--- a/sources/linux/linux.spec
+++ b/sources/linux/linux.spec
@@ -1,5 +1,31 @@
# Maintainer: Alexander Hill <ahill@breadpudding.dev>
SRC_HASH="d0a78bf3f0d12aaa10af3b5adcaed5bc767b5b78705e5ef885d5e930b72e25d5"
SRC_NAME="linux"
+SRC_PATCHES="
+5a0616535b4c04d99a3db3e8ea528e6e658fd12b11161f9dcf56f5c21a3b0e62 linux-mold.patch
+"
+SRC_REVISION=1
SRC_URL="https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.18.1.tar.xz"
SRC_VERSION="6.18.1"
+
+build() {
+ tar xf ../$SRC_FILENAME
+ cd linux-$SRC_VERSION/
+ # NOTE: Linux doesn't officially support mold, so we have to patch a couple
+ # of scripts to allow the kernel to build. ~ahill
+ patch -p1 < ../linux-mold.patch
+ # NOTE: LLVM=1 is required for ALL invocations of the kernel's Makefile. GNU
+ # tools are still used by default in a lot of places and this will
+ # override them with LLVM tools wherever possible. ~ahill
+ LLVM=1 make mrproper
+ # NOTE: YACC defaults to bison, which doesn't exist here, so we tell it
+ # where to find the parser generator manually. ~ahill
+ # NOTE: Similarly, since we aren't using LLVM's linker, we tell it to use
+ # mold manually. ~ahill
+ LLVM=1 make -j $TT_PROCS defconfig LD=mold YACC=byacc
+ LLVM=1 make -j $TT_PROCS HOSTLD=mold LD=mold YACC=byacc
+}
+
+clean() {
+ rm -rf libelf-$SRC_VERSION/
+}