summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2020-01-13 17:27:06 +0100
committerMax Krummenacher <max.krummenacher@toradex.com>2020-01-13 18:41:15 +0100
commit5c5bd215ad98d45176f824e55dd56e759f70b27a (patch)
tree97fba2e1256c275afa5f29a84bd1eed85ec9391f
parentd6dc25f66d3f25128e93d70dec13e723aa58b00c (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>
-rw-r--r--recipes-devtools/spidev-test/spidev-test.bb12
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 () {