| Summary: | Meson compiler build failures for mips/octeon2. | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] Meta-yocto | Reporter: | mabnhdev |
| Component: | meta-yocto | Assignee: | Unassigned <unassigned> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | mabnhdev, pavel, poky.bs.watcher, poky.watcher, raj.khem, randy.macleod |
| Version: | 4.0.7 | ||
| Target Milestone: | 4.2 M3 | ||
| Hardware: | Other | ||
| OS: | mips | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
| Attachments: | |||
Created attachment 4921 [details]
Full build failure log.
Created attachment 4922 [details]
Bash script to reproduce the problem. Run with no arguments.
Not many members of the Yocto community are using octeon so this is unassigned. What branch is this happening on? See question in previous comment. This is happening in 4.0.7 - branch Kirkstone. The attached script will reproduce the problem in Kirkstone. I understand octeon is not a heavily used architecture. I'm hoping that it is an easy fix for mips in general. I'm not sure but I think Khem still has need of mips so I've CCed him. Can you post meson.cross which is being used ? secondly, are you seeing this issue with qemumips ? thirdly. does it happen with trunk too ? No, this does not happen with qemumips. To try yourself, just change Line #28 in the repro script to 'MACHINE = "qemumips"'. (In reply to comment #9) > No, this does not happen with qemumips. > > To try yourself, just change Line #28 in the repro script to 'MACHINE = > "qemumips"'. I know, I can do it. Since you have this reproduced and perhaps files are handy it is faster to get to it. Thats why I asked for uploading meson.cross file from builddir of failing component. Same failure with the octeon-o32 in HEAD also. BB_VERSION = "2.2.0" BUILD_SYS = "x86_64-linux" NATIVELSBSTRING = "ubuntu-22.04" TARGET_SYS = "mips-poky-linux" MACHINE = "my-meson-repro" DISTRO = "poky" DISTRO_VERSION = "4.1+snapshot-61c35514cfd27dda045735695f8960126e0704b5" TUNE_FEATURES = "o32 bigendian fpu-hard octeon2" TARGET_FPU = "" meta meta-poky meta-yocto-bsp = "master:61c35514cfd27dda045735695f8960126e0704b5" meta-meson-repro = "<unknown>:<unknown>" | ../xorgproto-2022.2/meson.build:22:0: ERROR: Executables created by c compiler mips-poky-linux-gcc -meb -mabi=32 -mhard-float -march=octeon2 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/mabnhdev/meson-repro/build/tmp/work/octeon2-o32-poky-linux/xorgproto/2022.2-r0/recipe-sysroot are not runnable. Created attachment 4928 [details]
meson.cross as requested
This is from the HEAD rather than Kirkstone, but they both fail the same way, so I assume this is sufficient.
(In reply to comment #12) > Created attachment 4928 [details] > meson.cross as requested > > This is from the HEAD rather than Kirkstone, but they both fail the same > way, so I assume this is sufficient. Thanks meson.cross is fine, so I think the generated binaries are being run in qemu-user and its not able to run it because they contain some octeon specific instruction which is it not emulating. Can you also upload followinf two files. /home/mabnhdev/meson-repro-mips/build/tmp/work/octeon2-o32-poky-linux/xorgproto/2021.5-r0/meson-qemuwrapper /home/mabnhdev/meson-repro-mips/build/tmp/work/octeon2-o32-poky-linux/xorgproto/2021.5-r0/build/meson-private/sanitycheckc_cross.exe qemumips o32 does not support any octeon emulation instructions and most probably thats whats going on here becasue I see -march=octeon2 is in the compile cmdline. So any qemu usermode invocation is likely to fail. So one of two things can be done.
1. Add something like below to the octeon2 tune file.
MACHINE_FEATURES_BACKFILL_CONSIDERED:append = "${@bb.utils.contains('TUNE_FEATURES', 'octeon2', ' qemu-usermode', '', d)}"
2. Remove -march=octeon2 from tune file.
For 64bit octeon builds try adding
QEMU_EXTRAOPTIONS_octeon2 = " -cpu Octeon68XX"
to ./meta/classes-recipe/qemu.bbclass
> 1. Add something like below to the octeon2 tune file.
MACHINE_FEATURES_BACKFILL_CONSIDERED:append = "${@bb.utils.contains('TUNE_FEATURES', 'octeon2', ' qemu-usermode', '', d)}"
Your first suggestion works for me - I can now complete the build of my mips/octeon2 platform with no errors. Thanks!
I'm not really knowledgeable about QEMU - would you mind giving me a brief explanation as to why this worked?
As far as I'm concerned, I consider this issue resolved. I'll leave it to the PTB as to whether, from a project point of view, there is any further action needed. Thanks to Khem, the reporter has a work-around and unless someone funds more complete emulation of octeon2 in qemu, there's nothing else to be done so marking as resolved. |
Created attachment 4920 [details] Bash shell used to reproduce the failure. 'meson-repro.sh mips' When cross-compiling for octeon2 (mips), the meson compiler fails to compile components with the error 'Executables created by c compiler ... are not runnable'. I've included a bash script that can be used to reproduce the errors and the full log of the build failure. Run the script using the command 'meson-repro.sh mips'. Build Configuration: BB_VERSION = "2.0.0" BUILD_SYS = "x86_64-linux" NATIVELSBSTRING = "ubuntu-22.04" TARGET_SYS = "mips-poky-linux" MACHINE = "my-meson-repro-mips" DISTRO = "poky" DISTRO_VERSION = "4.0.7" TUNE_FEATURES = "o32 bigendian fpu-hard octeon2" TARGET_FPU = "" | The Meson build system | Version: 0.61.3 | Source dir: /home/mabnhdev/meson-repro-mips/build/tmp/work/octeon2-o32-poky-linux/xorgproto/2021.5-r0/xorgproto-2021.5 | Build dir: /home/mabnhdev/meson-repro-mips/build/tmp/work/octeon2-o32-poky-linux/xorgproto/2021.5-r0/build | Build type: cross build | Project name: xorgproto | Project version: 2021.5 | | ../xorgproto-2021.5/meson.build:22:0: ERROR: Executables created by c compiler mips-poky-linux-gcc -meb -mabi=32 -mhard-float -march=octeon2 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/mabnhdev/meson-repro-mips/build/tmp/work/octeon2-o32-poky-linux/xorgproto/2021.5-r0/recipe-sysroot are not runnable.