Hello, I'd like to add a simple "Hello World" application ( https://github.com/bartiszosti/qt6-example ) based on Qt6 and CMake to my image . I wrote a receipt listed below to do so, but the building fails because the compiler tries to link the libQt6Core.so which is for other architecture, but when I build same application through the populated SDK everything works correctly.
local.conf > > MACHINE = "raspberrypi4-64" > ENABLE_UART = "1" > RPI_USE_U_BOOT = "1" > INIT_MANAGER = "systemd" > part of the bblayers.conf > > BBLAYERS ?= " \ > ${TOPDIR}/../poky/meta \ > ${TOPDIR}/../poky/meta-poky \ > ${TOPDIR}/../poky/meta-yocto-bsp \ > ${TOPDIR}/../meta-openembedded/meta-oe \ > ${TOPDIR}/../meta-openembedded/meta-python \ > ${TOPDIR}/../meta-qt6 \ > ${TOPDIR}/../meta-xware \ > ${TOPDIR}/../meta-raspberrypi \ > " > myimage.bb > > IMAGE_FEATURES = "\ > ssh-server-openssh \ > ${EXTRA_IMAGE_FEATURES} \ > " > IMAGE_INSTALL = "\ > packagegroup-core-boot \ > ${CORE_IMAGE_EXTRA_INSTALL} \ > qt6-example \ > " > inherit core-image > qt6-example_qit.bb > >> LICENSE = "CLOSED" >> SRC_URI = >> "git://github.com/bartiszosti/qt6-example.git;branch=master;protocol=https" >> >> SRCREV = "${AUTOREV}" >> S = "${WORKDIR}/git" >> inherit qt6-cmake populate_sdk_qt6 >> > > bitbake qt6-example > NOTE: Reconnecting to bitbake server... > NOTE: Retrying server connection (#1)... (09:43:44.480895) > NOTE: Reconnecting to bitbake server... > NOTE: Previous bitbake instance shutting down?, waiting to retry... > (09:43:44.482284) > NOTE: Directory listing: ['cache', 'sstate-cache', 'downloads', 'tmp', > 'bitbake-cookerdaemon.log', 'conf'] > NOTE: Retrying server connection (#2)... (09:43:44.629027) > Loading cache: 100% > |#######################################################################################################################################################| > Time: 0:00:01 > Loaded 4444 entries from dependency cache. > Parsing recipes: 100% > |#####################################################################################################################################################| > Time: 0:00:01 > Parsing of 2581 .bb files complete (2575 cached, 6 parsed). 4450 targets, > 132 skipped, 0 masked, 0 errors. > NOTE: Resolving any missing task queue dependencies > > > Build Configuration: > BB_VERSION = "2.8.0" > BUILD_SYS = "x86_64-linux" > NATIVELSBSTRING = "universal" > TARGET_SYS = "aarch64-poky-linux" > MACHINE = "raspberrypi4-64" > DISTRO = "poky" > DISTRO_VERSION = "5.0.2" > TUNE_FEATURES = "aarch64 crc cortexa72" > TARGET_FPU = "" > meta > meta-poky > meta-yocto-bsp = > "scarthgap:a725df1839a23b11ae1bace531d242bfc1ab98e0" > meta-oe > meta-python = > "scarthgap:78a14731cf0cf38a19ff8bd0e9255b319afaf3a7" > meta-qt6 = "6.8:b7dd88b6283cb9f8d48c951ec6fc085736e28f1b" > meta-xware = "master:6c5685c3007b60b224d50cd68db5e26aaf0042b4" > meta-raspberrypi = > "scarthgap:1918a27419dcd5e79954c0dc0edddcde91057a7e" > Sstate summary: Wanted 9 Local 1 Mirrors 0 Missed 8 Current 358 (11% > match, 97% > complete)#################################################################### > | ETA: 0:00:00 > Removing 1 stale sstate objects for arch cortexa72: 100% > |##################################################################################################################| > Time: 0:00:00 > NOTE: Executing Tasks > ERROR: qt6-example-git-r0 do_compile: > ExecutionError('/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/temp/run.do_compile.3592057', > 1, None, None) > ERROR: Logfile of failure stored in: > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/temp/log.do_compile.3592057 > > Log data follows: > | DEBUG: Executing shell function do_compile > | NOTE: VERBOSE=1 cmake --build > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/build > --target all -- > | Change Dir: > '/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/build' > > | > | Run Build Command(s): ninja -v -j 64 all > | [1/4] cd > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/build > && > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/bin/cmake > -E cmake_autogen > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/build/CMakeFiles/qt6_example_autogen.dir/AutogenInfo.json > "" && > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/bin/cmake > -E touch > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/build/qt6_example_autogen/timestamp > && > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/bin/cmake > -E cmake_transform_depfile Ninja gccdepfile > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/git > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/git > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/build > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/build > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/build/qt6_example_autogen/deps > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/build/CMakeFiles/d/f5ba9415f9a09417c93efc6d2af7f1b4467b21b42eac981bba83ca2c89f8e3b5.d > > | AutoGen: Refreshing parse cache because it doesn't exist. > | AutoMoc: Generating "BIN:/qt6_example_autogen/moc_predefs.h", because it > doesn't exist. > | > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++ > -dM -E -c > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/share/cmake-3.28/Modules/CMakeCXXCompilerABI.cpp > -DQT_CORE_LIB -DQT_NO_DEBUG > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/include/QtCore > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/include > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/lib/mkspecs/linux-g++ > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/13.3.0/include > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/13.3.0/include-fixed > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot/usr/include/c++/13.3.0 > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot/usr/include/c++/13.3.0/aarch64-poky-linux > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot/usr/include/c++/13.3.0/backward > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot/usr/lib/aarch64-poky-linux/13.3.0/include > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot/usr/include > > | AutoGen: Parsing "SRC:/main.cpp" > | AutoMoc: Generating MOC compilation > "BIN:/qt6_example_autogen/mocs_compilation.cpp" > | AutoMoc: Merging MOC dependencies into "BIN:/qt6_example_autogen/deps" > | AutoGen: Writing the parse cache file > "BIN:/CMakeFiles/qt6_example_autogen.dir/ParseCache.txt" > | AutoGen: Writing the settings file > "BIN:/CMakeFiles/qt6_example_autogen.dir/AutogenUsed.txt" > | [2/4] > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++ > --sysroot=/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot > -DQT_CORE_LIB -DQT_NO_DEBUG > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/include/QtCore > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/include > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/lib/mkspecs/linux-g++ > -isystem > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/build/qt6_example_autogen/include > -mcpu=cortex-a72+crc -mbranch-protection=standard -fstack-protector-strong > -Wformat -Wformat-security -Werror=format-security > --sysroot=/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot > -O2 -pipe -g -feliminate-unused-debug-types -fvisibility-inlines-hidden > -fPIC -MD -MT > CMakeFiles/qt6_example.dir/qt6_example_autogen/mocs_compilation.cpp.o -MF > CMakeFiles/qt6_example.dir/qt6_example_autogen/mocs_compilation.cpp.o.d -o > CMakeFiles/qt6_example.dir/qt6_example_autogen/mocs_compilation.cpp.o -c > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/build/qt6_example_autogen/mocs_compilation.cpp > > | [3/4] > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++ > --sysroot=/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot > -DQT_CORE_LIB -DQT_NO_DEBUG > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/include/QtCore > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/include > -I/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/lib/mkspecs/linux-g++ > -isystem > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/build/qt6_example_autogen/include > -mcpu=cortex-a72+crc -mbranch-protection=standard -fstack-protector-strong > -Wformat -Wformat-security -Werror=format-security > --sysroot=/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot > -O2 -pipe -g -feliminate-unused-debug-types -fvisibility-inlines-hidden > -fPIC -MD -MT CMakeFiles/qt6_example.dir/main.cpp.o -MF > CMakeFiles/qt6_example.dir/main.cpp.o.d -o > CMakeFiles/qt6_example.dir/main.cpp.o -c > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/git/main.cpp > > | [4/4] : && > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++ > --sysroot=/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot > -mcpu=cortex-a72+crc -mbranch-protection=standard -fstack-protector-strong > -Wformat -Wformat-security -Werror=format-security > --sysroot=/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot > -O2 -pipe -g -feliminate-unused-debug-types -fvisibility-inlines-hidden > -mcpu=cortex-a72+crc -mbranch-protection=standard -fstack-protector-strong > -Wformat -Wformat-security -Werror=format-security > --sysroot=/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot > -O2 -pipe -g -feliminate-unused-debug-types -fvisibility-inlines-hidden > -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,-O1 > -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now > CMakeFiles/qt6_example.dir/qt6_example_autogen/mocs_compilation.cpp.o > CMakeFiles/qt6_example.dir/main.cpp.o -o qt6_example > -Wl,-rpath,-native/usr/lib > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/lib/libQt6Core.so.6.8.0 > && : > | FAILED: qt6_example > | : && > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++ > --sysroot=/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot > -mcpu=cortex-a72+crc -mbranch-protection=standard -fstack-protector-strong > -Wformat -Wformat-security -Werror=format-security > --sysroot=/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot > -O2 -pipe -g -feliminate-unused-debug-types -fvisibility-inlines-hidden > -mcpu=cortex-a72+crc -mbranch-protection=standard -fstack-protector-strong > -Wformat -Wformat-security -Werror=format-security > --sysroot=/mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot > -O2 -pipe -g -feliminate-unused-debug-types -fvisibility-inlines-hidden > -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,-O1 > -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now > CMakeFiles/qt6_example.dir/qt6_example_autogen/mocs_compilation.cpp.o > CMakeFiles/qt6_example.dir/main.cpp.o -o qt6_example > -Wl,-rpath,-native/usr/lib > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/lib/libQt6Core.so.6.8.0 > && : > | > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/13.3.0/ld: > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/lib/libQt6Core.so.6.8.0: > error adding symbols: file in wrong format > | collect2: error: ld returned 1 exit status > | ninja: build stopped: subcommand failed. > | > | WARNING: exit code 1 from a shell command. > ERROR: Task > (/mnt/yocto_drive/rpi/build/../meta-xware/recipes-example/qt6-example/qt6-example_git.bb:do_compile) > failed with exit code '1' > NOTE: Tasks Summary: Attempted 1086 tasks of which 1082 didn't need to be > rerun and 1 failed. > Summary: 1 task failed: > /mnt/yocto_drive/rpi/build/../meta-xware/recipes-example/qt6-example/qt6-example_git.bb:do_compile > > Summary: There was 1 ERROR message, returning a non-zero exit code. > file /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/lib/libQt6Core.so.6.8.0 > > /mnt/yocto_drive/rpi/build/tmp/work/cortexa72-poky-linux/qt6-example/git/recipe-sysroot-native/usr/lib/libQt6Core.so.6.8.0: > ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically > linked, interpreter /lib64/ld-linux-x86-64.so.2, > BuildID[sha1]=934a77551cc57b04260e0d854158e8929f68b086, for GNU/Linux > 4.11.0, stripped > Additional information: * when I use the Qt6 instead the Qt6 it works, * when I compile application without the Qt6 but with the libfmt instead it works, * when I build the nats.c it fails with same issue trying to link libssl.so for different architecture, * I use the Scarthgap release.
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#63533): https://lists.yoctoproject.org/g/yocto/message/63533 Mute This Topic: https://lists.yoctoproject.org/mt/107431527/21656 Mute #cmake:https://lists.yoctoproject.org/g/yocto/mutehashtag/cmake Mute #gcc:https://lists.yoctoproject.org/g/yocto/mutehashtag/gcc Mute #qt:https://lists.yoctoproject.org/g/yocto/mutehashtag/qt Mute #raspberrypi:https://lists.yoctoproject.org/g/yocto/mutehashtag/raspberrypi Mute #scarthgap:https://lists.yoctoproject.org/g/yocto/mutehashtag/scarthgap Mute #sdk:https://lists.yoctoproject.org/g/yocto/mutehashtag/sdk Mute #yocto:https://lists.yoctoproject.org/g/yocto/mutehashtag/yocto Mute #bitbake:https://lists.yoctoproject.org/g/yocto/mutehashtag/bitbake Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-