gcc error when try to make peak-linux-driver-8.16.0

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
liangwang1982
Posts: 6
Joined: Tue 9. May 2023, 20:28

gcc error when try to make peak-linux-driver-8.16.0

Post by liangwang1982 » Tue 9. May 2023, 20:34

make[1]: Entering directory '/home/liangwang/Downloads/peak-linux-driver-8.16.0/driver'
***
*** Making pcan driver in chardev mode
***
*** Host OS Release=Pop!_OS v22.04
*** Host machine kernel version=6.2.6-76060206-generic
*** Driver kernel version=6.2.6-76060206-generic (6.2.6)
*** Path to kernel sources=/usr/src/linux-headers-6.2.6-76060206-generic
*** use KBUILD=yes
*** use DKMS=
*** gcc version=11
***
make -C /usr/src/linux-headers-6.2.6-76060206-generic EXTRA_CFLAGS="-I/home/liangwang/Downloads/peak-linux-driver-8.16.0/driver -DNO_DEBUG -DMODVERSIONS -DNO_PARPORT_SUBSYSTEM -DUSB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DISA_SUPPORT -DNO_DONGLE_SUPPORT -DNO_PCCARD_SUPPORT -DNO_NETDEV_SUPPORT -DNO_RT -Wno-date-time" V=0 modules M=/home/liangwang/Downloads/peak-linux-driver-8.16.0/driver
make[2]: Entering directory '/usr/src/linux-headers-6.2.6-76060206-generic'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0
You are using: gcc-12 (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0
CC [M] /home/liangwang/Downloads/peak-linux-driver-8.16.0/driver/src/pcan_main.o
gcc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:252: /home/liangwang/Downloads/peak-linux-driver-8.16.0/driver/src/pcan_main.o] Error 1
make[2]: *** [Makefile:2021: /home/liangwang/Downloads/peak-linux-driver-8.16.0/driver] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-6.2.6-76060206-generic'
make[1]: *** [Makefile:523: all] Error 2
make[1]: Leaving directory '/home/liangwang/Downloads/peak-linux-driver-8.16.0/driver'
make: *** [Makefile:84: all] Error 2

M.Maidhof
Support
Support
Posts: 1751
Joined: Wed 22. Sep 2010, 14:00

Re: gcc error when try to make peak-linux-driver-8.16.0

Post by M.Maidhof » Wed 10. May 2023, 09:41

Hello,

which PEAK hardware are you using? Please post a picture of the device. Please also post the output of uname -a

regards

Michael

liangwang1982
Posts: 6
Joined: Tue 9. May 2023, 20:28

Re: gcc error when try to make peak-linux-driver-8.16.0

Post by liangwang1982 » Mon 15. May 2023, 20:02

Hi Michael,

Sorry for the delayed response.

I am using the PEAK-USB (https://www.peak-system.com/PCAN-USB.199.0.html?&L=1)

And the output of uname -a is
Linux pop-os 6.2.6-76060206-generic #202303130630~1683753207~22.04~77c1465 SMP PREEMPT_DYNAMIC Wed M x86_64 x86_64 x86_64 GNU/Linux

Thanks
Liang

liangwang1982
Posts: 6
Joined: Tue 9. May 2023, 20:28

Re: gcc error when try to make peak-linux-driver-8.16.0

Post by liangwang1982 » Mon 15. May 2023, 20:07

(base) liangwang@pop-os:~$ uname -a
Linux pop-os 6.2.6-76060206-generic #202303130630~1683753207~22.04~77c1465 SMP PREEMPT_DYNAMIC Wed M x86_64 x86_64 x86_64 GNU/Linux

(base) liangwang@pop-os:~$ grep PEAK_ /boot/config-`uname -r`
CONFIG_CAN_PEAK_PCIEFD=m
CONFIG_CAN_PEAK_PCI=m
CONFIG_CAN_PEAK_PCIEC=y
CONFIG_CAN_PEAK_PCMCIA=m
CONFIG_CAN_PEAK_USB=m

(base) liangwang@pop-os:~$ lsmod | grep ^peak
peak_usb 61440 0
Attachments
MicrosoftTeams-image (8).png
MicrosoftTeams-image (8).png (62.74 KiB) Viewed 40772 times

M.Maidhof
Support
Support
Posts: 1751
Joined: Wed 22. Sep 2010, 14:00

Re: gcc error when try to make peak-linux-driver-8.16.0

Post by M.Maidhof » Tue 16. May 2023, 09:41

Hi,

do you like to use the SocketCAN driver or do you want to use the chardev interface? If you want to use the SocketCAN interface, there is no need to install our peak-linux-driver on that system. The kernel already has the driver for the PCAN-USB available as module.

regards

Michael

liangwang1982
Posts: 6
Joined: Tue 9. May 2023, 20:28

Re: gcc error when try to make peak-linux-driver-8.16.0

Post by liangwang1982 » Tue 20. Jun 2023, 01:25

It would be nice to use the chardev interface to access the Peak-related CAN libraries. The SocketCAN seems to be very low-level, hard to use, and without any wrapper. Thanks

M.Maidhof
Support
Support
Posts: 1751
Joined: Wed 22. Sep 2010, 14:00

Re: gcc error when try to make peak-linux-driver-8.16.0

Post by M.Maidhof » Tue 20. Jun 2023, 12:08

Hi,

ok, which Linux distro do you use?

regards

Michael

liangwang1982
Posts: 6
Joined: Tue 9. May 2023, 20:28

Re: gcc error when try to make peak-linux-driver-8.16.0

Post by liangwang1982 » Thu 22. Jun 2023, 00:58

DISTRIB_ID=Pop
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Pop!_OS 22.04 LTS"
NAME="Pop!_OS"
VERSION="22.04 LTS"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 22.04 LTS"
VERSION_ID="22.04"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=jammy
UBUNTU_CODENAME=jammy
LOGO=distributor-logo-pop-os

liangwang1982
Posts: 6
Joined: Tue 9. May 2023, 20:28

Re: gcc error when try to make peak-linux-driver-8.16.0

Post by liangwang1982 » Thu 22. Jun 2023, 01:00

Static hostname: pop-os
Icon name: computer-laptop
Chassis: laptop
Machine ID: 78d497bfecc4f0a85e102be0640100c4
Boot ID: ee3285db3e9d4c6691b193f22af056f8
Operating System: Pop!_OS 22.04 LTS
Kernel: Linux 6.2.6-76060206-generic
Architecture: x86-64
Hardware Vendor: Dell Inc.
Hardware Model: Precision 5570

User avatar
S.Grosjean
Software Development
Software Development
Posts: 357
Joined: Wed 4. Jul 2012, 17:02

Re: gcc error when try to make peak-linux-driver-8.16.0

Post by S.Grosjean » Thu 22. Jun 2023, 11:09

Hello,

This error is an error that comes when installing a to recent kernel. As said, you're running gcc v11 but the kernel Makefile makes usage of a gcc v12 option.

I would suggest you to install gcc v12 first.

Regards,
— Stéphane

Post Reply