All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] gst-fsl-plugins: fix includes for recent toolchains
@ 2014-07-25  6:42 Gary Bisson
  2014-07-25 16:40 ` Yann E. MORIN
  2014-07-26  7:34 ` Thomas Petazzoni
  0 siblings, 2 replies; 7+ messages in thread
From: Gary Bisson @ 2014-07-25  6:42 UTC (permalink / raw)
  To: buildroot

Build was failing starting with CodeSourcery 2013.11 due to
new v4l kernel headers.

Signed-off-by: Gary Bisson <bisson.gary@gmail.com>

---
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(-)

diff --git a/package/gstreamer/gst-fsl-plugins/gst-fsl-plugins.mk b/package/gstreamer/gst-fsl-plugins/gst-fsl-plugins.mk
index 1ae6596..b441233 100644
--- a/package/gstreamer/gst-fsl-plugins/gst-fsl-plugins.mk
+++ b/package/gstreamer/gst-fsl-plugins/gst-fsl-plugins.mk
@@ -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
-- 
2.0.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] gst-fsl-plugins: fix includes for recent toolchains
  2014-07-25  6:42 [Buildroot] [PATCH] gst-fsl-plugins: fix includes for recent toolchains Gary Bisson
@ 2014-07-25 16:40 ` Yann E. MORIN
  2014-07-25 17:51   ` Gary Bisson
  2014-07-26  7:34 ` Thomas Petazzoni
  1 sibling, 1 reply; 7+ messages in thread
From: Yann E. MORIN @ 2014-07-25 16:40 UTC (permalink / raw)
  To: buildroot

Gary, All,

On 2014-07-24 23:42 -0700, Gary Bisson spake thusly:
> Build was failing starting with CodeSourcery 2013.11 due to
> new v4l kernel headers.
> 
> Signed-off-by: Gary Bisson <bisson.gary@gmail.com>
> 
> ---
> 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.

> 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.

> 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... :-/

> 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,

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] gst-fsl-plugins: fix includes for recent toolchains
  2014-07-25 16:40 ` Yann E. MORIN
@ 2014-07-25 17:51   ` Gary Bisson
  2014-07-25 20:38     ` Yann E. MORIN
  0 siblings, 1 reply; 7+ messages in thread
From: Gary Bisson @ 2014-07-25 17:51 UTC (permalink / raw)
  To: buildroot

Yann, all,

On Fri, Jul 25, 2014 at 9:40 AM, Yann E. MORIN <yann.morin.1998@free.fr>
wrote:

> Gary, All,
>
> On 2014-07-24 23:42 -0700, Gary Bisson spake thusly:
> > Build was failing starting with CodeSourcery 2013.11 due to
> > new v4l kernel headers.
> >
> > Signed-off-by: Gary Bisson <bisson.gary@gmail.com>
> >
> > ---
> > 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?]
>
>
My bad, I'll be careful with my comments next time.


> 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.
>
> > 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.

> 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... :-/
>
> > 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...
>
>
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,
> 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.  |
>
> '------------------------------^-------^------------------^--------------------'
>
-------------- 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>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] gst-fsl-plugins: fix includes for recent toolchains
  2014-07-25 17:51   ` Gary Bisson
@ 2014-07-25 20:38     ` Yann E. MORIN
  0 siblings, 0 replies; 7+ messages in thread
From: Yann E. MORIN @ 2014-07-25 20:38 UTC (permalink / raw)
  To: buildroot

Gary, All,

On 2014-07-25 10:51 -0700, Gary Bisson spake thusly:
> On Fri, Jul 25, 2014 at 9:40 AM, Yann E. MORIN <yann.morin.1998@free.fr>
> wrote:
[--SNIp--]
> > > 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.

> >     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
> >     @@ -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...
> >
> 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.

> 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.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] gst-fsl-plugins: fix includes for recent toolchains
  2014-07-25  6:42 [Buildroot] [PATCH] gst-fsl-plugins: fix includes for recent toolchains Gary Bisson
  2014-07-25 16:40 ` Yann E. MORIN
@ 2014-07-26  7:34 ` Thomas Petazzoni
  2014-07-26 17:06   ` Gary Bisson
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2014-07-26  7:34 UTC (permalink / raw)
  To: buildroot

Dear Gary Bisson,

On Thu, 24 Jul 2014 23:42:16 -0700, Gary Bisson wrote:
> Build was failing starting with CodeSourcery 2013.11 due to
> new v4l kernel headers.
> 
> Signed-off-by: Gary Bisson <bisson.gary@gmail.com>
> 
> ---
> 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

Am I correct saying that this patch is superseded by your new
http://patchwork.ozlabs.org/patch/373918/ patch ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] gst-fsl-plugins: fix includes for recent toolchains
  2014-07-26  7:34 ` Thomas Petazzoni
@ 2014-07-26 17:06   ` Gary Bisson
  2014-07-26 17:13     ` Yann E. MORIN
  0 siblings, 1 reply; 7+ messages in thread
From: Gary Bisson @ 2014-07-26 17:06 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On Sat, Jul 26, 2014 at 12:34 AM, Thomas Petazzoni <
thomas.petazzoni@free-electrons.com> wrote:

> Dear Gary Bisson,
>
> On Thu, 24 Jul 2014 23:42:16 -0700, Gary Bisson wrote:
> > Build was failing starting with CodeSourcery 2013.11 due to
> > new v4l kernel headers.
> >
> > Signed-off-by: Gary Bisson <bisson.gary@gmail.com>
> >
> > ---
> > 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
>
> 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,
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20140726/5eb2fdbb/attachment.html>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] gst-fsl-plugins: fix includes for recent toolchains
  2014-07-26 17:06   ` Gary Bisson
@ 2014-07-26 17:13     ` Yann E. MORIN
  0 siblings, 0 replies; 7+ messages in thread
From: Yann E. MORIN @ 2014-07-26 17:13 UTC (permalink / raw)
  To: buildroot

Gary, All,

On 2014-07-26 10:06 -0700, Gary Bisson spake thusly:
> On Sat, Jul 26, 2014 at 12:34 AM, Thomas Petazzoni <
> thomas.petazzoni at free-electrons.com> wrote:
> > On Thu, 24 Jul 2014 23:42:16 -0700, Gary Bisson wrote:
> > > 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.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-07-26 17:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-25  6:42 [Buildroot] [PATCH] gst-fsl-plugins: fix includes for recent toolchains Gary Bisson
2014-07-25 16:40 ` Yann E. MORIN
2014-07-25 17:51   ` Gary Bisson
2014-07-25 20:38     ` Yann E. MORIN
2014-07-26  7:34 ` Thomas Petazzoni
2014-07-26 17:06   ` Gary Bisson
2014-07-26 17:13     ` Yann E. MORIN

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.