linux-headers problems compiling kernel module

This forum is for topics dealing with problems with software specifically in the ARMv7h repo.

linux-headers problems compiling kernel module

Postby krovetz » Thu Dec 08, 2016 4:01 pm

Hello,

I do cryptography research and need access to the cycle count register. Unfortunately on ARM this is privileged, so I need to install a kernel module to allow it. On ARMv7 I use this one

https://github.com/thoughtpolice/enable_arm_pmu

and on ARMv8 I use this one

https://github.com/rdolbeau/enable_arm_pmu

What I'm finding is that this goes smoothly on some alarm systems (eg, ODROID-C2), but on others I get issues with linux headers. My question is, when I get compile errors involving linux headers, is that a problem with the headers, or do I simply not know what I'm doing? If it's that I don't know what I'm doing, is there a tutorial that might help? Thanks!

Cubox:
$this->bbcode_second_pass_code('', '
[root@cubox enable_arm_pmu]# make
KMOD ko/enable_arm_pmu.ko
In file included from include/linux/compiler.h:48:0,
from include/linux/stddef.h:4,
from include/linux/posix_types.h:4,
from include/linux/types.h:17,
from include/linux/sysinfo.h:4,
from include/linux/kernel.h:4,
from /root/enable_arm_pmu/ko/enable_arm_pmu.c:4:
include/linux/compiler-gcc.h:100:30: fatal error: linux/compiler-gcc6.h: No such file or directory
#include gcc_header(__GNUC__)
^
compilation terminated.
make[3]: *** [scripts/Makefile.build:314: /root/enable_arm_pmu/ko/enable_arm_pmu.o] Error 1
make[2]: *** [Makefile:1193: _module_/root/enable_arm_pmu/ko] Error 2
make[1]: *** [Makefile:6: all] Error 2
make: *** [Makefile:10: ko/enable_arm_pmu.ko] Error 2
')

Chromebook R13:
$this->bbcode_second_pass_code('', '
a72> make
KMOD ko/enable_arm_pmu.ko
In file included from ./arch/arm64/include/asm/timex.h:19:0,
from include/linux/timex.h:65,
from include/linux/sched.h:19,
from ./arch/arm64/include/asm/compat.h:25,
from ./arch/arm64/include/asm/stat.h:23,
from include/linux/stat.h:5,
from include/linux/module.h:10,
from /home/krovetz/enable_arm_pmu_dolbeau/ko/enable_arm_pmu.c::
./arch/arm64/include/asm/arch_timer.h:28:40: fatal error: clocksource/arm_arch_timer.h: No such file or directory
#include <clocksource/arm_arch_timer.h>
^
compilation terminated.
make[3]: *** [scripts/Makefile.build:264: /home/krovetz/enable_arm_pmu_dolbeau/ko/enable_arm_pmu.o] Error 1
make[2]: *** [Makefile:1408: _module_/home/krovetz/enable_arm_pmu_dolbeau/ko] Error 2
make[1]: *** [Makefile:6: all] Error 2
make: *** [Makefile:10: ko/enable_arm_pmu.ko] Error 2
')
krovetz
 
Posts: 78
Joined: Tue Jun 26, 2012 11:03 pm

Re: linux-headers problems compiling kernel module

Postby krovetz » Thu Dec 08, 2016 6:43 pm

FYI. I saw and installed linux-armv7-cubox which brought the mainline kernel to my Marvell cubox. Removing linux-cubox-headers and installing linux-armv7-headers now allows me to compile and load the enable_arm_pmu fine.
krovetz
 
Posts: 78
Joined: Tue Jun 26, 2012 11:03 pm


Return to ARMv7h

Who is online

Users browsing this forum: No registered users and 7 guests