All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Longchamp, Valentin" <Valentin.Longchamp@keymile.com>
To: "yocto@yoctoproject.org" <yocto@yoctoproject.org>
Cc: "Brunck, Holger" <Holger.Brunck@keymile.com>
Subject: Custom kernel headers and SDK
Date: Tue, 8 Dec 2015 22:06:29 +0100	[thread overview]
Message-ID: <688824bb-bfed-4888-8e46-a64338f1db97@keymile.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3092 bytes --]

Hello,

We are currently migrating our Embedded Linux software and the corresponding
small in house distribution to Yocto. We are small Linux team and we provide and
maintain the toolchain, kernel and base distribution for a broader team of
software developers that build the applications for our hardware.

So far, we have been able to use Yocto to build our whole software (kernel,
minimal distribution and application software) by adding our minimal meta-layer
and defining stuff there and it works great.

Since the application devs are "not interested" in our distro nor in the
compiler, we want to make them available for them thanks to the SDK which is a
great fit for this use case. So far it works very well and we are currently
working on adapting the build system to the SDK.

And here comes my question. We have however our own kernel sources that extend
the headers for a few "in-house" drivers. From the warning in linux-libc-headers
(http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc),
I understand that it should be avoided to recreate a recipe for the kernel
headers to avoid having the libc "machinified". From yocto, I could get the
custom headers thanks to STAGING_KERNEL_DIR. However, we need these custom
headers from "outside" of yocto, when using the SDK.

I have found 2 ways to install them into the sysroot and thus SDK:
- either by adding the kernel-devsrc to the SDK that installs them into
/usr/src/kernel by default.
- or by adding something similar to what is proposed in this mailing-list
discussion to our kernel recipe:
https://lists.yoctoproject.org/pipermail/linux-yocto/2014-April/002178.html

The problem with these 2 solutions is that sysroot contains:
1) the sanitized kernel headers at in sysroot/usr/include/linux
2) our custom headers at sysroot/usr/src/kernel/include/linux

and when I add a -I option in the CFLAGS for 2), I get conflicts since the SDK
automatically looks first in sysroot/usr/include.

Here is an example of the current errors I get with 1) and 2) in both the -I path:

>                  from plat/icndrv/hdlc/mpc8xxx_scc/src/libhdlc-km.c:2:
> /opt/work/ppc-toolchain/sysroots/powerpc-oe-linux/usr/src/kernel/include/linux/types.h:14:26: error: conflicting types for 'fd_set'
>  typedef __kernel_fd_set  fd_set;
>                           ^
> In file included from /opt/work/ppc-toolchain/sysroots/powerpc-oe-linux/usr/include/sys/types.h:219:0,
>                  from /opt/work/ppc-toolchain/sysroots/powerpc-oe-linux/usr/include/sys/uio.h:23,
>                  from /opt/work/ppc-toolchain/sysroots/powerpc-oe-linux/usr/include/sys/socket.h:26,
>                  from plat/icndrv/hdlc/mpc8xxx_scc/src/libhdlc-km.c:1:
> /opt/work/ppc-toolchain/sysroots/powerpc-oe-linux/usr/include/sys/select.h:75:5: note: previous declaration of 'fd_set' was here
>    } fd_set;

What would be the correct "yocto" way of solving our current problem with our
custom headers to be added to the SDK ?

Thanks

Valentin

[-- Attachment #2: Type: text/html, Size: 4225 bytes --]

             reply	other threads:[~2015-12-08 21:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 21:06 Longchamp, Valentin [this message]
2015-12-09 16:40 ` Custom kernel headers and SDK Vuille, Martin (Martin)
2015-12-10  9:46   ` Longchamp, Valentin
2015-12-10 14:40     ` Vuille, Martin (Martin)
2015-12-10 14:53       ` William Mills
2015-12-14  7:37         ` Valentin Longchamp

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=688824bb-bfed-4888-8e46-a64338f1db97@keymile.com \
    --to=valentin.longchamp@keymile.com \
    --cc=Holger.Brunck@keymile.com \
    --cc=yocto@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.