martinezjavier / ldd3

Linux Device Drivers 3 examples updated to work in recent kernels
http://examples.oreilly.com/9780596005900/
Other
2.35k stars 904 forks source link

not compiling on raspberrypi 4 , help plz #66

Open yonatanbeyn opened 3 years ago

yonatanbeyn commented 3 years ago

make for n in misc-progs misc-modules skull scull scullc scullp lddbus sculld scullv shortprint simple tty pci usb sbull snull short; do make -C $n || exit 1; done make[1]: Entering directory '/home/pi/ldd3/ldd3/misc-progs' cc -O2 -fomit-frame-pointer -Wall -I/usr/src/linux-headers-5.10.17-v7l+/include inp.c -o inp inp.c:36:12: fatal error: sys/perm.h: No such file or directory

include <sys/perm.h>

        ^~~~~~~~~~~~

compilation terminated. make[1]: [: inp] Error 1 make[1]: Leaving directory '/home/pi/ldd3/ldd3/misc-progs' make: [Makefile:10: subdirs] Error 1ls

my current Linux header ===>>> linux-headers-5.10.17+ linux-headers-5.10.17-v7+ linux-headers-5.10.17-v7l+

Minoru commented 3 years ago

On my Debian testing machine, this header is in /usr/include/sys/perm.h, which is part of libc6-dev-amd64 package. Can you try installing libc6-dev package and see if this fixes the problem?

One other thing you could try is:

  1. check if you have this file in the filesystem at all: find / -name perm.h. It might print out a path like the one I mentioned above;
  2. check where the compiler looks for headers. Run cc --version to figure out what compiler you use. If it's GCC, you can do something like this to print out the list of paths. One of them should contain the path where you found the perm.h file.

Hope this helps.

dwalkes commented 2 years ago

My guess is perm.h might be x86 only? There's probably work to do to get this repository built/running on non x86 targets like RPi. Pull requests are welcome if anyone wants to take that on.