07-11-2023, 12:06 PM
(07-11-2023, 01:12 AM)Thisone Wrote:Code:CC [M] /home/rock64/CH341SER_LINUX/driver/ch341.o
gcc: error: unrecognized command line option '-mgeneral-regs-only'
gcc: error: unrecognized command line option '-mcmodel=large'
scripts/Makefile.build:283: recipe for target '/home/rock64/CH341SER_LINUX/driver/ch341.o' failed
What version of gcc you are using? Your gcc doesn't understand the two commandline options '-mgeneral-regs-only' and '-mcmodel=large'
I'm on 6.0.0-1164-ayufan and compiling with gcc 13.1.1 that driver works like a charm:
Code:
$ make
make -C /lib/modules/6.0.0-1164-ayufan-ga2fd0c498/build M=/tmp/CH341SER_LINUX/driver
make[1]: Entering directory '/usr/src/linux-headers-6.0.0-1164-ayufan-ga2fd0c498'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: aarch64-linux-gnu-gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
You are using: aarch64-alt-linux-gcc (GCC) 13.1.1 20230613 (ALT Sisyphus 13.1.1-alt1)
CC [M] /tmp/CH341SER_LINUX/driver/ch341.o
MODPOST /tmp/CH341SER_LINUX/driver/Module.symvers
CC [M] /tmp/CH341SER_LINUX/driver/ch341.mod.o
LD [M] /tmp/CH341SER_LINUX/driver/ch341.ko
make[1]: Leaving directory '/usr/src/linux-headers-6.0.0-1164-ayufan-ga2fd0c498'
That driver loads into that kernel without complaint:
[ 152.041600] ch341: loading out-of-tree module taints kernel.
[ 152.042335] usbcore: registered new interface driver usb_ch341
[ 152.042341] ch341: USB serial driver for ch340, ch341, etc.
[ 152.042344] ch341: V1.6 On 2022.08
May be is is incompatible with the legacy kernel?