After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796885 - gst-plugins-base: Yocto build error: 'gbm.h' not found, 'EGL_PLATFORM_GBM_MESA' undeclared
gst-plugins-base: Yocto build error: 'gbm.h' not found, 'EGL_PLATFORM_GBM_MES...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.14.1
Other Linux
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-07-27 13:23 UTC by n.wesp
Modified: 2018-08-02 02:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch with changes for successfully build (2.85 KB, patch)
2018-07-27 13:23 UTC, n.wesp
none Details | Review
New patch with changes of M.Waters (2.07 KB, patch)
2018-08-01 12:14 UTC, n.wesp
committed Details | Review

Description n.wesp 2018-07-27 13:23:57 UTC
Created attachment 373187 [details] [review]
Patch with changes for successfully build

Hi everybody,

this week I had a problem to build our image with gstreamer.

Since we use 'meta-gstreamer1.0' instead of our layer, the installed version of gstreamer changed from v1.12 to v1.14. Within gstreamer v1.14 gbm is supported by gstreamer1.0-plugins-base_1.14 and will break our build process. Furthermore I get an error because 'EGL_PLATFORM_GBM_MESA' is undefined in 'gst-libs/gst/gl/egl/gstgldisplay_egl.c'.
Note:    This only effect builds with an am335x processor. All builds with an imx6 does build successfully.

Here is a little snipped of the output, I get from yocto:

| In file included from ../../../../../gst-plugins-base-1.14.1/gst-libs/gstgl/egl/gstglcontext_egl.c:55:0:
| ../../../../../gst-plugins-base-1.14.1/gst-libs/gst/gl/egl/../gbm gstglwindow_gbm_egl.h:24:10: fatal error: gbm.h: No such file or directory
|  #include <gbm.h>
|           ^~~~~~~
| compilation terminated.
| Makefile:700: recipe for target 'libgstgl_egl_la-gstglcontext_egl.lo' failed
| make[5]: *** [libgstgl_egl_la-gstglcontext_egl.lo] Error 1
| make[5]: *** Waiting for unfinished jobs....
| ../../../../../gst-plugins-base-1.14.1/gst-libs/gst/gl/egl/gstgldisplay_egl.c: In function 'gst_gl_display_egl_get_from_native':
| ../../../../../gst-plugins-base-1.14.1/gst-libs/gst/gl/egl gstgldisplay_egl.c:157:39: error: 'EGL_PLATFORM_GBM_MESA' undeclared (first use in this function); did you mean 'EGL_PLATFORM_WAYLAND'?
|      ret = _gst_eglGetPlatformDisplay (EGL_PLATFORM_GBM_MESA, (gpointer) display,
|                                        ^~~~~~~~~~~~~~~~~~~~~
|                                        EGL_PLATFORM_WAYLAND
| ../../../../../gst-plugins-base-1.14.1/gst-libs/gst/gl/egl/gstgldisplay_egl.c:157:39: note: each undeclared identifier is reported only once for each function it appears in
| Makefile:693: recipe for target 'libgstgl_egl_la-gstgldisplay_egl.lo' failed
| make[5]: *** [libgstgl_egl_la-gstgldisplay_egl.lo] Error 1

I did some changes to get a complete build without WARNINGs and ERRORs and added that patch to the 'attachment'.

Please have a look to the changes and let me know, if it is okay that way or if I should change it.
Comment 1 Tim-Philipp Müller 2018-07-27 14:15:34 UTC
Have you had a chance to try 1.14.2 yet? Does it happen with that as well?
Comment 2 n.wesp 2018-07-27 14:27:24 UTC
I will have a look next week on monday with 1.14.2.
But with a short look at the files, it should be the same...
I will report on monday!

Have a nice weekend!
Comment 3 Matthew Waters (ystreet00) 2018-07-30 03:15:49 UTC
Review of attachment 373187 [details] [review]:

Not quite :)

::: gst-libs/gst/gl/Makefile.am
@@ +163,3 @@
 	$(GST_ALL_LDFLAGS) \
+	$(GST_LT_LDFLAGS) \
+	$(GBM_LDFLAGS)

$GBM_LDFLAGS) isn't something that's set in configure.  You want to add $(GBM_LIBS) to the libgstgl_@GST_API_VERSION@_la_LIBS variable instead.

::: gst-libs/gst/gl/egl/Makefile.am
@@ +32,3 @@
 	$(GST_LIB_LDFLAGS) \
+	$(GST_ALL_LDFLAGS) \
+	$(GBM_LDFLAGS)

ditto
Comment 4 n.wesp 2018-07-31 08:50:04 UTC
Okay I've tried to use v1.14.2 but therefore I've got more to do.
Basically I copied 'gstreamer1.0-plugins-base_1.14.1.bb' to 'gstreamer1.0-plugins-base_1.14.2.bb' and 'gstreamer1.0_1.14.1.bb' to 'gstreamer1.0_1.14.2.bb'. Then just changed the sha256sum so that it fits to v1.14.2. (og both, plugins-base and gstreamer itself).
Furthermore I had to delete the used patches in '*.bb' and '*.bb_append' files for gstreamer. Without deleting them, the build will fail because of patches, which can't be applied.
After deleting the patches I get another error, which I can't clear right now. So maybe you can help me in this case.

Error message is large, because of these many includes:
| ../../../arm-phytec-linux-gnueabi-libtool  --tag=CC   --mode=compile arm-phytec-linux-gnueabi-gcc  -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a8 --sysroot=/home/wesp/yocto/rocko-next/build/tmp/work/cortexa8hf-neon-phytec-linux-gnueabi/gstreamer1.0-plugins-base/1.14.2-r0/recipe-sysroot -DHAVE_CONFIG_H -I. -I../../../../gst-plugins-base-1.14.2/gst-libs/gst/video -I../../..    -I../../../../gst-plugins-base-1.14.2/gst-libs -I../../../gst-libs -pthread -I/home/wesp/yocto/rocko-next/build/tmp/work/cortexa8hf-neon-phytec-linux-gnueabi/gstreamer1.0-plugins-base/1.14.2-r0/recipe-sysroot/usr/include/gstreamer-1.0 -I/home/wesp/yocto/rocko-next/build/tmp/work/cortexa8hf-neon-phytec-linux-gnueabi/gstreamer1.0-plugins-base/1.14.2-r0/recipe-sysroot/usr/include/glib-2.0 -I/home/wesp/yocto/rocko-next/build/tmp/work/cortexa8hf-neon-phytec-linux-gnueabi/gstreamer1.0-plugins-base/1.14.2-r0/recipe-sysroot/usr/lib/glib-2.0/include -pthread -I/home/wesp/yocto/rocko-next/build/tmp/work/cortexa8hf-neon-phytec-linux-gnueabi/gstreamer1.0-plugins-base/1.14.2-r0/recipe-sysroot/usr/include/glib-2.0 -I/home/wesp/yocto/rocko-next/build/tmp/work/cortexa8hf-neon-phytec-linux-gnueabi/gstreamer1.0-plugins-base/1.14.2-r0/recipe-sysroot/usr/lib/glib-2.0/include -pthread -I/home/wesp/yocto/rocko-next/build/tmp/work/cortexa8hf-neon-phytec-linux-gnueabi/gstreamer1.0-plugins-base/1.14.2-r0/recipe-sysroot/usr/include/gstreamer-1.0 -I/home/wesp/yocto/rocko-next/build/tmp/work/cortexa8hf-neon-phytec-linux-gnueabi/gstreamer1.0-plugins-base/1.14.2-r0/recipe-sysroot/usr/include/glib-2.0 -I/home/wesp/yocto/rocko-next/build/tmp/work/cortexa8hf-neon-phytec-linux-gnueabi/gstreamer1.0-plugins-base/1.14.2-r0/recipe-sysroot/usr/lib/glib-2.0/include  -fno-strict-aliasing -DG_THREADS_MANDATORY -DG_DISABLE_CAST_CHECKS -Wall -Wdeclaration-after-statement -Wvla -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar -Wnested-externs       -fvisibility=hidden -I/home/wesp/yocto/rocko-next/build/tmp/work/cortexa8hf-neon-phytec-linux-gnueabi/gstreamer1.0-plugins-base/1.14.2-r0/recipe-sysroot/usr/include/orc-0.4 -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/wesp/yocto/rocko-next/build/tmp/work/cortexa8hf-neon-phytec-linux-gnueabi/gstreamer1.0-plugins-base/1.14.2-r0=/usr/src/debug/gstreamer1.0-plugins-base/1.14.2-r0 -fdebug-prefix-map=/home/wesp/yocto/rocko-next/build/tmp/work/cortexa8hf-neon-phytec-linux-gnueabi/gstreamer1.0-plugins-base/1.14.2-r0/recipe-sysroot-native= -fdebug-prefix-map=/home/wesp/yocto/rocko-next/build/tmp/work/cortexa8hf-neon-phytec-linux-gnueabi/gstreamer1.0-plugins-base/1.14.2-r0/recipe-sysroot=  -c -o libgstvideo_1.0_la-video-enumtypes.lo `test -f 'video-enumtypes.c' || echo '../../../../gst-plugins-base-1.14.2/gst-libs/gst/video/'`video-enumtypes.c
| make[5]: *** No rule to make target '/usr/bin/g-ir-scanner-wrapper', needed by 'GstVideo-1.0.gir'.  Stop.
| make[5]: *** Waiting for unfinished jobs....

