Skip to content

gstreamer1: fix build failures when cross-compiling#29519

Open
dangowrt wants to merge 1 commit into
openwrt:masterfrom
dangowrt:gstreamer1-fix-build
Open

gstreamer1: fix build failures when cross-compiling#29519
dangowrt wants to merge 1 commit into
openwrt:masterfrom
dangowrt:gstreamer1-fix-build

Conversation

@dangowrt
Copy link
Copy Markdown
Member

📦 Package Details

Maintainer: @thess @flyn-org

Description:

Fixes two pre-existing issues that prevented gstreamer1 from building on some host/target combinations:

  • meson.build probed for the Solaris/Illumos networking libraries (-lsocket / -lnsl) unconditionally via cc.find_library(), although the comment right above the probe already scopes it to those platforms. When the build host has a libnsl package installed (e.g. Arch Linux), meson locates the host's /usr/lib/libnsl.so and adds its absolute path to the link line, breaking the cross link with mold: fatal: /usr/lib/libnsl.so: incompatible file type. A patch gates the probe on host_machine.system() == 'sunos'.
  • The unit test suite was built because the tests meson option was left at its auto default. tests/check/gst/gstutils.c pulls in <gsl/gsl_rng.h> from the GNU Scientific Library, which is not packaged. -Dtests=disabled is now passed; the libgstcheck helper library is still built via -Dcheck=enabled.

🧪 Run Testing Details

  • OpenWrt Version: master
  • OpenWrt Target/Subtarget: riscv64/generic
  • OpenWrt Device: build-tested only

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/gstreamer1/refresh V=s
  • It is structured in a way that it is potentially upstreamable

@flyn-org
Copy link
Copy Markdown
Contributor

Dirty patch?

Two pre-existing issues prevented gstreamer1 from building on some
host/target combinations:

 * meson.build probed for the Solaris/Illumos networking libraries
   ('-lsocket' / '-lnsl') unconditionally via cc.find_library(),
   although the comment right above the probe already scopes it to
   those platforms. When the build host has a 'libnsl' package
   installed, meson locates the host's /usr/lib/libnsl.so and adds
   its absolute path to the link line, breaking the cross link with
   an "incompatible file type" error. Add a patch which gates the
   probe on host_machine.system() == 'sunos'.

 * The unit test suite was built because the 'tests' meson option
   was left at its 'auto' default. tests/check/gst/gstutils.c pulls
   in <gsl/gsl_rng.h> from the GNU Scientific Library, which is not
   packaged. Pass -Dtests=disabled; the libgstcheck helper library
   is still built via -Dcheck=enabled.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
@dangowrt dangowrt force-pushed the gstreamer1-fix-build branch from 7aa8a66 to 69e8649 Compare May 26, 2026 16:33
@flyn-org
Copy link
Copy Markdown
Contributor

Thank you, @dangowrt. I recommend merging this. Do you think it would be good to propose the patch upstream? I do not yet see it at https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/.

@dangowrt
Copy link
Copy Markdown
Member Author

Not sure, I got this libnsl library present on my archlinux locally, so people may want to build with it even on Linux.

@BKPepe
Copy link
Copy Markdown
Member

BKPepe commented May 27, 2026

In that case, what about to create issue in their repository, so someone from upstream developers can take a look, if there is something what they can do.

@dangowrt
Copy link
Copy Markdown
Member Author

I don't know how to solve this properly. gstreamer isn't doing anything wrong they would change upstream -- it's correctly detecting and picking up a library. Just for OpenWrt this is bad because it picks up the host library. Maybe one way to do this in a upstream-friendly way would be to introduce a build-option which allows to force-disable libnsl and prevents it from being detected at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants