ibisum Posted August 5, 2020 Posted August 5, 2020 I've built Armbian for my purposes with the following build settings: ./compile.sh BOARD="bananapi" BRANCH="current" RELEASE="focal" \ KERNEL_ONLY="no" KERNEL_CONFIGURE="no" BUILD_DESKTOP="no" EXTERNAL="yes" \ INSTALL_HEADERS="yes" .. and the board boots from the resulting image just fine, and seems to be running well. Now, I want to clone a repo onto this board, and use the ONBOARD compiler for development purposes .. I'm doing some CAN development, and I want to use SocketCan (https://github.com/jackthompsonnz/socketcan-linux-5.0.git) which is a kernel module for gaining access to a USB-CAN adapter. So I connect to it, clone the SocketCan Repo and get a message like this: mcp@mcp:~/CANDevelopment/third/socketcan-linux-5.0$ make make -C /lib/modules/5.7.11-sunxi/build M=/home/mcp/CANDevelopment/third/socketcan-linux-5.0/usb-to-can_socketcan modules make[1]: Entering directory '/usr/src/linux-headers-5.7.11-sunxi' CC [M] /home/mcp/CANDevelopment/third/socketcan-linux-5.0/usb-to-can_socketcan/ixx_usb_v2.o In file included from /home/mcp/CANDevelopment/third/socketcan-linux-5.0/usb-to-can_socketcan/ixx_usb_v2.c:32: /home/mcp/CANDevelopment/third/socketcan-linux-5.0/usb-to-can_socketcan/ixx_usb_core.h:196:24: error: field ‘tv_host_0’ has incomplete type 196 | struct timeval tv_host_0; | ^~~~~~~~~ make[2]: *** [scripts/Makefile.build:267: /home/mcp/CANDevelopment/third/socketcan-linux-5.0/usb-to-can_socketcan/ixx_usb_v2.o] Error 1 make[1]: *** [Makefile:1734: /home/mcp/CANDevelopment/third/socketcan-linux-5.0/usb-to-can_socketcan] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-5.7.11-sunxi' make: *** [Makefile:4: ixx_usb] Error 2 .. which implies that the compiler (onboard) is not using its own sysroot in order to pick up the basic types (such as is in sys/time.h) .. so I add "-isystem /usr/include/arm-linux-gnueabihf/sys" to the flags, and things build again .. The question is, how do I 'properly' tell Armbian's build process to include the right sysroot configuration in the compiler by default - I don't really want to have to add the -isystem flag to every repo I clone for building on this board - there has to be some missing step in the setup of the Armbian build image to result in this compiler not being functional .. perhaps I missed a step? FWIW, I verified that the linux-headers package for my board (sunxi - bananapi) is installed, and works .. and if I add '-isystem /usr/include/arm-linux-gnueabihf/sys' to everything the compiler seems to function just fine. Did I skip a missing "link files" step somewhere, or anyone got any other clues? Where possible I'd like to use Armbian with as few 'hacks/fixups' as possible, and maybe this is just me missing something obvious in the build setup ..
Werner Posted August 6, 2020 Posted August 6, 2020 I cannot tell you how exactly to implement this but I can tell you where to put things to get them into your ready-to-burn image: https://docs.armbian.com/Developer-Guide_User-Configurations/#user-provided-image-customization-script
Recommended Posts