cyring / CoreFreq

CoreFreq : CPU monitoring and tuning software designed for 64-bit processors.
https://www.cyring.fr
GNU General Public License v2.0
1.97k stars 126 forks source link

Kernel module build failure: error: ‘struct <anonymous>’ has no member named ‘ResumeFromSuspend’ #383

Closed ganto closed 1 year ago

ganto commented 1 year ago

When I try to build CoreFreq (release 1.93.1 or current master) on a Gentoo machine against kernel 6.1.1 it fails with:

make -j1 -C /lib/modules/6.1.1-gentoo/build M=/var/tmp/portage/sys-apps/corefreq-1.93.1/work/CoreFreq-1.93.1 modules
make[1]: warning: -j1 forced in submake: resetting jobserver mode.
make[1]: Entering directory '/usr/src/linux-6.1.1-gentoo'
  CC [M]  /var/tmp/portage/sys-apps/corefreq-1.93.1/work/CoreFreq-1.93.1/corefreqk.o
/var/tmp/portage/sys-apps/corefreq-1.93.1/work/CoreFreq-1.93.1/corefreqk.c: In function ‘CoreFreqK_HotPlug_CPU_Online’:
/var/tmp/portage/sys-apps/corefreq-1.93.1/work/CoreFreq-1.93.1/corefreqk.c:21795:17: error: ‘struct <anonymous>’ has no member named ‘ResumeFromSuspend’
21795 |    if (CoreFreqK.ResumeFromSuspend == false)
      |                 ^
compilation terminated due to -Wfatal-errors.
make[2]: *** [scripts/Makefile.build:250: /var/tmp/portage/sys-apps/corefreq-1.93.1/work/CoreFreq-1.93.1/corefreqk.o] Error 1
make[1]: *** [Makefile:1992: /var/tmp/portage/sys-apps/corefreq-1.93.1/work/CoreFreq-1.93.1] Error 2

System:

cyring commented 1 year ago

Sorry for that bug. Until I fix it, please build your kernel with CONFIG_PM_SLEEP

cyring commented 1 year ago

To reproduce your issue, I'm removing any SUSPEND, HIBERNATE features and others dependencies found (remove XEN, but keep ACPI)

EDIT: second attempt to build a PM_SLEEP free kernel

2022-12-25-045305_642x427_scrot

Now rebooting that kernel ...

EDIT: Issue reproduced

corefreqk.c:22098:17: error: ‘struct <anonymous>’ has no member named ‘ResumeFromSuspend’
22098 |    if (CoreFreqK.ResumeFromSuspend == false)
cyring commented 1 year ago

Please pull, build and run CoreFreq from the develop branch (until the fix gets merged into master).

ganto commented 1 year ago

Sorry, I might not have the most standard kernel configuration. Thanks a lot for the quick fix. Works perfectly fine now.

You can find some quickly done ebuilds in my overlay at sys-apps/corefreq and sys-apps/corefreq-kmod. For the module build I needed to add a separate make target (1.93.1-Add-separate-target-to-build-kernel-module.patch). Maybe you can also add this to your Makefile?

cyring commented 1 year ago

Sorry, I might not have the most standard kernel configuration. Thanks a lot for the quick fix. Works perfectly fine now.

You can find some quickly done ebuilds in my overlay at sys-apps/corefreq and sys-apps/corefreq-kmod. For the module build I needed to add a separate make target (1.93.1-Add-separate-target-to-build-kernel-module.patch). Maybe you can also add this to your Makefile?

Thanks a lot for your contribution.

I'm thinking about referencing your ebuild either as an external git sub-project or to mention a link in the Readme.md within a gentoo section : the goal in any case is to let you maintain the packaging. Second choice is the easiest for me but Some don't read docs ...

I want to help with 1.93.1-Add-separate-target-to-build-kernel-module.patch and my understanding is that the module keyword makes the difference. Non regression has to be done on all distributions: ArchLinux, Opensuse, Unraid, Redhat(s), Debian(s), ClearLinux, in addition to Gentoo; from v3 to v6 kernels If Makefile fails then project becomes a brick ...

cyring commented 1 year ago

Please feel free to come back here if you have an issue.