gst-plugins-bad: avtp: how to notify meson to use custom kernel header

Desouza, Ederson ederson.desouza at intel.com
Wed Jul 15 19:22:15 UTC 2020


Hi,

On Wed, 2020-07-15 at 14:50 -0400, John Rama wrote:
> Thank you Nirbheek for your comment.
> 
> > ```
> > Command line:  cc -I/usr/src/linux-headers-4.19.0-hoge/include
> > /home/makoto/Work/src/gstreamer/gst-build-master/build/meson-private/tmp1wwu5_s0/testfile.c
> > -o /home/makoto/Work/src/gstreamer/gst-build-master/build/meson-private/tmp1wwu5_s0/output.obj
> > -pipe -
> > c -D_FILE_OFFSET_BITS=64 -O0
> > 
> > Code:
> >  #include <linux/net_tstamp.h>
> >         void bar(void) {
> >             sizeof(struct sock_txtime);
> >         };
> > Compiler stdout:
> > 
> > Compiler stderr:
> >  /home/makoto/Work/src/gstreamer/gst-build-master/build/meson-private/tmp1wwu5_s0/testfile.c:
> > In function 'bar':
> > /home/makoto/Work/src/gstreamer/gst-build-master/build/meson-private/tmp1wwu5_s0/testfile.c:3:20:
> > error: invalid application of 'sizeof' to incomplete type 'struct
> > sock_txtime'
> >              sizeof(struct sock_txtime);
> >                     ^~~~~~
> > 
> > Checking for type "struct sock_txtime" : NO
> > ```
> 
> First of all, my apology.  
> 
> There was a typo on specifying the CFLAGS when generating the log file I've attached last mail.
> It should be '-I/usr/src/linux-headers-4.19.0-hoge1/include'
> 
> Here is the log output with correct CFLAGS.
> 
> ===================================================
> Compiler stderr:
>  In file included from /usr/src/linux-headers-4.19.0-hoge1/include/linux/kernel.h:7:0,
>                  from /usr/src/linux-headers-4.19.0-hoge1/include/linux/uio.h:12,
>                  from /usr/src/linux-headers-4.19.0-hoge1/include/linux/socket.h:8,
>                  from /usr/src/linux-headers-4.19.0-hoge1/include/linux/net_tstamp.h:14,
>                  from /home/makoto/Work/src/gstreamer/gst-build-master/build3/meson-private/tmp3nzndj9f/testfile.c:1:
> /usr/src/linux-headers-4.19.0-hoge1/include/linux/linkage.h:8:25: fatal error: asm/linkage.h: No such file or directory
>  #include <asm/linkage.h>
>                          ^
> compilation terminated.
> 
> ===================================================
> 
> With this log info, I realized I should not use kernel header to build the user space app, but should use libc header.
> 
> So, in summary, I could build avtp plugin with following steps.(I'm using debian stretch)
> 
> ----------------------------------------------------------------------------------
> (Assuming that your kernel source tree has the version of 4.19.)
> 1. create linux-libc-dev packge
>    $make deb-pkg LOCALVERSION=-hoge1  -j10
>    This will generate linux-libc-dev_4.19.0-hoge1-3_amd64.deb as well as other packages including kernel image and kernel header.
> 2. install linux-libc-dev package
>    sudo  dpkg -x linux-libc-dev_4.19.0-hoge1-3_amd64.deb /usr/src/linux-libc-dev_4.19.0-hoge1-3/
> 3. linux/net_tstamp.h of kernel 4.19 has bug. Fix it. 
>    https://patchwork.ozlabs.org/project/buildroot/patch/20181129214730.7225-1-fontaine.fabrice@gmail.com/
>    -	clockid_t	clockid;	/* reference clockid */
>    +	__kernel_clockid_t	clockid;/* reference clockid */
> 4. run meson
>   CFLAGS='-I/usr/src/linux-libc-dev_4.19.0-hoge1-3/usr/include/' meson build
> ----------------------------------------------------------------------------------
> 

Glad that you managed to solve the issue - but this hint may be useful
for the next time:  

`make INSTALL_HDR_PATH=<path_where_to_install_headers> headers_install`

On the Linux source. It should install the appropriate kernel headers
for the kernel source you have.
Then, with CFLAGS='-I<path_where_to_install_headers>/include',
everything should be fine.

> Thanks for everyone for the help. I'm glad to close this thread.
> 
> John
> 
> 


More information about the gstreamer-devel mailing list