All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gary Bisson <gary.bisson@boundarydevices.com>
To: meta-freescale@yoctoproject.org
Cc: carol.zhu@nxp.com
Subject: [PATCH 1/2] imx-vpu-hantro: fix build issue
Date: Wed,  3 Oct 2018 12:24:42 +0200	[thread overview]
Message-ID: <20181003102443.29749-2-gary.bisson@boundarydevices.com> (raw)
In-Reply-To: <20181003102443.29749-1-gary.bisson@boundarydevices.com>

The source code uses LINUX_VERSION_CODE at many places which constraints
the package to be built with a toolchain whose headers match the kernel.

This is a far from ideal solution, especially if one wants to use a
prebuilt toolchain (with unknown kernel header version).

So change the CFLAGS to consider the kernel build folder so that the
Linux version test actually matches the kernel built.

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
---
 ...clusion-to-be-from-kernel-build-fold.patch | 44 +++++++++++++++++++
 .../imx-vpu-hantro/imx-vpu-hantro_1.8.0.bb    |  5 ++-
 2 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 recipes-bsp/imx-vpu-hantro/imx-vpu-hantro/0002-Fix-version.h-inclusion-to-be-from-kernel-build-fold.patch

diff --git a/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro/0002-Fix-version.h-inclusion-to-be-from-kernel-build-fold.patch b/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro/0002-Fix-version.h-inclusion-to-be-from-kernel-build-fold.patch
new file mode 100644
index 00000000..e9bf9257
--- /dev/null
+++ b/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro/0002-Fix-version.h-inclusion-to-be-from-kernel-build-fold.patch
@@ -0,0 +1,44 @@
+From 1d7b7046c8f735e150e92aeace3fe6d0686b9bc9 Mon Sep 17 00:00:00 2001
+From: Gary Bisson <gary.bisson@boundarydevices.com>
+Date: Wed, 3 Oct 2018 10:52:29 +0200
+Subject: [PATCH] Fix version.h inclusion to be from kernel build folder
+
+Instead of relying on Toolchain headers which can be from newer kernel.
+
+Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
+---
+ Makefile_G1G2 | 3 +++
+ Makefile_H1   | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/Makefile_G1G2 b/Makefile_G1G2
+index 29866a4..c473bcb 100755
+--- a/Makefile_G1G2
++++ b/Makefile_G1G2
+@@ -16,6 +16,9 @@ INCLUDE_HEADERS += -I$(LINUX_KERNEL_ROOT)/include/uapi -I$(LINUX_KERNEL_ROOT)/in
+ # ION header location
+ INCLUDE_HEADERS += -I$(LINUX_KERNEL_ROOT)/drivers/staging/android/uapi
+ 
++# LINUX_VERSION_CODE from kernel build folder instead of toolchain headers
++INCLUDE_HEADERS += -I$(LINUX_KERNEL_BUILD)/include/generated/uapi
++
+ CFLAGS += -DDEC_MODULE_PATH=\"/dev/mxc_hantro\" -DUSE_FAKE_RFC_TABLE -DFIFO_DATATYPE=void* -DNDEBUG -DDOWN_SCALER \
+            -DUSE_EXTERNAL_BUFFER -DUSE_FAST_EC -DUSE_VP9_EC -DGET_FREE_BUFFER_NON_BLOCK \
+            -DDEC_X170_OUTPUT_FORMAT=0 -DDEC_X170_TIMEOUT_LENGTH=-1 -DENABLE_HEVC_SUPPORT \
+diff --git a/Makefile_H1 b/Makefile_H1
+index 56b4332..0be43ce 100755
+--- a/Makefile_H1
++++ b/Makefile_H1
+@@ -23,6 +23,9 @@ ENV += -I$(SDKTARGETSYSROOT)/usr/imx/include
+ # ION header location
+ ENV += -I$(LINUX_KERNEL_ROOT)/drivers/staging/android/uapi
+ 
++# LINUX_VERSION_CODE from kernel build folder instead of toolchain headers
++INCLUDE_HEADERS += -I$(LINUX_KERNEL_BUILD)/include/generated/uapi
++
+ LIBENCNAME = libcodec_enc
+ LIBSENC = -L./ -lhantro_h1 -lpthread
+ 
+-- 
+2.19.0
+
diff --git a/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro_1.8.0.bb b/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro_1.8.0.bb
index 243f1f35..b5fc8468 100644
--- a/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro_1.8.0.bb
+++ b/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro_1.8.0.bb
@@ -12,6 +12,7 @@ PROVIDES = "virtual/imxvpu"
 SRC_URI = " \
     ${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true \
     file://0001-Fix-ion.h-header-inclusion-to-be-standard.patch \
+    file://0002-Fix-version.h-inclusion-to-be-from-kernel-build-fold.patch \
 "
 SRC_URI[md5sum] = "140796ddd6f1be47cffb7e5e2bfe0fb6"
 SRC_URI[sha256sum] = "c092a5b0f8897bae54154f58e47b6d2de033da01ee231a8cd779a51bbe962606"
@@ -24,7 +25,9 @@ PLATFORM_mx8mm = "IMX8MM"
 PLATFORM_mx8mq = "IMX8MQ"
 
 do_compile () {
-    oe_runmake CROSS_COMPILE="${HOST_PREFIX}" LINUX_KERNEL_ROOT="${STAGING_KERNEL_DIR}" SDKTARGETSYSROOT="${STAGING_DIR_TARGET}" PLATFORM="${PLATFORM}" all
+    oe_runmake CROSS_COMPILE="${HOST_PREFIX}" LINUX_KERNEL_BUILD="${STAGING_KERNEL_BUILDDIR}" \
+        LINUX_KERNEL_ROOT="${STAGING_KERNEL_DIR}" SDKTARGETSYSROOT="${STAGING_DIR_TARGET}" \
+        PLATFORM="${PLATFORM}" all
 }
 
 do_install () {
-- 
2.19.0



  reply	other threads:[~2018-10-03 10:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 10:24 [PATCH 0/2] Fix Hantro/Gstreamer build issues Gary Bisson
2018-10-03 10:24 ` Gary Bisson [this message]
2018-10-03 13:03   ` [PATCH 1/2] imx-vpu-hantro: fix build issue Carlos Rafael Giani
2018-10-04 15:47     ` Otavio Salvador
2018-10-04 19:49       ` Carlos Rafael Giani
2018-10-05 13:32         ` Otavio Salvador
2018-10-03 10:24 ` [PATCH 2/2] gstreamer1.0-plugins-base: " Gary Bisson
2018-10-03 13:50 ` [PATCH 0/2] Fix Hantro/Gstreamer build issues Tom Hochstein
2018-10-03 14:19   ` Gary Bisson
2018-10-03 18:43   ` Otavio Salvador
2018-10-03 18:47     ` Tom Hochstein
2018-10-03 18:50       ` Otavio Salvador
2018-10-05 12:09         ` Carlos Rafael Giani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181003102443.29749-2-gary.bisson@boundarydevices.com \
    --to=gary.bisson@boundarydevices.com \
    --cc=carol.zhu@nxp.com \
    --cc=meta-freescale@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.