Hi all,
When doing the Yocto environment setup everything seems ot be in working order and a
bitbake core-image-sato
results in a image possible to run
runqemu qemux86
starts /poky/build/tmp/deploy/images/qemux86-64/bzImage–5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20220502165114.bin
and everything seems to be working in order so the Yocto environment setup seems to be ok.
Then when trying to build a balenaOS raspberrypi3 I have to add the following
do a git config to force https instead of git since all parts of the build script not yet seems to be updated according to githubs requirements
git config --global url.“https://”.insteadOf git://
Additional packages needed
npm, jq, liblz4-tool, zstd, docker.io
build user needs to be added to docker group
sudo usermod -aG docker $USER
But when I then run
./balena-yocto-scripts/build/barys -m raspberrypi3
I get the error below.
What might be the cause of fatal error: gmp.h: No such file or directory? Is the original error something else?
Have I missed some setup step?
ERROR: kernel-modules-headers-1.0-r0 do_compile: ExecutionError(‘/home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/temp/run.do_compile.24166’, 2, None, None)
ERROR: Logfile of failure stored in: /home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/temp/log.do_compile.24166
Log data follows:
| DEBUG: Executing shell function do_compile
| Running modules_prepare…
| make[1]: Entering directory ‘/home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/kernel_modules_headers’
| /home/jonas/balena-raspberrypi/build/tmp/work-shared/raspberrypi3/kernel-source/Makefile:645: include/config/auto.conf: No such file or directory
| /home/jonas/balena-raspberrypi/build/tmp/work-shared/raspberrypi3/kernel-source/Makefile:689: include/config/auto.conf.cmd: No such file or directory
| SYNC include/config/auto.conf.cmd
| GEN Makefile
| HOSTCC scripts/basic/fixdep
| HOSTCC scripts/kconfig/conf.o
| HOSTCC scripts/kconfig/confdata.o
| HOSTCC scripts/kconfig/expr.o
| LEX scripts/kconfig/lexer.lex.c
| YACC scripts/kconfig/parser.tab.[ch]
| HOSTCC scripts/kconfig/lexer.lex.o
| HOSTCC scripts/kconfig/parser.tab.o
| HOSTCC scripts/kconfig/preprocess.o
| HOSTCC scripts/kconfig/symbol.o
| HOSTCC scripts/kconfig/util.o
| HOSTLD scripts/kconfig/conf
| *
| * Restart config…
| *
| *
| * Kernel Features
| *
| Symmetric Multi-Processing (SMP) [Y/n/?] y
| Allow booting SMP kernel on uniprocessor systems (SMP_ON_UP) [Y/n/?] y
| Support cpu topology definition (ARM_CPU_TOPOLOGY) [Y/n/?] y
| Multi-core scheduler support (SCHED_MC) [N/y/?] n
| SMT scheduler support (SCHED_SMT) [N/y/?] n
| Architected timer support (HAVE_ARM_ARCH_TIMER) [Y/?] y
| Multi-Cluster Power Management (MCPM) [N/y/?] n
| big.LITTLE support (Experimental) (BIG_LITTLE) [N/y/?] n
| Memory split
| 1. 3G/1G user/kernel split (VMSPLIT_3G)
| 2. 3G/1G user/kernel split (for full 1G low memory) (VMSPLIT_3G_OPT)
| > 3. 2G/2G user/kernel split (VMSPLIT_2G)
| 4. 1G/3G user/kernel split (VMSPLIT_1G)
| choice[1-4?]: 3
| Maximum number of CPUs (2-32) (NR_CPUS) [4] 4
| Support for hot-pluggable CPUs (HOTPLUG_CPU) [Y/?] y
| Support for the ARM Power State Coordination Interface (PSCI) (ARM_PSCI) [N/y/?] n
| Timer frequency
| > 1. 100 Hz (HZ_100)
| 2. 200 Hz (HZ_200)
| 3. 250 Hz (HZ_250)
| 4. 300 Hz (HZ_300)
| 5. 500 Hz (HZ_500)
| 6. 1000 Hz (HZ_1000)
| choice[1-6?]: 1
| Compile the kernel in Thumb-2 mode (THUMB2_KERNEL) [N/y/?] n
| Runtime patch udiv/sdiv instructions into _aeabi{u}idiv() (ARM_PATCH_IDIV) [Y/n/?] y
| Use the ARM EABI to compile the kernel (AEABI) [Y/?] y
| Allow old ABI binaries to run with this kernel (EXPERIMENTAL) (OABI_COMPAT) [N/y/?] n
| High Memory Support (HIGHMEM) [N/y/?] n
| Enable use of CPU domains to implement privileged no-access (CPU_SW_DOMAIN_PAN) [N/y/?] n
| Use PLTs to allow module memory to spill over into vmalloc area (ARM_MODULE_PLTS) [Y/n/?] y
| Maximum zone order (FORCE_MAX_ZONEORDER) [11] 11
| Use kernel mem{cpy,set}() for {copy_to,clear}_user() (UACCESS_WITH_MEMCPY) [Y/n/?] y
| Enable paravirtualization code (PARAVIRT) [N/y/?] n
| Paravirtual steal time accounting (PARAVIRT_TIME_ACCOUNTING) [N/y/?] n
| Xen guest support on ARM (XEN) [N/y/?] n
| Use a unique stack canary value for each task (STACKPROTECTOR_PER_TASK) [Y/n/?] (NEW)
| Error in reading or end of file.
|
| *
| * GCC plugins
| *
| GCC plugins (GCC_PLUGINS) [Y/n/?] (NEW)
| Error in reading or end of file.
|
| Compute the cyclomatic complexity of a function (GCC_PLUGIN_CYC_COMPLEXITY) [N/y/?] (NEW)
| Error in reading or end of file.
|
| Generate some entropy during boot and runtime (GCC_PLUGIN_LATENT_ENTROPY) [N/y/?] (NEW)
| Error in reading or end of file.
|
| Randomize layout of sensitive kernel structures (GCC_PLUGIN_RANDSTRUCT) [N/y/?] (NEW)
| Error in reading or end of file.
|
| *
| * Memory initialization
| *
| Initialize kernel stack variables at function entry
| > 1. no automatic initialization (weakest) (INIT_STACK_NONE)
| 2. zero-init structs marked for userspace (weak) (GCC_PLUGIN_STRUCTLEAK_USER) (NEW)
| 3. zero-init structs passed by reference (strong) (GCC_PLUGIN_STRUCTLEAK_BYREF) (NEW)
| 4. zero-init anything passed by reference (very strong) (GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) (NEW)
| choice[1-4?]:
| Error in reading or end of file.
| Enable heap memory zeroing on allocation by default (INIT_ON_ALLOC_DEFAULT_ON) [N/y/?] n
| Enable heap memory zeroing on free by default (INIT_ON_FREE_DEFAULT_ON) [N/y/?] n
| GEN Makefile
| SYSHDR arch/arm/include/generated/uapi/asm/unistd-common.h
| SYSHDR arch/arm/include/generated/uapi/asm/unistd-oabi.h
| SYSHDR arch/arm/include/generated/uapi/asm/unistd-eabi.h
| HOSTCC scripts/dtc/dtc.o
| HOSTCC scripts/dtc/flattree.o
| HOSTCC scripts/dtc/fstree.o
| HOSTCC scripts/dtc/data.o
| HOSTCC scripts/dtc/livetree.o
| HOSTCC scripts/dtc/treesource.o
| HOSTCC scripts/dtc/srcpos.o
| HOSTCC scripts/dtc/checks.o
| HOSTCC scripts/dtc/util.o
| LEX scripts/dtc/dtc-lexer.lex.c
| YACC scripts/dtc/dtc-parser.tab.[ch]
| HOSTCC scripts/dtc/dtc-lexer.lex.o
| HOSTCC scripts/dtc/dtc-parser.tab.o
| HOSTLD scripts/dtc/dtc
| HOSTCXX scripts/gcc-plugins/arm_ssp_per_task_plugin.so
| In file included from /home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/…/…/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/11.2.0/plugin/include/gcc-plugin.h:28:0,
| from /home/jonas/balena-raspberrypi/build/tmp/work-shared/raspberrypi3/kernel-source/scripts/gcc-plugins/gcc-common.h:7,
| from /home/jonas/balena-raspberrypi/build/tmp/work-shared/raspberrypi3/kernel-source/scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3:
| /home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/…/…/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/11.2.0/plugin/include/system.h:698:10: fatal error: gmp.h: No such file or directory
| #include <gmp.h>
| ^~~~~~~
| compilation terminated.
| /home/jonas/balena-raspberrypi/build/tmp/work-shared/raspberrypi3/kernel-source/scripts/gcc-plugins/Makefile:47: recipe for target ‘scripts/gcc-plugins/arm_ssp_per_task_plugin.so’ failed
| make[3]: *** [scripts/gcc-plugins/arm_ssp_per_task_plugin.so] Error 1
| /home/jonas/balena-raspberrypi/build/tmp/work-shared/raspberrypi3/kernel-source/scripts/Makefile.build:497: recipe for target ‘scripts/gcc-plugins’ failed
| make[2]: *** [scripts/gcc-plugins] Error 2
| /home/jonas/balena-raspberrypi/build/tmp/work-shared/raspberrypi3/kernel-source/Makefile:1199: recipe for target ‘scripts’ failed
| make[1]: *** [scripts] Error 2
| make[1]: Leaving directory ‘/home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/kernel_modules_headers’
| Makefile:185: recipe for target ‘__sub-make’ failed
| make: *** [__sub-make] Error 2
| WARNING: exit code 2 from a shell command.
ERROR: Task (/home/jonas/balena-raspberrypi/build/…/layers/meta-balena/meta-balena-common/recipes-devtools/kernel-modules-headers/kernel-modules-headers.bb:do_compile) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 3969 tasks of which 0 didn’t need to be rerun and 1 failed.Summary: 1 task failed:
/home/jonas/balena-raspberrypi/build/…/layers/meta-balena/meta-balena-common/recipes-devtools/kernel-modules-headers/kernel-modules-headers.bb:do_compile
Summary: There were 12 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
[000006644][LOG]Build for raspberrypi3 failed. Check failed log in build/tmp/log/cooker/raspberrypi3 .
[000006644][LOG]If build for raspberrypi3 succeeded, final image should have been generated here:
[000006644][LOG] build/tmp/deploy/images/raspberrypi3/balena-image-raspberrypi3.balenaos-img
[000006644][LOG]Done.