[linux-yocto] Difference in sysroots and work linux include file

Bruce Ashfield bruce.ashfield at windriver.com
Mon Apr 7 07:11:37 PDT 2014


On 14-04-07 08:10 AM, Sathish Kumar Balasubramaniam -ERS, HCL Tech wrote:
> I am using Dora version of Yocto with my BSP.
>
> There is a compilation issue and the cause is certain values
> (V4L2_MBUS_FMT_ARGB8888_1X32  and V4L2_MBUS_FMT_AYUV8_1X32) not defined
> in the following file
>
> build/tmp/sysroots/<machine>/usr/include/linux/v4l2-mediabus.h
>
> which is needed by media-ctl’s v4l2subdev.c file.
>
> There are 3 different versions of this file
>
> 1.
> build/tmp/sysroots/<machine>/usr/include/linux/v4l2-mediabus.h
>                  - needed values not present. Include path set to this
> for compilation of media-ctl

This is the linux-libc-headers header file. They are sanitized and
based off a given kernel's pristine source. This is for the toolchain
(glibc) and all applications in the system using those interfaces.

>
> 2.
> build/tmp/sysroots/<machine>/usr/src/kernel/include/linux/v4l2-mediabus.h
>                  - needed values present. Same as (3) file
>
> 3.
> build/tmp/work/<machine>-poky-linux-gnueabi/linux-yocto/3.4+git<srcrev>/git/include/linux/v4l2-mediabus.h
>                  - needed values present. Same as (2) file

#2 and #3 are the actual kernel sources in the sysroot. They contain
changes that have been patched into the files.

>
> My doubt is why the above files are different ? why the (1) file is not
> the same (2) or (3) ? which yocto config is creating this ?

See above. #1 is NOT supposed to match #2 and #3, it is part of the 
toolchain
and stays consistent over time.

Patching the kernel and exporting it over these headers is incorrect
and has been discussed on the mailing lists many times. Richard has
a warning and explanation in the libc-headers.inc file:

#########################################################################
####                        PLEASE READ
#########################################################################
#
# You're probably looking here thinking you need to create some new copy
# of linux-libc-headers since you have your own custom kernel. To put
# this simply, you DO NOT.
#
# Why? These headers are used to build the libc. If you customise the
# headers you are customising the libc and the libc becomes machine
# specific. Most people do not add custom libc extensions to the kernel
# and have a machine specific libc.
#
# But you have some kernel headers you need for some driver? That is fine
# but get them from STAGING_KERNEL_DIR where the kernel installs itself.
# This will make the package using them machine specific but this is much
# better than having a machine specific C library. This does mean your
# recipe needs a DEPENDS += "virtual/kernel" but again, that is fine and
# makes total sense.
#
# There can also be a case where your kernel extremely old and you want
# an older libc ABI for that old kernel. The headers installed by this
# recipe should still be a standard mainline kernel, not your own custom
# one.
#
# -- RP



>
> I though the (3) file should have been copied to (1) and (2). Looks its
> different.
>
> For my problem, either I need to change the compilation include path
> (where I need to change ?) or fix this difference issue (how ?)

Your application needs to look in the STAGING_KERNEL_DIR structure (#2
and #3 in your list) for the header file.

Cheers,

Bruce

>
> Anyone has any faced this issue before ?
>
> Regards,
>
> B.Sathish Kumar
>
>
>
> ::DISCLAIMER::
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
> The contents of this e-mail and any attachment(s) are confidential and
> intended for the named recipient(s) only.
> E-mail transmission is not guaranteed to be secure or error-free as
> information could be intercepted, corrupted,
> lost, destroyed, arrive late or incomplete, or may contain viruses in
> transmission. The e mail and its contents
> (with or without referred errors) shall therefore not attach any
> liability on the originator or HCL or its affiliates.
> Views or opinions, if any, presented in this email are solely those of
> the author and may not necessarily reflect the
> views or opinions of HCL or its affiliates. Any form of reproduction,
> dissemination, copying, disclosure, modification,
> distribution and / or publication of this message without the prior
> written consent of authorized representative of
> HCL is strictly prohibited. If you have received this email in error
> please delete it and notify the sender immediately.
> Before opening any email and/or attachments, please check them for
> viruses and other defects.
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
>
>



More information about the linux-yocto mailing list