RevolutionPi / piControl

Kernel module for data exchange with RevPi I/O-Modules and Gateways
81 stars 24 forks source link

Compilation fails for 64 bit balena-OS for revpi-connect-s [REVPI-2894] #81

Closed wickywaka closed 1 year ago

wickywaka commented 1 year ago

Hello all, We are trying to make revpi connect s device an officially supported balena OS device and are working on a PR here https://github.com/balena-os/balena-raspberrypi/pull/913:

We are building a 64 bit OS image and the compilation of PiControl fails with the follow errors: Any idea on how to fix it?

ERROR: picontrol-1.0-r0 do_compile: oe_runmake failed
ERROR: picontrol-1.0-r0 do_compile: ExecutionError('/home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/temp/run.do_compile.2088370', 1, None, None)
ERROR: Logfile of failure stored in: /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/temp/log.do_compile.2088370
Log data follows:
| DEBUG: Executing shell function do_compile  
| NOTE: make -j 8 KERNEL_SRC=/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source KDIR=/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source K
ERNEL_PATH=/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source KERNEL_VERSION=5.10.120-rt70-v8 CC=aarch64-poky-linux-gcc   -fuse-ld=bfd -fmacro-prefix-map=/home/ubuntu/bal
ena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0=/usr/src/debug/picontrol/1.0-r0                      -fdebug-prefix-map=/home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_con
nect_s-poky-linux/picontrol/1.0-r0=/usr/src/debug/picontrol/1.0-r0                      -fdebug-prefix-map=/home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/recip
e-sysroot=                      -fdebug-prefix-map=/home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/recipe-sysroot-native=  -fdebug-prefix-map=/home/ubuntu/balen
a-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source=/usr/src/kernel -fdebug-prefix-map=/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-build-artifacts=/usr/src/
kernel LD=aarch64-poky-linux-ld.bfd   AR=aarch64-poky-linux-ar  O=/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-build-artifacts KBUILD_EXTRA_SYMBOLS=
| echo "#define COMPILETIME \""`date`"\"" > compiletime.h
| make ARCH=arm CROSS_COMPILE="aarch64-poky-linux- arm-linux-gnueabihf-" -C /home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source M=/home/ubuntu/balena-raspberrypi/build/tmp
/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git  modules
| make[1]: Entering directory '/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source'
| make[2]: Entering directory '/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-build-artifacts'
|   CC [M]  /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/piControlMain.o
|   CC [M]  /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/piIOComm.o
| aarch64-poky-linux-gcc: error: unrecognized argument in option '-mabi=apcs-gnu'
| aarch64-poky-linux-gcc: note: valid arguments to '-mabi=' are: ilp32 lp64
|   CC [M]  /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/piDIOComm.o
| aarch64-poky-linux-gcc: error: unrecognized argument in option '-mabi=apcs-gnu'
| aarch64-poky-linux-gcc: note: valid arguments to '-mabi=' are: ilp32 lp64
|   CC [M]  /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/piAIOComm.o
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mapcs'
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mapcs'
|   CC [M]  /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/RevPiDevice.o
| aarch64-poky-linux-gcc: error: unrecognized argument in option '-mabi=apcs-gnu'
| aarch64-poky-linux-gcc: note: valid arguments to '-mabi=' are: ilp32 lp64
| aarch64-poky-linux-gcc: error: unrecognized argument in option '-mabi=apcs-gnu'
| aarch64-poky-linux-gcc: note: valid arguments to '-mabi=' are: ilp32 lp64
|   CC [M]  /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/json.o
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mapcs'
| aarch64-poky-linux-gcc: error: unrecognized argument in option '-mabi=apcs-gnu'
| aarch64-poky-linux-gcc: note: valid arguments to '-mabi=' are: ilp32 lp64
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mapcs'
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mapcs'
| aarch64-poky-linux-gcc: error: unrecognized argument in option '-mabi=apcs-gnu'
| aarch64-poky-linux-gcc: note: valid arguments to '-mabi=' are: ilp32 lp64
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mapcs'
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mno-sched-prolog'
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mno-sched-prolog'
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mno-sched-prolog'
|   CC [M]  /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/piConfig.o
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-msoft-float'
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mno-sched-prolog'
| aarch64-poky-linux-gcc: error: unrecognized argument in option '-mabi=apcs-gnu'
| aarch64-poky-linux-gcc: note: valid arguments to '-mabi=' are: ilp32 lp64
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-msoft-float'
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mno-sched-prolog'
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mapcs'
| make[3]: *** [/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source/scripts/Makefile.build:287: /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/piControlMain.o] Error 1  
| make[3]: *** Waiting for unfinished jobs....
| make[3]: *** [/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source/scripts/Makefile.build:287: /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/piIOComm.o] Error 1
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mno-sched-prolog'
|   CC [M]  /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/RS485FwuCommand.o
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-msoft-float'
| make[3]: *** [/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source/scripts/Makefile.build:287: /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/RevPiDevice.o] Error 1
| aarch64-poky-linux-gcc: error: unrecognized argument in option '-mabi=apcs-gnu'
| aarch64-poky-linux-gcc: note: valid arguments to '-mabi=' are: ilp32 lp64
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-msoft-float'
| make[3]: *** [/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source/scripts/Makefile.build:287: /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/piAIOComm.o] Error 1
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-msoft-float'
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mapcs'
| make[3]: *** [/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source/scripts/Makefile.build:287: /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/piDIOComm.o] Error 1
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-msoft-float'
| make[3]: *** [/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source/scripts/Makefile.build:287: /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/json.o] Error 1
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mno-sched-prolog'
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-msoft-float'
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-mno-sched-prolog'
| make[3]: *** [/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source/scripts/Makefile.build:287: /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/piConfig.o] Error 1
| aarch64-poky-linux-gcc: error: unrecognized command-line option '-msoft-float'
| make[3]: *** [/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source/scripts/Makefile.build:287: /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git/RS485FwuCommand.o] Error 1
| make[2]: *** [/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source/Makefile:1846: /home/ubuntu/balena-raspberrypi/build/tmp/work/revpi_connect_s-poky-linux/picontrol/1.0-r0/git] Error 2
| make[2]: Leaving directory '/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-build-artifacts'
| make[1]: Leaving directory '/home/ubuntu/balena-raspberrypi/build/tmp/work-shared/revpi-connect-s/kernel-source'
| make[1]: *** [Makefile:185: __sub-make] Error 2
| make: *** [Makefile:44: all] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.  
ERROR: Task (/home/ubuntu/balena-raspberrypi/build/../layers/meta-balena-raspberrypi/recipes-kernel/picontrol/picontrol.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 4385 tasks of which 4376 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/ubuntu/balena-raspberrypi/build/../layers/meta-balena-raspberrypi/recipes-kernel/picontrol/picontrol.bb:do_compile
Summary: There were 2 ERROR messages, returning a non-zero exit code.
[000000057][LOG]Build for revpi-connect-s failed. Check failed log in build/tmp/log/cooker/revpi-connect-s .
[000000057][LOG]If build for revpi-connect-s succeeded, final image should have been generated here:
[000000057][LOG]   build/tmp/deploy/images/revpi-connect-s/balena-image-revpi-connect-s.balenaos-img
[000000057][LOG]Done.
nbuchwitz commented 1 year ago

You're mixing up armhf and arm64 builds: make ARCH=arm CROSS_COMPILE="aarch64-poky-linux- arm-linux-gnueabihf-"

iluminat23 commented 1 year ago

This is a bug in the piControl Makefile.

ifeq ($(ARCH), arm)
    CROSS_COMPILE += arm-linux-gnueabihf-
else
    CROSS_COMPILE += aarch64-linux-gnu-
endif

CROSS_COMPILE is expanded with arm-linux-gnueabihf- or aarch64-linux-gnu- which doesn't make any sense at all. Setting CROSS_COMPILE in the Makefile is a really bad idea and breaks any decent build system.

wickywaka commented 1 year ago

How do you suggest we fix it?

iluminat23 commented 1 year ago

We need to fix the Makefile here in the repo, I will create a task in our internal ticket system. I think we will need to fix our kernelbakery as well.

nbuchwitz commented 1 year ago

@wickywaka fixed this in current master. Please test again and make sure that your buildsystem sets ARCH and CROSS_COMPILE correctly.

iluminat23 commented 1 year ago

We hope this issue is fixed with https://github.com/RevolutionPi/piControl/pull/82

nbuchwitz commented 1 year ago

Do you have an update @wickywaka ?

wickywaka commented 1 year ago

The new changes have fixed this issue.

On Thu, Feb 9, 2023, 00:28 Nicolai @.***> wrote:

Do you have an update @wickywaka https://github.com/wickywaka ?

— Reply to this email directly, view it on GitHub https://github.com/RevolutionPi/piControl/issues/81#issuecomment-1423130980, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVDYA2AHL3NTA7IIWZC4E3WWPXWDANCNFSM6AAAAAAUFHEDL4 . You are receiving this because you were mentioned.Message ID: @.***>