lucidm / lcdi2c

Linux Kernel Module for HD44780 with I2C Expander
Other
21 stars 18 forks source link

Installation fails on a raspberry pi 3b+ #3

Open mibcat opened 5 years ago

mibcat commented 5 years ago

I'm trying to install your lcdi2c driver on a raspberry pi 3b+ but the installation fails at

sudo dkms build -m lcdi2c -v 1.0.1

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...(bad exit status: 2)
make -j4 KERNELRELEASE=4.19.42-v7+ -C /lib/modules/4.19.42-v7+/build M=/var/lib/dkms/lcdi2c/1.0.1/build...(bad exit status: 2)
Error! Bad return status for module build on kernel: 4.19.42-v7+ (armv7l)
Consult /var/lib/dkms/lcdi2c/1.0.1/build/make.log for more information.

Logfile: cat /var/lib/dkms/lcdi2c/1.0.1/build/make.log

DKMS make.log for lcdi2c-1.0.1 for kernel 4.19.42-v7+ (armv7l)
Mon 10 Jun 16:17:48 UTC 2019
make: Entering directory '/usr/src/linux-headers-4.19.42-v7+'
scripts/Makefile.build:45: /var/lib/dkms/lcdi2c/1.0.1/build/Makefile: No such file or directory
make[1]: *** No rule to make target '/var/lib/dkms/lcdi2c/1.0.1/build/Makefile'.  Stop.
Makefile:1524: recipe for target '_module_/var/lib/dkms/lcdi2c/1.0.1/build' failed
make: *** [_module_/var/lib/dkms/lcdi2c/1.0.1/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.19.42-v7+'

System info

lsb_release -a

No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 9.9 (stretch)
Release:    9.9
Codename:   stretch

uname --all

Linux raspi3bplus 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l GNU/Linux

apt list --installed |grep headers

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

linux-headers-3.6-trunk-common/stable,now 3.6.9-1~experimental.1+rpi7 armhf [installed,automatic]
linux-headers-3.6-trunk-rpi/stable,now 3.6.9-1~experimental.1+rpi7 armhf [installed,automatic]
raspberrypi-kernel-headers/stable,now 1.20190517-1 armhf [installed]

Any guesses whats going wrong here ?

Thanks, Michael.

lucidm commented 5 years ago

Thanks pointing that out. Yes, makefile was missing. Brought it back.

mibcat commented 5 years ago

Thanks for fixing.

But the build now stops due to a non supported compiler option: gcc: error: unrecognized command line option ‘-fstack-protector-strong’

I've found this hint in an other thread:

-fstack-protector-strong was merged into GCC version 4.9; 4.8.x does not support it. upgrade GCC or use -fstack-protector-all or -fstack-protector.

Rasbian uses an old gcc version: gcc --version gcc (Raspbian 4.7.3-11+rpi1) 4.7.3 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Don't know if this is the right approach, but I found the compiler flag settings in the Makefile of the used kernel header sources and set them to stack-protector-all

in file /usr/src/linux-headers-4.19.42-v7+/Makefile replace stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG) := -fstack-protector-strong by stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG) := -fstack-protector-all

Now the build runs fine and the driver is working ...