didn't pass LDFLAGS? [ldflags] - yocto

I created a recipe, summary as follows:
do_install() {
install -d ${D}/GreenTea
cp ${S}/foo.sh ${D}/GreenTea
cp ${S}/foo.so ${D}/GreenTea
when bitbake this recipe, it shows: didn't pass LDFLAGS? [ldflags]
ERROR: greentea-1.0-r0 do_package_qa: QA Issue: No GNU_HASH in the ELF binary /home/tea/greentea4/build/tmp/work/corei7-64-poky-linux/greentea/1.0-r0/packages-split/greentea/GreenTea/foo.so, didn't pass LDFLAGS? [ldflags]
What can I do?

If you're compiling the source for yourself, you should not skip the LDFLAGS warning as mentioned by #jussi-kukkonen and you should add the following line in your Yocto recipe
TARGET_CC_ARCH += "${LDFLAGS}"
Ref: How to fix : ERROR: do_package_qa: QA Issue: No GNU_HASH in the elf binary

You can skip the warning:
INSANE_SKIP_${PN} += "ldflags"
This does not mean the library will actually work on target (the QA warnings are there for a reason) but it will allow packaging to continue.

Related

Yocto: do_rootfs fails because can't find the package I'm building

Trying to add a new package in my target Intel platform with Yocto build system. New package is intel-cmt-cat and its source code is taken from here. After looking at examples, I created my simple recipe file:
% cat intel-cmt-cat_4.1.0.bb
SUMMARY = "Short summary"
DESCRIPTION = "Short description."
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=c63eb1250e8724441150d665efe12012"
SRC_URI = "git://github.com/intel/intel-cmt-cat.git;protocol=https"
SRCREV = "30fadea5cb82ff99f56e46172c7d20fdb24b2338"
S = "${WORKDIR}/git"
Nothing fancy, and should work, however it fails (I removed lengthy dnf command, made it short):
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: myimage-1.0-r0 do_rootfs: Could not invoke dnf.
dnf -v --rpmverbosity=info -y -c dnf.conf package1 package2 ... intel-cmt-cat
...
repo: using cache for: oe-repo
not found other for:
not found modules for:
not found deltainfo for:
not found updateinfo for:
oe-repo: using metadata from Thu 04 Mar 2021 07:12:38 PM UTC.
No module defaults found
No match for argument: intel-cmt-cat
Error: Unable to find a match
...
ERROR: Function failed: do_rootfs
It appears to me that do_rootfs() function is failing. I checked the build directory, and can see that the sources have been fetched and built. However the later steps fail: as you see it is unable to locate my package (as far as I can say).
What am I doing wrong?
After reading manuals at yoctoproject.org, I came up with the following recipe:
SUMMARY = "Short summary"
DESCRIPTION = "Short description."
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=c63eb1250e8724441150d665efe12012"
SRC_URI = "git://github.com/intel/intel-cmt-cat.git;protocol=https"
SRCREV = "30fadea5cb82ff99f56e46172c7d20fdb24b2338"
S = "${WORKDIR}/git"
TARGET_CC_ARCH += "${LDFLAGS}"
do_compile() {
oe_runmake PREFIX=/usr
}
do_install() {
oe_runmake PREFIX=${D}/usr NOLDCONFIG=y install
rm -rf ${D}/usr/man
rm -rf ${D}/usr/include
}
INSANE_SKIP_${PN} += "already-stripped"
FILES_${PN} += "${libdir}/libpqos* ${bindir}/pqos* ${bindir}/rdtset"}
intel-cmt-cat does not use cmake, just good old make and Makefile.
I only rely on the package's LDFLAGS and don't pass any in the recipe, so this caused error during build:
No GNU_HASH in the elf binary: ...
In order to workaround this, add TARGET_CC_ARCH directive.
I explicitly call oe_runmake fuunction as I want to pass on a different PREFIX value (default is /usr/local); next in do_install I pass on NOLDCONFIG=y which will not invoke ldconfig and finally skips checking (via directive INSANE_SKIP) if generated binaries have not already been stripped. This is done because the Makefile already calls install -s ... and I didn't want to patch Makefile etc.

QA Issue: libvncserver: Files/directories were installed but not shipped in any package:

