diff --git a/0008-x86_energy_perf_policy-clang-compile-support.patch b/0008-x86_energy_perf_policy-clang-compile-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..6a59bbf714c4c52179c225019560cfbc4e51b350 --- /dev/null +++ b/0008-x86_energy_perf_policy-clang-compile-support.patch @@ -0,0 +1,24 @@ +From b52db4e09378e62cf785644344aeb36cad0db406 Mon Sep 17 00:00:00 2001 +From: liyunfei +Date: Wed, 21 Jun 2023 14:38:15 +0800 +Subject: [PATCH] x86_energy_perf_policy clang compile support + +--- + tools/power/x86/x86_energy_perf_policy/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/power/x86/x86_energy_perf_policy/Makefile b/tools/power/x86/x86_energy_perf_policy/Makefile +index 666b325a6..86702c2e5 100644 +--- a/tools/power/x86/x86_energy_perf_policy/Makefile ++++ b/tools/power/x86/x86_energy_perf_policy/Makefile +@@ -1,5 +1,5 @@ + # SPDX-License-Identifier: GPL-2.0 +-CC = $(CROSS_COMPILE)gcc ++CC ?= $(CROSS_COMPILE)gcc + BUILD_OUTPUT := $(CURDIR) + PREFIX := /usr + DESTDIR := +-- +2.28.0.windows.1 + + diff --git a/0009-turbostat-clang-compile-support.patch b/0009-turbostat-clang-compile-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..890442d4aa087e648bb6dee488e10748a725aab5 --- /dev/null +++ b/0009-turbostat-clang-compile-support.patch @@ -0,0 +1,23 @@ +From 2265f8fd13fc3b425b5249d3461b4d687bb1229d Mon Sep 17 00:00:00 2001 +From: liyunfei +Date: Sun, 25 Jun 2023 09:20:20 +0800 +Subject: [PATCH] turbostat clang compile support + +--- + tools/power/x86/turbostat/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/power/x86/turbostat/Makefile b/tools/power/x86/turbostat/Makefile +index 92e139b9c..6a2523ad7 100644 +--- a/tools/power/x86/turbostat/Makefile ++++ b/tools/power/x86/turbostat/Makefile +@@ -1,5 +1,5 @@ + # SPDX-License-Identifier: GPL-2.0 +-CC = $(CROSS_COMPILE)gcc ++CC ?= $(CROSS_COMPILE)gcc + BUILD_OUTPUT := $(CURDIR) + PREFIX ?= /usr + DESTDIR ?= +-- +2.28.0.windows.1 + diff --git a/kernel.spec b/kernel.spec index 8c7defc42ac02cf870f3eab9648804afe8dd4099..fe393edcff13059f866e747a9cc63dab41df3f78 100644 --- a/kernel.spec +++ b/kernel.spec @@ -77,6 +77,8 @@ Patch0004: 0004-config-disable-CONFIG_EFI_ZBOOT-by-default.patch Patch0005: 0005-arm64-vmalloc-use-module-region-only-for-module_allo.patch Patch0006: 0006-config-add-initial-openeuler_defconfig-for-riscv64.patch Patch0007: 0007-cpupower-clang-compile-support.patch +Patch0008: 0008-x86_energy_perf_policy-clang-compile-support.patch +Patch0009: 0009-turbostat-clang-compile-support.patch #BuildRequires: BuildRequires: module-init-tools, patch >= 2.5.4, bash >= 2.03, tar @@ -308,6 +310,8 @@ Applypatches series.conf %{_builddir}/kernel-%{version}/linux-%{KernelVer} %patch0005 -p1 %patch0006 -p1 %patch0007 -p1 +%patch0008 -p1 +%patch0009 -p1 touch .scmversion find . \( -name "*.orig" -o -name "*~" \) -exec rm -f {} \; >/dev/null @@ -372,7 +376,7 @@ make %{Clang_Make_Option} ARCH=%{Arch} modules %{?_smp_mflags} # perf %if "%toolchain" == "clang" %global perf_make \ - make %{Clang_Make_Option} EXTRA_CFLAGS="-g -Wall -fstack-protector-strong -fPIC" EXTRA_PERFLIBS="-fpie -pie" %{?_smp_mflags} -s V=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_LIBNUMA=1 NO_STRLCPY=1 prefix=%{_prefix} + make %{Clang_Make_Option} EXTRA_CFLAGS="-g -Wall -fstack-protector-strong -fPIC" EXTRA_LDFLAGS="-z now" EXTRA_PERFLIBS="-fpie -pie" %{?_smp_mflags} -s V=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_LIBNUMA=1 NO_STRLCPY=1 prefix=%{_prefix} %else %global perf_make \ make EXTRA_CFLAGS="-Wl,-z,now -g -Wall -fstack-protector-strong -fPIC" EXTRA_PERFLIBS="-fpie -pie" %{?_smp_mflags} -s V=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_LIBNUMA=1 NO_STRLCPY=1 prefix=%{_prefix} @@ -899,7 +903,7 @@ fi %endif %changelog -* Tue Jul 20 2023 liyunfei - 6.1.8-3.0.0.9 +* Sun Jul 25 2023 liyunfei - 6.1.8-3.0.0.9 - add clang compile support * Thu May 25 2023 laokz - 6.1.8-3.0.0.8