From 8554b225dce2d8c38f7d9148773a231dbc7d5263 Mon Sep 17 00:00:00 2001 From: rmnscnce Date: Jun 24 2021 05:45:43 +0000 Subject: [exptl 20210624] patch top-level Makefile to always use the LLVM toolchain --- diff --git a/rpmsrc/kernel-xanmod-exptl.spec b/rpmsrc/kernel-xanmod-exptl.spec index ac158b1..9d4e62a 100644 --- a/rpmsrc/kernel-xanmod-exptl.spec +++ b/rpmsrc/kernel-xanmod-exptl.spec @@ -14,7 +14,7 @@ Version: 5.12.12 %define flaver xm1 -Release:%{flaver}.0e20210611%{?dist} +Release:%{flaver}.0e20210612%{?dist} %define rpmver %{version}-%{release} %define krelstr %{release}.%{_arch} @@ -45,6 +45,10 @@ Source6: mod-sign.sh %define __spec_install_post /usr/lib/rpm/brp-compress || : %define debug_package %{nil} Source7: rnread-%{name} + +# exptl 2021/06/22 -- patch top-level Makefile to always use the LLVM toolchain +Patch0: pagure0003-unconditionally_use_llvm.patch + Recommends: %{name}-modules BuildRequires: python3-devel clang llvm lld make perl-generators perl-interpreter openssl-devel bison flex findutils git-core perl-devel openssl elfutils-devel gawk binutils m4 tar hostname bzip2 bash gzip xz bc diffutils redhat-rpm-config net-tools elfutils patch rpm-build dwarves kmod libkcapi-hmaccalc perl-Carp rsync grubby pesign Requires: %{name}-core-%{rpmver} = %{kverstr}, %{name}-modules-%{rpmver} = %{kverstr} @@ -100,6 +104,8 @@ against the %{kverstr} kernel package. %prep %setup -q -n kernel-%{version} cp -v %{SOURCE5} certs/x509.genkey +# exptl 2021/06/22 -- patch top-level Makefile to always use the LLVM toolchain +patch ./Makefile -i %{PATCH0} %build # exptl 2021/06/11 -- use LLVM+LTO diff --git a/rpmsrc/pagure0003-unconditionally_use_llvm.patch b/rpmsrc/pagure0003-unconditionally_use_llvm.patch new file mode 100644 index 0000000..3ba3145 --- /dev/null +++ b/rpmsrc/pagure0003-unconditionally_use_llvm.patch @@ -0,0 +1,76 @@ +411a412,413 +> # workaround: unconditionally enable clang +> # /* by rmnscnce@ya.ru */ +413,414c415,416 +< HOSTCC = gcc +< HOSTCXX = g++ +--- +> HOSTCC = clang +> HOSTCXX = clang++ +436a439,440 +> # workaround: unconditionally enable clang +> # /* by rmnscnce@ya.ru */ +438,445c442,449 +< CC = $(CROSS_COMPILE)gcc +< LD = $(CROSS_COMPILE)ld +< AR = $(CROSS_COMPILE)ar +< NM = $(CROSS_COMPILE)nm +< OBJCOPY = $(CROSS_COMPILE)objcopy +< OBJDUMP = $(CROSS_COMPILE)objdump +< READELF = $(CROSS_COMPILE)readelf +< STRIP = $(CROSS_COMPILE)strip +--- +> CC = clang +> LD = ld.lld +> AR = llvm-ar +> NM = llvm-nm +> OBJCOPY = llvm-objcopy +> OBJDUMP = llvm-objdump +> READELF = llvm-readelf +> STRIP = llvm-strip +578,580c582,586 +< ifneq ($(LLVM_IAS),1) +< CLANG_FLAGS += -no-integrated-as +< endif +--- +> # workaround: unconditionally enable clang +> # /* by rmnscnce@ya.ru */ +> #ifneq ($(LLVM_IAS),1) +> #CLANG_FLAGS += -no-integrated-as +> #endif +769c775,777 +< ifdef CONFIG_CC_IS_CLANG +--- +> # workaround: unconditionally enable clang +> # /* by rmnscnce@ya.ru */ +> #ifdef CONFIG_CC_IS_CLANG # worked around +776,777c784,785 +< KBUILD_CFLAGS += -mno-global-merge +< else +--- +> #KBUILD_CFLAGS += -mno-global-merge # worked around +> #else +782,783c790,791 +< KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,) +< endif +--- +> #KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,) +> #endif +1918c1926,1928 +< ifdef CONFIG_CC_IS_CLANG +--- +> # workaround: unconditionally enable clang +> # /* by rmnscnce@ya.ru */ +> #ifdef CONFIG_CC_IS_CLANG # worked around +1924,1928c1934,1938 +< else +< clang-tidy clang-analyzer: +< @echo "$@ requires CC=clang" >&2 +< @false +< endif +--- +> #else +> #clang-tidy clang-analyzer: +> # @echo "$@ requires CC=clang" >&2 +> # @false +> #endif