While generating sato image by bitbake core-iamge-sato, I am getting following errors
ERROR: libvncserver-0.9.12+gitAUTOINC+c0a23857a5-r0 do_package: QA Issue: libvncserver: Files/directories were installed but not shipped in any package:
/usr/lib/libvncclient.so
/usr/lib/libvncserver.so
/usr/lib/libvncserver.so.1
/usr/lib/libvncclient.so.0.9.12
/usr/lib/libvncclient.so.1
/usr/lib/libvncserver.so.0.9.12
/usr/lib/pkgconfig
/usr/lib/pkgconfig/libvncclient.pc
/usr/lib/pkgconfig/libvncserver.pc
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
libvncserver: 9 installed and not shipped files. [installed-vs-shipped]
ERROR: libvncserver-0.9.12+gitAUTOINC+c0a23857a5-r0 do_package: Fatal QA errors found, failing task.
ERROR: libvncserver-0.9.12+gitAUTOINC+c0a23857a5-r0 do_package:
ERROR: libvncserver-0.9.12+gitAUTOINC+c0a23857a5-r0 do_package: Function failed: do_package
ERROR: Logfile of failure stored in: /home/panther2/warrior/build/tmp/work/corei7-64-poky-linux/libvncserver/0.9.12+gitAUTOINC+c0a23857a5-r0/temp/log.do_package.101719
ERROR: Task (/home/panther2/warrior/sources/meta-openembedded/meta-oe/recipes-graphics/libvncserver/libvncserver_git.bb:do_package) failed with exit code '1'
I am building for warrior branch. As a solution I tried adding following lines in libvncserver_git.bb but nothing worked out. Can anyone help?
FILES_${PN} += " \
${libdir}/libvncclient.so \
${libdir}/libvncserver.so \
${libdir}/libvncserver.so.1 \
${libdir}/libvncclient.so.0.9.12 \
${libdir}/libvncclient.so.1 \
${libdir}/libvncserver.so.0.9.12 \
${libdir}/pkgconfig \
${libdir}/pkgconfig/libvncclient.pc \
${libdir}/pkgconfig/libvncserver.pc \
"
Thank you for your time.
Background: you're using a configuration where $libdir isn't /usr/lib (multilib, probably) but the upstream doesn't care and installs to /usr/lib anyway, which is a bug upstream.
As suggested in comment, I have resolved the error by replacing recipe file from master branch(libvncserver_0.9.12.bb). I was using warrior branch recipe libvncserver_git.bb which causes error.

Failed do_rootfs for agl-demo-platform

I am building Yocto for AGL image (for more details: automotivelinux.org).
The below error occurred during the build progress (do_rootfs).
In packagegroup-agl-demo-platform.bb, declared packagegroup-agl-image-ivi as a runtime dependent package.
RDEPENDS_${PN} += "\
packagegroup-agl-image-ivi \
"
I can build successfully the packagegroup-agl-image-ivi separately. But when building the whole agl-demo-platform image, happened as follows:
ERROR: agl-demo-platform-1.0-r0 do_rootfs: Unable to install packages. Command '/LTSI4.9/LTSI4.4/build/tmp/work/m3ulcb-agl-linux/agl-demo-platform/1.0-r0/opkg.conf -t /LTSI4.9/build/tmp/work/m3ulcb-agl-linux/agl-demo-platform/1.0-r0/temp/ipktemp/ -o /LTSI4.9/build/tmp/work/m3ulcb-agl-linux/agl-demo-platform/1.0-r0/rootfs --force_postinstall --prefer-arch-to-version install
run-postinsts
screen
kernel-modules
packagegroup-agl-devel
packagegroup-core-eclipse-debug
mc packagegroup-core-tools-profile
kernel-module-vsp2 kernel-module-pvrsrvkm
kernel-module-vspm-if
opkg packagegroup-core-tools-debug
psplash kernel-module-vspm
packagegroup-core-ssh-openssh
packagegroup-agl-demo-platform
omx-user-module kernel-devicetree'
returned 1:
Solver encountered 1 problem(s):
Problem 1/1:
- package packagegroup-agl-demo-platform-1.0-r0.all requires packagegroup-agl-image-ivi, but none of the providers can be installed
Solution 1:
- do not ask to install a package providing packagegroup-agl-demo-platform
ERROR: agl-demo-platform-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /LTSI4.9/build/tmp/work/m3ulcb-agl-linux/agl-demo-platform/1.0-r0/temp/log.do_rootfs.14498
ERROR: Task (/LTSI4.9/meta-agl-demo/recipes-platform/images/agl-demo-platform.bb:do_rootfs) failed with exit code '1'
Can anyone help me out in this case ?
I tried 02 ways as follows. They did work.
First method, I cleaned all relative packages and rebuild the whole image.
$ bitbake -c cleanall -c cleansstate <recipes>
recipes consisted of all dependent & runtime dependent packages. But it was a little bit confused to inexperienced users to determine which ones.
Second method, I wiped out the build/tmp/, cache/, sstate-cache/ folders, and re-build all Yocto packages.
There were nothing happening any more. It was really a bad idea if be in critical period of time, but if have free time, be helpful.

