gl: rpi bcm_host dependency of gstgl is not automatically passed to dependent binaries
Hi,
I'm cross-compiling GStreamer 1.18 for RPi board using sysroot directory.
In order to do that I'm using following stanzas in my cross-file:
...
[properties]
sys_root = '/opt/rpi/sysroot/'
pkg_config_libdir = ['/opt/rpi/sysroot/usr/lib/pkgconfig/', '/opt/rpi/sysroot/usr/share/pkgconfig/', '/opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig/', '/opt/rpi/sysroot/opt/vc/lib/pkgconfig/']
...
The .../opt/vc/lib/pkgconfig/
entry in cross-file lets meson.build to detect bcm_host
library and link against it.
However bcm_host
dependency is not explicitly passed to gstgl-dependent binaries.
Some of them check for bcm_host_dep
explicitly, i.e. opengl and omx.
But the approach used doesn't scale well and there are bunch of examples that failed to built due to missing bcm_host
on link stage, i.e 3dvideo:
/usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: warning: libbcm_host.so, needed by subprojects/gst-plugins-base/gst-libs/gst/gl/libgstgl-1.0.so.0.1800.0, not found (try using -rpath or -rpath-link)
/usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: subprojects/gst-plugins-base/gst-libs/gst/gl/libgstgl-1.0.so.0.1800.0: undefined reference to `vc_dispmanx_display_open'
/usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: subprojects/gst-plugins-base/gst-libs/gst/gl/libgstgl-1.0.so.0.1800.0: undefined reference to `vc_dispmanx_element_remove'
/usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: subprojects/gst-plugins-base/gst-libs/gst/gl/libgstgl-1.0.so.0.1800.0: undefined reference to `graphics_get_display_size'
/usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: subprojects/gst-plugins-base/gst-libs/gst/gl/libgstgl-1.0.so.0.1800.0: undefined reference to `vc_dispmanx_display_close'
/usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: subprojects/gst-plugins-base/gst-libs/gst/gl/libgstgl-1.0.so.0.1800.0: undefined reference to `vc_dispmanx_update_submit_sync'
/usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: subprojects/gst-plugins-base/gst-libs/gst/gl/libgstgl-1.0.so.0.1800.0: undefined reference to `vc_dispmanx_element_add'
/usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: subprojects/gst-plugins-base/gst-libs/gst/gl/libgstgl-1.0.so.0.1800.0: undefined reference to `vc_dispmanx_element_change_attributes'
/usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: subprojects/gst-plugins-base/gst-libs/gst/gl/libgstgl-1.0.so.0.1800.0: undefined reference to `vc_dispmanx_update_start'
collect2: error: ld returned 1 exit status
I've ended up with the patch: bcm_host_dep.patch but I'm not sure it that's a best solution.