diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2020-01-13 17:27:06 +0100 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2020-01-25 13:47:03 +0100 |
commit | e47707b002217f4c2102a03a679bf94079e31555 (patch) | |
tree | 769b9e7520d1a9c29e3a18edb5d844c427e570a9 | |
parent | 5320813f1d9f650688aa866ac21b7b4390115280 (diff) |
spidev_test: add support for older kernels and prevent qa error
spidev-test.c was moved in the kernel sources with v4.5.y kernels.
Check both possible locations.
Prevent the following error by providing OE LDFLAGS:
| ERROR: spidev-test-1.0-r0 do_package_qa: QA Issue: No GNU_HASH in the ELF binary .../usr/bin/spidev_test, didn't pass LDFLAGS? [ldflags]
Related-to ELB-1284
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
(cherry picked from commit 5c5bd215ad98d45176f824e55dd56e759f70b27a)
-rw-r--r-- | recipes-devtools/spidev-test/spidev-test.bb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/recipes-devtools/spidev-test/spidev-test.bb b/recipes-devtools/spidev-test/spidev-test.bb index 8ce252a..3e0b1e1 100644 --- a/recipes-devtools/spidev-test/spidev-test.bb +++ b/recipes-devtools/spidev-test/spidev-test.bb @@ -7,8 +7,18 @@ S = "${WORKDIR}" do_configure[depends] += "virtual/kernel:do_shared_workdir" +# the spidev_test.c example got moved to tools/spi/ starting with +# the v.4.5.y kernel +KERNELPATH = "tools/spi/spidev_test.c" +KERNELPATH-OLD = "Documentation/spi/spidev_test.c" + do_compile () { - ${CC} ${STAGING_KERNEL_DIR}/tools/spi/spidev_test.c -o spidev_test + if [ -f "${STAGING_KERNEL_DIR}/${KERNELPATH}" ] + then + ${CC} ${LDFLAGS} ${STAGING_KERNEL_DIR}/${KERNELPATH} -o spidev_test + else + ${CC} ${LDFLAGS} ${STAGING_KERNEL_DIR}/${KERNELPATH-OLD} -o spidev_test + fi } do_install () { |