Error on building Openembedded for Intel Quark

Trying to build Linux for Advantech UBC-221 that has Intel Quark processor.
The system is Debian 9, running on VMware. Was able to build poky succefully before.
Let me summarize what I was doing:
mkdir quark
cd quark
git clone git://git.yoctoproject.org/meta-intel-quark
git clone git://git.openembedded.org/openembedded-core
git clone git://git.yoctoproject.org/poky
cp -r poky/bitbake .
cd openembedded-core
source oe-init-build-env
bitbake-layers add-layer ~/quark/meta-intel-quark/
bitbake core-image-base
Error code I get:
WARNING: Layer quark-bsp should set LAYERSERIES_COMPAT_quark-bsp in its conf/layer.conf file to list the core layer names it is compatible with.
WARNING: Layer quark-bsp should set LAYERSERIES_COMPAT_quark-bsp in its conf/layer.conf file to list the core layer names it is compatible with.
WARNING: /home/bgabor/quark/meta-intel-quark/recipes-kernel/linux/linux-yocto-quark_3.8.bb: Variable key RDEPENDS_${KERNEL_PACKAGE_NAME}-base (${KERNEL_PACKAGE_NAME}-image) replaces original key RDEPENDS_kernel-base ().
WARNING: /home/bgabor/quark/meta-intel-quark/recipes-bsp/grub/grub_0.97.bb: Exception during build_dependencies for CFLAGS
WARNING: /home/bgabor/quark/meta-intel-quark/recipes-bsp/grub/grub_0.97.bb: Error during finalise of /home/bgabor/quark/meta-intel-quark/recipes-bsp/grub/grub_0.97.bb
ERROR: ExpansionError during parsing /home/bgabor/quark/meta-intel-quark/recipes-bsp/grub/grub_0.97.bb
Traceback (most recent call last):
bb.data_smart.ExpansionError: Failure expanding variable CFLAGS, expression was -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/bgabor/quark/openembedded-core/build/tmp-glibc/work/i586-oe-linux/grub/0.97+gitAUTOINC+5775f32a62-r0=/usr/src/debug/grub/0.97+gitAUTOINC+5775f32a62-r0 -fdebug-prefix-map=/home/bgabor/quark/openembedded-core/build/tmp-glibc/work/i586-oe-linux/grub/0.97+gitAUTOINC+5775f32a62-r0/recipe-sysroot= -fdebug-prefix-map=/home/bgabor/quark/openembedded-core/build/tmp-glibc/work/i586-oe-linux/grub/0.97+gitAUTOINC+5775f32a62-r0/recipe-sysroot-native= -Os -fno-strict-aliasing -Wall -Werror -Wno-shadow -Wno-unused -Wno-pointer-sign -DINTEL_QUARK_TEST=${#base_contains('PACKAGECONFIG', 'grub_test', '1', '0', d)} which triggered exception NameError: name 'base_contains' is not defined
Summary: There were 5 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
I'm pretty much stuck here. Some help would be greatly appreciated!
Edit:
Tried to build on Debian 7.11 32 bit system. It went better however another error came:
bgabor#debian:~/quark/dizzy/build$ bitbake core-image-base
WARNING: Host distribution "Debian-7.11" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Loading cache: 100% |####################################################################################################################################################| ETA: 00:00:00
Loaded 1292 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.24.0"
BUILD_SYS = "i686-linux"
NATIVELSBSTRING = "Debian-7.11"
TARGET_SYS = "i586-poky-linux"
MACHINE = "quark"
DISTRO = "poky"
DISTRO_VERSION = "1.7.3"
TUNE_FEATURES = "m32 i586"
TARGET_FPU = ""
meta
meta-yocto
meta-yocto-bsp = "dizzy:58863ad092c9a279e305c841dbb4353de2ecfae8"
meta-intel-quark = "master:a314f0ceea986fde42d5d9b0ea449f7a563e9351"
NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Unable to install packages. Command '/home/bgabor/quark/dizzy/build/tmp/sysroots/i686-linux/usr/bin/smart --quiet --data-dir=/home/bgabor/quark/dizzy/build/tmp/work/quark-poky-linux/core-image-minimal-initramfs/1.0-r0/rootfs/var/lib/smart install -y busybox#i586 initramfs-live-install-efi#i586 run-postinsts#all initramfs-live-install#i586 udev#i586 initramfs-live-boot#quark base-passwd#i586' returned 1:
error: Can't install initramfs-live-install-1.0-r9#i586: no package provides grub
ERROR: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/bgabor/quark/dizzy/build/tmp/work/quark-poky-linux/core-image-minimal-initramfs/1.0-r0/temp/log.do_rootfs.29435
ERROR: Task 240 (/home/bgabor/quark/dizzy/meta/recipes-core/images/core-image-minimal-initramfs.bb, do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2529 tasks of which 2527 didn't need to be rerun and 1 failed.
No currently running tasks (2435 of 2531)
Summary: 1 task failed:
/home/bgabor/quark/dizzy/meta/recipes-core/images/core-image-minimal-initramfs.bb, do_rootfs
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
It does not find grub package, however I can see there are two in the recipes:
bgabor#debian:~/quark/dizzy/build$ bitbake-layers show-recipes | grep "grub" -A 3
Parsing recipes..done.
grub:
meta-intel-quark 0.97+gitAUTOINC+5775f32a62
meta 0.97
meta 2.00
--
grub-conf:
meta-intel-quark 1.0
grub-efi:
meta 2.00
gsettings-desktop-schemas:
meta 3.10.1
Tried to clean and then bitbake again but no result.
What might be the problem here?
First, Poky includes OpenEmbedded Core so you don't need to clone both, just clone Poky.
Second, the meta-intel-iot layer is pretty dead and only formally supports the Daisy release of Poky (see the README). You may have luck using newer releases, but obviously not git master (aka Thud).
https://wiki.yoctoproject.org/wiki/Releases lists the releases. Instead of checking out master of Poky, check out the relevant release branch. I suggest starting with daisy but trying something a little newer such as jethro would be a good idea.

why u-boot source code remove while compiling?

I am perorming following steps for compiling source code locally. i am using poky version pyro of yocto. but after successfully clean the source code, while compiling source code is remove and error is display.
step 1
bitbake -v -c clean u-boot
step 2
bitbake -v u-boot
------------------------------Eroor-------------------------------
make: *** No rule to make target 'am335x_boneblack_config'. Stop.
make: Leaving directory '/u-boot/u-boot_v2017.01/u-boot_src'
ERROR: u-boot-1_2017.01-r0 do_compile: oe_runmake failed
ERROR: u-boot-1_2017.01-r0 do_compile: Function failed: do_compile (log file is located at /PYRO_BUILD/tmp/work/beaglebone-poky-linux-gnueabi/u-boot/1_2017.01-r0/temp/log.do_compile.10915)
ERROR: Logfile of failure stored in: /PYRO_BUILD/tmp/work/beaglebone-poky-linux-gnueabi/u-boot/1_2017.01-r0/temp/log.do_compile.10915
how should i resolve it?
make: *** No rule to make target 'am335x_boneblack_config'. Stop.
make: Leaving directory
'//src_bsp/u-boot/u-boot_v2017.01/u-boot_src'
From above error, It seems that you have uboot code locally at '//u-boot/u-boot_v2017.01/u-boot_src' which gets deleted on compiling(bitbake -v u-boot).
Try using EXTERNALSRC instead of S to specify path to u-boot source code as follows :
inherit externalsrc
EXTERNALSRC = "/<workspace>/u-boot/u-boot_v2017.01/u-boot_src"
EXTERNALSRC_BUILD = "/<workspace>/u-boot/u-boot_v2017.01/u-boot_src"