Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg: improve cross-compilation support #26559

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

valgur
Copy link
Contributor

@valgur valgur commented Feb 7, 2025

Summary

Changes to recipe: ffmpeg/[*]

Motivation

The recipe mostly supports cross-compilation, but can have issues in two regards:

  • tools.build:compiler_executables from the build profile are ignored.
  • A host compiler is required to create build tools during build, but the correct one from the host profile is currently not being passed to the build. The build scripts fall back to either cc or gcc by default (don't recall the exact one anymore).

Details

Also:

  • Adds --disable-autodetect - to allow only explicitly enabled dependencies to be used.
  • Adds a missing optional sndio dependency (that was previously causing issues due to the autodetection above).
  • Always adds the pkgconf dependency for libaom and possibly other deps that require it.
  • Replace vaapi/system -> libva/2.21.0 and vdpau/system -> libvdpau/1.5 to avoid system dependencies, which complicate cross-compilation. Relying on [replace_requires] for these can be considered as an alternative as well, though.
  • Respect the default PKG_CONFIG_PATH of the system pkg-config if .../system dependencies are used.
  • Use cpp_info.merge(...) to simplify the AutotoolsDeps workaround for MSVC.
  • Clean up some Conan v1 cruft.

Regarding the tools.build:compiler_executables handling, replacing AutotoolsToolchain with GnuToolchain would make it a bit cleaner, but it's still in incubation and would require a newer Conan version. Something like conan-io/conan#17602 would be even better, or at least clearer conventions how the less common build tools should correctly be passed via the profile (whether env vars or the config param should be preferred, or both?).

Logs

Tested with gcc-13-aarch64-linux-gnu with no build-essentials, to be stricter about cc or gcc not being silently used as the host compiler: https://gist.github.com/valgur/5a550530a55b0df98016b89dbb25d861


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.

1 participant