Skip to content

fix(cmake): link missing static deps for GStreamer opengl plugin - #15188

Closed
ttr-007 wants to merge 1 commit into
mavlink:Stable_V5.0from
ttr-007:fix/gstreamer-opengl-plugin-static-link-deps
Closed

ttr-007 wants to merge 1 commit into
mavlink:Stable_V5.0from
ttr-007:fix/gstreamer-opengl-plugin-static-link-deps

Conversation

@ttr-007

@ttr-007 ttr-007 commented Sep 26, 2026

Copy link
Copy Markdown

Summary

  • The statically-linked gstopengl GStreamer plugin has no pkg-config file, so FindGStreamer.cmake falls back to a bare find_library() call that only adds the plugin archive itself, with no transitive dependencies.
  • Internally gstopengl links against graphene, libpng, libjpeg, and gstreamer-controller-1.0 — none of which were being linked in, causing undefined-symbol link errors whenever the opengl plugin is enabled (e.g. QGC_ENABLE_HERELINK=ON on Android, currently the only way to build against Qt 6.6.3 / minSdk 25 for Android 7.1–8.x support, per #13371).
  • This adds the four missing static libraries to GStreamer::Plugins whenever opengl is in GSTREAMER_PLUGINS.

How this was found

Building QGroundControl for Android arm64-v8a on Stable_V5.0 with Qt 6.6.3 (-DQGC_ENABLE_HERELINK=ON, matching .github/workflows/android-linux-qt6.6.3.yml) compiled cleanly (~400+ translation units) but failed at the final link step. The four missing symbols surfaced one at a time as each was fixed and relinked:

Missing symbols From Library
graphene_matrix_*, graphene_plane_* gstgltransformation.c libgraphene-1.0.a
png_read_info, png_get_IHDR, etc. gstgloverlay.c libpng16.a
jpeg_read_header, jpeg_start_decompress, etc. gstgloverlay.c libjpeg.a
gst_proxy_control_binding_new gstglsinkbin.c / gstglvideomixer.c libgstcontroller-1.0.a

Note: GStreamer does ship graphene-gobject-1.0.pc etc., but the embedded prefix= in those .pc files is hard-coded to the original Cerbero build machine's path, so pkg_check_modules can't resolve them — hence using find_library() directly here, consistent with the existing fallback pattern in this file.

After applying this fix, the build linked and packaged successfully, producing an installable minSdkVersion=25 APK verified via aapt dump badging.

Test plan

  • Configured and built QGroundControl for Android arm64-v8a, Qt 6.6.3, Stable_V5.0, with QGC_ENABLE_HERELINK=ON
  • Build linked and packaged successfully (previously failed with undefined-symbol errors)
  • Verified output APK with aapt dump badging (sdkVersion:'25', native-code: 'arm64-v8a')
  • Not tested on Linux/macOS CI runners — the underlying issue should reproduce there too since it's not platform-specific, but I only verified on Windows

🤖 Generated with Claude Code

The statically-linked gstopengl plugin has no pkg-config file, so
FindGStreamer.cmake falls back to a bare find_library() call that
only adds the plugin archive itself, with no transitive dependencies.
Internally gstopengl links against graphene, libpng, libjpeg, and
gstreamer-controller-1.0, none of which were being linked in, causing
undefined-symbol link errors whenever the opengl plugin is enabled
(e.g. QGC_ENABLE_HERELINK=ON on Android, which is currently the only
way to build against Qt 6.6.3 / minSdk 25 for Android 7.1-8.x support).

Reproduced building QGroundControl for Android arm64-v8a on
Stable_V5.0 with Qt 6.6.3; the four symbols surfaced one at a time
as each was fixed and relinked.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the CMake label Sep 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your first pull request! 🎉

A maintainer will review this soon. Please ensure:

  • CI checks pass
  • Code follows coding standards
  • Changes tested on relevant platforms

We appreciate your contribution to QGroundControl!

@ttr-007

ttr-007 commented Sep 26, 2026

Copy link
Copy Markdown
Author

Closing — keeping this fix on my fork only for now, not intending to merge upstream at this time.

@ttr-007 ttr-007 closed this Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant