2022-11-04 16:52:02 +08:00
#+TITLE : Clear Kernel Build Error? Fix It
#+DATE : <2022-11-04 五>
#+DESCRIPTION : arch/x86/kernel/cpu/intel_epb.c:171:2: error: call to undeclared function 'sched _set_itmt_power_ratio'
2022-11-06 15:41:33 +08:00
when I compile [[https://github.com/gentoobr/overlay/tree/master/sys-kernel/clear-sources ][Clear ]] kernel with LLVM enabled, I got this error:
2022-11-04 16:52:02 +08:00
#+BEGIN_SRC text
arch/x86/kernel/cpu/intel_epb.c:172:2: error: call to undeclared function 'sched_set_itmt_power_ratio';
ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
sched_set_itmt_power_ratio(256 - val * 2, cpu);
^
arch/x86/kernel/cpu/intel_epb.c:172:2: note: did you mean 'sched_set_itmt_core_prio'?
./arch/x86/include/asm/topology.h:189:20: note: 'sched_set_itmt_core_prio' declared here
static inline void sched_set_itmt_core_prio(int prio, int core_cpu)
^
1 error generated.
#+END_SRC
2022-11-04 18:46:19 +08:00
it's obvious that the [[https://github.com/clearlinux-pkgs/linux/blob/main/0128-itmt_epb-use-epb-to-scale-itmt.patch ][sched_set_itmt_power_ratio ]] function is undeclared
so I added the following like the function on top of it
and it is able to compile :)
2022-11-04 16:52:02 +08:00
#+BEGIN_SRC diff
2022-11-04 18:46:19 +08:00
--- /home/gentoo/linux/topology.h
+++ arch/x86/include/asm/topology.h
2022-11-04 16:52:02 +08:00
@@ -189,6 +189,9 @@
static inline void sched_set_itmt_core_prio(int prio, int core_cpu)
{
}
+static inline void sched_set_itmt_power_ratio(int prio, int core_cpu)
+{
+}
static inline int sched_set_itmt_support(void)
{
return 0;
#+END_SRC
2022-11-04 18:46:19 +08:00
Notice: I'm ignorant about C programming, so if anything's wrong, please contact me