gst-fsl-plugins: fix includes for recent toolchains
PATCH 1/1 gst-fsl-plugins: fix includes for recent toolchains
Build was failing starting with CodeSourcery 2013.11 due to new v4l kernel headers.
---
Yann, all,
I know this patch will look bad as we already discussed the use of -I instead of -idirafter.
However it has been reported and verified that this package doesn't build using recent toolchain such as CodeSourcery 2013.11. It seems to come from the fact that the kernel headers in the toolchain have been updated which brings some incompatibility. Using -idirafter, the v4l header picked up is from the toolchain which is missing some older structures like v4l2_dbg_chip_ident. The CPPFLAGS setup is now exactly the same as what is done in Yocto.
Let me know your thoughts.
Thanks,
Gary
--- package/gstreamer/gst-fsl-plugins/gst-fsl-plugins.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
package/gstreamer/gst-fsl-plugins/gst-fsl-plugins.mk +2 -1
@@ -24,7 +24,8 @@ GST_FSL_PLUGINS_CONF_ENV = \ # needs access to imx-specific kernel headers GST_FSL_PLUGINS_DEPENDENCIES += linux -GST_FSL_PLUGINS_CONF_ENV += CPPFLAGS="$(TARGET_CPPFLAGS) -idirafter $(LINUX_DIR)/include/uapi" +GST_FSL_PLUGINS_CONF_ENV += \ + CPPFLAGS="-I$(LINUX_DIR)/include/uapi -I$(LINUX_DIR)/include" ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y) GST_FSL_PLUGINS_DEPENDENCIES += xlib_libX11
Signature · 1 line
2.0.1
PATCH 1/1 gst-fsl-plugins: fix includes for recent toolchains
Gary, All,
On 2014-07-24 23:42 -0700, Gary Bisson spake thusly:
Quoted 8 lines
Build was failing starting with CodeSourcery 2013.11 due to new v4l kernel headers.
Signed-off-by Gary Bisson <[email protected]>---
Yann, all,
I know this patch will look bad as we already discussed the use of -I instead of -idirafter.
[can you wrap lines at < ~80 chars, please?]
Indeed. WQe should be very (extremely!) carefull with this. Playing with non-sanitised kernel headers is really dangerous, and can come bite you at the most eunexpected moment.
Quoted 1 line
However it has been reported and verified that this package doesn't build using recent toolchain such as CodeSourcery 2013.11.
Care to share a defconfig with which I can reproduce the issue, please? I would like to see if there is not another solution to using -I and keep -idirafter if possible.
Quoted 1 line
It seems to come from the fact that the kernel headers in the toolchain have been updated which brings some incompatibility.
Hmmmm.. I seem to recall with had another such issue reported about CS toolchains a while ago... Can't find it again, however... :-/
Quoted 1 line
Using -idirafter, the v4l header picked up is from the toolchain which is missing some older structures like
v4l2_dbg_chip_ident.
This was removed between 3.10 and 3.11, indeed.
I think the best fix would be something like:
diff --git a/package/gstreamer/gst-fsl-plugins/Config.in b/package/gstreamer/gst-fsl-plugins/Config.in index 309e745..e0d961a 100644
--- a/package/gstreamer/gst-fsl-plugins/Config.in
+++ b/package/gstreamer/gst-fsl-plugins/Config.in
@@ -1,7 +1,7 @@
comment "gst-fsl-plugins needs an imx-specific Linux kernel to be built"
depends on BR2_arm && !BR2_LINUX_KERNEL
-comment "gst-fsl-plugins needs an (e)glibc toolchain" +comment "gst-fsl-plugins needs an (e)glibc toolchain w/ headers < 3.11"
depends on BR2_arm
depends on !BR2_TOOLCHAIN_USES_GLIBC
@@ -10,6 +10,7 @@ config BR2_PACKAGE_GST_FSL_PLUGINS
depends on BR2_LINUX_KERNEL
depends on BR2_arm # Only relevant for i.MX depends on BR2_TOOLCHAIN_USES_GLIBC # libfslcodec
+ depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11 # Old v4l2 API
select BR2_PACKAGE_GST_PLUGINS_BASE select BR2_PACKAGE_LIBFSLVPUWRAP
select BR2_PACKAGE_IMX_LIB
After all, the minimum kernel headers version can be used backward, too. That would need confirmation by others, though...
Regards,
Yann E. MORIN,
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 gst-fsl-plugins: fix includes for recent toolchains
Yann, all,
Quoted 6 lines · Yann E. MORIN
Gary, All,
On 2014-07-24 23:42 -0700, Gary Bisson spake thusly:
Quoted 3 lines
Build was failing starting with CodeSourcery 2013.11 due to new v4l kernel headers.
Quoted 10 lines
Quoted 5 lines
Signed-off-by Gary Bisson <[email protected]>---
Yann, all,
I know this patch will look bad as we already discussed the use of -Iinstead of -idirafter.
[can you wrap lines at < ~80 chars, please?]
My bad, I'll be careful with my comments next time.
Quoted 4 lines
Indeed. WQe should be very (extremely!) carefull with this. Playing with non-sanitised kernel headers is really dangerous, and can come bite you at the most eunexpected moment.
Quoted 8 lines
Quoted 1 line
However it has been reported and verified that this package doesn't
build using recent toolchain such as CodeSourcery 2013.11.
Care to share a defconfig with which I can reproduce the issue, please? I would like to see if there is not another solution to using -I and keep -idirafter if possible.
Please find a defconfig attached.
Quoted 38 lines
It seems to come from the fact that the kernel headers in the toolchain have been updated which brings some incompatibility.
Hmmmm.. I seem to recall with had another such issue reported about CS toolchains a while ago... Can't find it again, however... :-/
Quoted 1 line
Using -idirafter, the v4l header picked up is from the toolchain which
is missing some older structures like
v4l2_dbg_chip_ident.This was removed between 3.10 and 3.11, indeed.
I think the best fix would be something like:
diff --git a/package/gstreamer/gst-fsl-plugins/Config.in b/package/gstreamer/gst-fsl-plugins/Config.in index 309e745..e0d961a 100644 --- a/package/gstreamer/gst-fsl-plugins/Config.in +++ b/package/gstreamer/gst-fsl-plugins/Config.in @@ -1,7 +1,7 @@ comment "gst-fsl-plugins needs an imx-specific Linux kernel to bebuilt"
depends onBR2_arm&& !BR2_LINUX_KERNEL-comment "gst-fsl-plugins needs an (e)glibc toolchain" +comment "gst-fsl-plugins needs an (e)glibc toolchain w/ headers <
3.11"
depends onBR2_arm
depends on !BR2_TOOLCHAIN_USES_GLIBC@@ -10,6 +10,7 @@ config
BR2_PACKAGE_GST_FSL_PLUGINS
depends onBR2_LINUX_KERNEL
depends onBR2_arm# Only relevant for i.MX depends onBR2_TOOLCHAIN_USES_GLIBC# libfslcodec
+ depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11 # Old v4l2 API
selectBR2_PACKAGE_GST_PLUGINS_BASEselectBR2_PACKAGE_LIBFSLVPUWRAP
selectBR2_PACKAGE_IMX_LIB
Quoted 4 lines
After all, the minimum kernel headers version can be used backward, too. That would need confirmation by others, though...
Are we sure we want to limit the toolchain for that? Is there a way to do a "make headers_install" somewhere in staging area?
Thanks,
Gary
Regards,
Quoted 14 lines
Yann E. MORIN,
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
Quoted 2 lines
'------------------------------^-------^------------------^--------------------'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20140725/6a7d05cd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mx6_2013.11_defconfig
Type: application/octet-stream
Size: 44405 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20140725/6a7d05cd/attachment.obj>
PATCH 1/1 gst-fsl-plugins: fix includes for recent toolchains
Gary, All,
On 2014-07-25 10:51 -0700, Gary Bisson spake thusly:
Quoted 2 lines
On Fri, Jul 25, 2014 at 9:40 AM, Yann E. MORIN <[email protected]> wrote:
[--SNIp--]
Quoted 8 lines
Quoted 7 lines
Quoted 1 line
However it has been reported and verified that this package doesn't
build using recent toolchain such as CodeSourcery 2013.11.
Care to share a defconfig with which I can reproduce the issue, please? I would like to see if there is not another solution to using -I and keep -idirafter if possible.
Please find a defconfig attached.
Thanks, I'll give it a spin.
Quoted 14 lines
Quoted 14 lines
diff --git a/package/gstreamer/gst-fsl-plugins/Config.inb/package/gstreamer/gst-fsl-plugins/Config.in
index 309e745..e0d961a 100644
--- a/package/gstreamer/gst-fsl-plugins/Config.in +++ b/package/gstreamer/gst-fsl-plugins/Config.in @@ -10,6 +10,7 @@ configBR2_PACKAGE_GST_FSL_PLUGINS
depends onBR2_LINUX_KERNEL
depends onBR2_arm# Only relevant for i.MX depends onBR2_TOOLCHAIN_USES_GLIBC# libfslcodec
+ depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11 # Old v4l2 API
selectBR2_PACKAGE_GST_PLUGINS_BASEselectBR2_PACKAGE_LIBFSLVPUWRAP
selectBR2_PACKAGE_IMX_LIB
Quoted 4 lines
Quoted 3 lines
After all, the minimum kernel headers version can be used backward, too. That would need confirmation by others, though...
Are we sure we want to limit the toolchain for that?
Well, if gst-fsl-plugins uses the v4l2 API from the kernel version (3.10) but other packages use the v4l2 API from the kernel headers (3.11), there will be a mismatch at some point, no?
Allowing to use different APIs in this way is a way to get unexpected and hard-to-debug failures.
Quoted 1 line
Is there a way to do a "make
headers_install" somewhere in staging area?
No, you do *not* want to overwrite the headers in the toolchain with the ones from the kernel, because the C library depends on them.
So, I believe restricting gst-fsl-plugins to toolchains with the proper v4l2 API is the best solution. I'll cook a proper patch.
Yes, this means we can't use 'recent' toolchains. But anyway, we're already stuck with a 3.10 kernel because Freescale uses that. And there is no guarantee that the C library will accept to run on a kernel older than the version that was used for the headers.
Well, that's possible by default, but glibc can be configured not to support older kernels. So, even if the glibc from this CS toolchain (using a 3.11 kernel for headers) would run on a 3.10, a similar toolchain built with (e.g.) crosstool-NG would not, as by default crosstool-Ng configures the glibc to not support anything older than the kernel version used for the headers.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 gst-fsl-plugins: fix includes for recent toolchains
In reply to Gary BissonDear Gary Bisson,
Quoted 5 lines · Gary Bisson
Build was failing starting with CodeSourcery 2013.11 due to new v4l kernel headers.
Signed-off-by Gary Bisson <[email protected]>
Quoted 10 lines
---
Yann, all,
I know this patch will look bad as we already discussed the use of -I instead of -idirafter.
However it has been reported and verified that this package doesn't build using recent toolchain such as CodeSourcery 2013.11. It seems to come from the fact that the kernel headers in the toolchain have been updated which brings some incompatibility. Using -idirafter, the v4l header picked up is from the toolchain which is missing some older structures likev4l2_dbg_chip_ident. The CPPFLAGS setup is now exactly the same as what is done in Yocto.
Let me know your thoughts.
Thanks,
Gary
Am I correct saying that this patch is superseded by your new
http://patchwork.ozlabs.org/patch/373918/ patch ?
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 gst-fsl-plugins: fix includes for recent toolchains
Thomas, All,
Quoted 17 lines · Thomas Petazzoni
Dear Gary Bisson,
Quoted 8 lines · Gary Bisson
Build was failing starting with CodeSourcery 2013.11 due to new v4l kernel headers.
Signed-off-by Gary Bisson <[email protected]>---
Yann, all,
I know this patch will look bad as we already discussed the use of -Iinstead of -idirafter.
Quoted 1 line
However it has been reported and verified that this package doesn't
build using recent toolchain such as CodeSourcery 2013.11.
Quoted 1 line
It seems to come from the fact that the kernel headers in the toolchain
have been updated which brings some incompatibility.
Quoted 1 line
Using -idirafter, the v4l header picked up is from the toolchain which
Quoted 9 lines
is missing some older structures like
v4l2_dbg_chip_ident.Quoted 4 lines
The CPPFLAGS setup is now exactly the same as what is done in Yocto. Let me know your thoughts.
Thanks,
GaryAm I correct saying that this patch is superseded by your new
http://patchwork.ozlabs.org/patch/373918/ patch ?
Indeed this patch no longer applies.
Thanks,
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20140726/5eb2fdbb/attachment.html>
PATCH 1/1 gst-fsl-plugins: fix includes for recent toolchains
Gary, All,
On 2014-07-26 10:06 -0700, Gary Bisson spake thusly:
Quoted 8 lines
Quoted 5 lines · Thomas Petazzoni
Quoted 2 lines · Gary Bisson
Build was failing starting with CodeSourcery 2013.11 due to new v4l kernel headers.
Am I correct saying that this patch is superseded by your new
http://patchwork.ozlabs.org/patch/373918/ patch ?Indeed this patch no longer applies.
Thanks for confirming. I've marked that patch, as well as 373814, as superseded in Patchwork.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'