Maybe it could be possible, that anyone can create working 'gstreamer1.0-plugins-base_1.14.2.bb' and 'gstreamer1.0_1.14.2.bb' files?
Or maybe all available gstreamer*.bb files updated to v1.14.2?

Thanks and best regards!
Comment 5 n.wesp 2018-07-31 08:59:41 UTC
(In reply to Matthew Waters (ystreet00) from comment #3)
> Review of attachment 373187 [details] [review] [review]:
> 
> Not quite :)
> 
> ::: gst-libs/gst/gl/Makefile.am
> @@ +163,3 @@
>  	$(GST_ALL_LDFLAGS) \
> +	$(GST_LT_LDFLAGS) \
> +	$(GBM_LDFLAGS)
> 
> $GBM_LDFLAGS) isn't something that's set in configure.  You want to add
> $(GBM_LIBS) to the libgstgl_@GST_API_VERSION@_la_LIBS variable instead.
> 
> ::: gst-libs/gst/gl/egl/Makefile.am
> @@ +32,3 @@
>  	$(GST_LIB_LDFLAGS) \
> +	$(GST_ALL_LDFLAGS) \
> +	$(GBM_LDFLAGS)
> 
> ditto

So my changes within your update looks okay?
Will the main repo with v1.14.1 be updated, so that I don't have to add an patch in a '*.bb_append' file?
Comment 6 Matthew Waters (ystreet00) 2018-08-01 02:05:29 UTC
(In reply to n.wesp from comment #5)
> (In reply to Matthew Waters (ystreet00) from comment #3)
> > Review of attachment 373187 [details] [review] [review] [review]:
> > 
> > Not quite :)
> > 
> > ::: gst-libs/gst/gl/Makefile.am
> > @@ +163,3 @@
> >  	$(GST_ALL_LDFLAGS) \
> > +	$(GST_LT_LDFLAGS) \
> > +	$(GBM_LDFLAGS)
> > 
> > $GBM_LDFLAGS) isn't something that's set in configure.  You want to add
> > $(GBM_LIBS) to the libgstgl_@GST_API_VERSION@_la_LIBS variable instead.
> > 
> > ::: gst-libs/gst/gl/egl/Makefile.am
> > @@ +32,3 @@
> >  	$(GST_LIB_LDFLAGS) \
> > +	$(GST_ALL_LDFLAGS) \
> > +	$(GBM_LDFLAGS)
> > 
> > ditto
> 
> So my changes within your update looks okay?
> Will the main repo with v1.14.1 be updated, so that I don't have to add an
> patch in a '*.bb_append' file?

Ah, actually. GBM_CFLAGS/LIBS should be added to GL_CFLAGS/LIBS in m4/gst-gl.m4 instead alongside the DRM_CFLAGS addition.

If you want to create a patch for that, I can merge it into the main repo :)
Comment 7 n.wesp 2018-08-01 12:14:05 UTC
Created attachment 373238 [details] [review]
New patch with changes of M.Waters
Comment 8 Matthew Waters (ystreet00) 2018-08-02 02:19:50 UTC
commit 27aa3c2fc18567f93b8e1d99ca5b9d24124ee085
Author: Norbert Wesp <n.wesp@phytec.de>
Date:   Wed Aug 1 13:59:45 2018 +0200

    Add GBM_CFLAGS and define EGL_PLATFORM_GBM_MESA
    
    Building an image with yocto for an 'am335x' processor will fail,
    because 'gbm.h' can not be found and 'EGL_PLATFORM_GBM_MESA' is not defined.
    
    So simply adding define of 'EGL_PLATFORM_GBM_MESA' in 'gstgldisplay_egl.c'
    and adding 'GBM_CFLAGS' in 'gst-gl.m4' to get rid of this errors and complete
    a full build process.
    
    ERRORs were:
    -----------
    gst-plugins-base-1.14.1/gst-libs/gst/gl/gbm/gstglwindow_gbm_egl.h:24:10:
    fatal error: gbm.h: No such file or directory
      #include <gbm.h>
               ^~~~~~~
    
    gst-plugins-base-1.14.1/gst-libs/gst/gl/egl/gstgldisplay_egl.c:157:39:
    error: 'EGL_PLATFORM_GBM_MESA' undeclared (first use in this function);
    did you mean 'EGL_PLATFORM_WAYLAND'?
      ret = _gst_eglGetPlatformDisplay (EGL_PLATFORM_GBM_MESA, (gpointer) display,
                                        ^~~~~~~~~~~~~~~~~~~~~
    
    https://bugzilla.gnome.org/show_bug.cgi?id=796885