4

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?

GreenTea
  • 769
  • 1
  • 10
  • 36
  • 3
    Yocto sets LDFLAGS to be used during linking of foo.so. The QA test found evidence that this did not happen. Typical build systems respect LDFLAGS and everything just works... so the question is, how do you build/link your foo.so? – Jussi Kukkonen Apr 28 '20 at 06:57
  • 1
    It is a pre-build so file, not bitbake run time generated. – GreenTea Apr 28 '20 at 07:09
  • @JussiKukkonen so how should I modify my build system so that everything works if I'm building my own SO image? – user140345 Jul 25 '21 at 15:26

2 Answers2

7

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

Daniel Selvan
  • 959
  • 10
  • 23
2

You can skip the warning:

INSANE_SKIP:${PN} += "ldflags"

# when this question was originally asked the format was
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. The dev-manual now has a whole section about Pre-built binaries.

Jussi Kukkonen
  • 13,857
  • 1
  • 37
  • 54