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

Nirbheek Chauhan nirbheek.chauhan at gmail.com
Wed Jul 15 13:23:32 UTC 2020


On Wed, Jul 15, 2020 at 4:00 AM John Rama <john.rama01 at gmail.com> wrote:
> >>> Did you try something like `CFLAGS='-I/usr/src/linux-headers-4.19.0' meson build`?
> >>>
> >> Yes, I tried but no success..
> >
> > Could you please share the meson-log.txt for this case, or at least the
> > relevant part, where it tries to compile the check for the struct?
> >
> Sure.
>
> I attached it. This is the result of
> $CFLAGS='-I/usr/src/linux-headers-4.19.0-hoge/include' meson build
> (Actually linux/net_tstamp.h is located under /usr/src/linux-headers-4.19.0-hoge/include)
>

This is the relevant part:

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

That command line looks correct. The code is also correct since it
detects the struct correctly on my system. So this is not a meson
issue, really. Need to figure out what gcc is doing. Try saving that
code into a file called testfile.c and run the compiler check by hand:

cc -I/usr/src/linux-headers-4.19.0-hoge/include testfile.c -o
output.obj -pipe -c -D_FILE_OFFSET_BITS=64 -O0

It should fail in the same way. Then you need to figure out whether
gcc is including the right file or not. One way is by debugging the
include order by adding -v:

cc -v -I/usr/src/linux-headers-4.19.0-hoge/include testfile.c -o
output.obj -pipe -c -D_FILE_OFFSET_BITS=64 -O0

Maybe try using -isystem instead of -I, etc. If that doesn't help, you
can edit the include files and add #message directives to figure out
what's happening.

I will close that meson issue since it's not a meson bug.

Cheers,
Nirbheek


More information about the gstreamer-devel mailing list