Problem compiling the Hello World recipe example

I’ve followed the tutorial to create a new meta layer and add a recipe for a simple Hello World application. I get the following error when executing bitbake:

bitbake hello-world
Parsing recipes: 100% |##################################################################################| Time: 0:01:22
Parsing of 2764 .bb files complete (0 cached, 2764 parsed). 3934 targets, 256 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.46.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "arm-tdx-linux-gnueabi"
MACHINE              = "colibri-imx6ull"
DISTRO               = "tdx-xwayland"
DISTRO_VERSION       = "5.2.0-devel-20210212165905+build.0"
TUNE_FEATURES        = "arm armv7a vfp thumb neon callconvention-hard"
TARGET_FPU           = "hard"
meta-toradex-nxp     = "HEAD:599cd72b82723ac096bb5c9bea2d82bdc6b38185"
meta-freescale       = "HEAD:5337af9072484509a996dcf8e9872972cbcfd8d1"
meta-freescale-3rdparty = "HEAD:ed841161a97307ebd901c31c62f8ecbee6baaacf"
meta-toradex-tegra   = "HEAD:b214067b27204f471cf405a1e3997d3da233a8f9"
meta-toradex-bsp-common = "HEAD:2b830c7a4aaf39dc7ea971c638b5042290c9ee1e"
meta-oe
meta-filesystems
meta-gnome
meta-xfce
meta-initramfs
meta-networking
meta-multimedia
meta-python
meta-webserver       = "HEAD:5bba79488b7d393d2258d6e917f7bf7b0d7c4073"
meta-freescale-distro = "HEAD:5d882cdf079b3bde0bd9869ce3ca3db411acbf3b"
meta-toradex-demos   = "HEAD:bf1bc67f2de9f0245da66a3a15d5c439ee7462d7"
meta-qt5             = "HEAD:0d8eb956015acdea7e77cd6672d08dce18061510"
meta-toradex-distro  = "HEAD:2561e4a6cc6d5a8f6badb32ed3ead6eb4b536519"
meta-poky            = "HEAD:e5c4bf10f870a9f157a94ff940de36b5e18edf00"
meta                 = "HEAD:b286258fc2f6974a88ebd90d3c2f9465437cfcfd"
meta-customer        = "<unknown>:<unknown>"

Initialising tasks: 100% |###############################################################################| Time: 0:00:01
Sstate summary: Wanted 11 Found 4 Missed 7 Current 191 (36% match, 96% complete)
NOTE: Executing Tasks
ERROR: hello-world-1.0.0-r0 do_package_qa: QA Issue: File /usr/bin/hello-world in package hello-world doesn't have GNU_HASH (didn't pass LDFLAGS?) [ldflags]
ERROR: hello-world-1.0.0-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.
ERROR: Logfile of failure stored in: /home/cristi/oe-core/build/tmp/work/armv7at2hf-neon-tdx-linux-gnueabi/hello-world/1.0.0-r0/temp/log.do_package_qa.3333
ERROR: Task (/home/cristi/oe-core/build/../layers/meta-customer/recipes-customer/hello-world/hello-world_1.0.0.bb:do_package_qa) failed with exit code '1'
NOTE: Tasks Summary: Attempted 682 tasks of which 668 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 2 seconds

Summary: 1 task failed:
  /home/cristi/oe-core/build/../layers/meta-customer/recipes-customer/hello-world/hello-world_1.0.0.bb:do_package_qa
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

Does anybody know what is the issue? I’ve also attached the log file.link text

PS "${TOPDIR}/…/layers/layers/meta-customer " needs to be "${TOPDIR}/…/layers/meta-customer ". Maybe you can correct the tutorial instructions.

Managed to solve this by adding this line to your recipe.

TARGET_CC_ARCH += “${LDFLAGS}”

Ref: https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#migration-2.2-default-linker-hash-style-changed

I’ve found the solution here. It seems the following line needs to be added to the recipes-customer/hello-world/hello-world_1.0.0.bb file:

TARGET_CC_ARCH += "${LDFLAGS}"

Hopefully, the Toradex tutorial will be updated.

Thank you. It seems both of us have found the same solution.

Perfect that you found the solution. Thanks for the feedback.