Update 6.8.1 + Clang by default

This commit is contained in:
2024-03-16 13:06:18 +01:00
parent 8fae847587
commit e217406e4f
3 changed files with 127 additions and 42 deletions

View File

@ -1,12 +1,12 @@
#!/bin/bash
UPDATED="2024-03-11"
UPDATED="2024-03-16"
DISABLE=1 # disable some options
ENABLE=1 # enable some options
MITIGATIONS=0 # enable/disable all mitigations
UARCH=1 # apply more uarch patch
FKH=0 # apply fast kernel headers patch
CLANG=0 # use Clang compiler (if not, use GCC)
CLANG=1 # use Clang compiler (if not, use GCC)
O3=1 # use -O3 vs -O2 (optimisation)
ARCH="x86-64-v4" # target architecture (uarch patch)
CONFIGCLOUD=1 # enable cloud 'from' config
@ -25,9 +25,9 @@ TESTING=0 # add testing options
# config-cloud-amd64:
# https://packages.debian.org/source/sid/linux
# linux-image-6.6.9-cloud-amd64-unsigned
# linux-image-6.7.9-cloud-amd64-unsigned
# Go down to download section, select amd64 and download deb.
# Open .deb with archiver, browse to boot folder and grab 'config-6.6.9-cloud-amd64'.
# Open .deb with archiver, browse to boot folder and grab 'config-6.7.9-cloud-amd64'.
#
# more-uarches-for-kernel.patch:
@ -206,9 +206,9 @@ doCleanup() {
doEchoStep "Cleanup"
if [ "$CLANG" == "1" ]; then
make -j${NPROC} LLVM=1 CC="ccache clang" mrproper
make -j${NPROC} LLVM=1 CC="ccache clang" distclean
else
make -j${NPROC} CC="ccache gcc" mrproper
make -j${NPROC} CC="ccache gcc" distclean
fi
result=$?
if [ ! result==0 ]; then
@ -672,8 +672,6 @@ doDefaultsDisable() {
./scripts/config --disable CONFIG_VIRT_CPU_ACCOUNTING_GEN
./scripts/config --disable CONFIG_TASKSTATS
./scripts/config --disable CONFIG_PSI
./scripts/config --disable CONFIG_KALLSYMS
./scripts/config --disable CONFIG_KALLSYMS_ALL
./scripts/config --disable CONFIG_SCHED_MC
./scripts/config --disable CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS
./scripts/config --disable CONFIG_INIT_ON_ALLOC_DEFAULT_ON
@ -707,6 +705,16 @@ doDefaultsEnable() {
if [ -f .config ]; then
cp .config .config.enable.before
fi
if [ "$CLANG" == "1" ]; then
./scripts/config --enable CONFIG_HAS_LTO_CLANG
./scripts/config --enable CONFIG_ARCH_SUPPORTS_CFI_CLANG
./scripts/config --enable CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN
./scripts/config --enable CONFIG_ARCH_SUPPORTS_LTO_CLANG
./scripts/config --enable CONFIG_LTO_CLANG_THIN
./scripts/config --enable CONFIG_LTO_CLANG_FULL
fi
./scripts/config --enable CONFIG_ADDRESS_MASKING
./scripts/config --enable CONFIG_AF_KCM
./scripts/config --enable CONFIG_ARCH_CPUIDLE_HALTPOLL
@ -1093,6 +1101,8 @@ doDefaultsEnable() {
./scripts/config --enable CONFIG_IO_STRICT_DEVMEM
./scripts/config --enable CONFIG_IPV6
./scripts/config --enable CONFIG_KSM
./scripts/config --enable CONFIG_KALLSYMS
./scripts/config --enable CONFIG_KALLSYMS_ALL
./scripts/config --enable CONFIG_COMPILE_TEST
case ${ARCH} in
@ -1153,7 +1163,11 @@ doDefaults() {
doFastKernelHeaders
doEchoStep "Define options"
./scripts/config --set-str CONFIG_LOCALVERSION '-zogg'
if [ "$CLANG" == "1" ]; then
./scripts/config --set-str CONFIG_LOCALVERSION '-clang'
else
./scripts/config --set-str CONFIG_LOCALVERSION '-gcc'
fi
doDefaultsDisable
doDefaultsEnable
@ -1288,8 +1302,9 @@ doCompile() {
if [ "$CLANG" == "1" ]; then
make \
-j${NPROC} \
LLVM=1 \
LLVM=1 LLVM_IAS=1 \
CC='ccache clang' \
HOSTCC='ccache clang' \
bindeb-pkg \
LOCALVERSION=-"$(dpkg --print-architecture)" \
KDEB_PKGVERSION="$(make kernelversion)-1"