Error when compiling EMS usb driver

Hi,

we are trying to compile ems_usb.c from http://lxr.free-electrons.com/source/drivers/net/can/usb/ but i get the following error: gcc: error: unrecognized command line option ‘-mgeneral-regs-only’. The goal is to use the driver together with this CAN/USB interface http://ems-wuensche.com/product/datasheet/html/can-usb-adapter-converter-interface-cpcusb.html.

We think the error occurs because we are trying to compile with a 32 bit compiler while the kernel is 64 bit. We have read the following thread https://devtalk.nvidia.com/default/topic/906942/failed-to-compile-kernel-module-gcc-cannot-recognize-aarch64-option-mgeneral-regs-only-/ and made a quick try on cross-compiling but do to lack of experience and time(internship) it is probably not an option.

Has anyone else out there solved the problem? Maybe NVIDIA crew has already solved the problem? :)

Hello,
Can you install R24.1 64-bit SDK in your Jetson board and have another try?

To compile kernel module, 64-bit gcc should be used.

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/5/lto-wrapper
Target: aarch64-linux-gnu
...

Otherwise you may have to do cross-compile in host PC (still need 64-bit cross-compiler.)

br
ChenJian