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

[package] ffmpeg/7.0.1: cross compiling ffmpeg fails #26548

Open
jeroqui opened this issue Feb 6, 2025 · 6 comments
Open

[package] ffmpeg/7.0.1: cross compiling ffmpeg fails #26548

jeroqui opened this issue Feb 6, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@jeroqui
Copy link

jeroqui commented Feb 6, 2025

Description

I'm trying to install ffmpeg (and some other libraries, but ffmpeg alone fails too) with conan to cross compile from linux (ubuntu) to windows.

Conan throws an error on Running configure, inside build(). It says that x86_64-w64-mingw32-gcc is unable to create an executable file..

On the config log I discovered it's because of a flag when running tests for x86_64-w64-mingw32-ld.

x86_64-w64-mingw32-ld -m64 -L/home/jeroqui/.conan2/p/b/freetd8d522cfe5ed9/p/lib -L/home/jeroqui/.conan2/p/b/libsv9862cce477f3c/p/lib -L/home/jeroqui/.conan2/p/b/opensf32bb84148b27/p/lib -L/home/jeroqui/.conan2/p/b/vorbib2efb2d738443/p/lib -L/home/jeroqui/.conan2/p/b/libpn1c271e119251a/p/lib -L/home/jeroqui/.conan2/p/b/dav1d0798c06f2d7c3/p/lib -L/home/jeroqui/.conan2/p/b/libaoec0c6ff69236b/p/lib -L/home/jeroqui/.conan2/p/b/cpuin94c00ccfd6939/p/lib -L/home/jeroqui/.conan2/p/b/zlib09a824ccbeb0e/p/lib -L/home/jeroqui/.conan2/p/b/libwedcd84ab019a17/p/lib -L/home/jeroqui/.conan2/p/b/libfdbad6e447d67d4/p/lib -L/home/jeroqui/.conan2/p/b/libmpeb5a9a1a779c7/p/lib -L/home/jeroqui/.conan2/p/b/libvp0218afdff461c/p/lib -L/home/jeroqui/.conan2/p/b/libx2ec0d07d4a0565/p/lib -L/home/jeroqui/.conan2/p/b/libx23198ed0a549b9/p/lib -L/home/jeroqui/.conan2/p/b/opus8d5d63e1681f3/p/lib -L/home/jeroqui/.conan2/p/b/ogg813050272864b/p/lib -L/home/jeroqui/.conan2/p/b/openh3680a2c5cc945/p/lib -L/home/jeroqui/.conan2/p/b/openj09e5e15be595a/p/lib -L/home/jeroqui/.conan2/p/b/brotl58bc227a041f8/p/lib -L/home/jeroqui/.conan2/p/b/bzip2e67b6fd4c7720/p/lib -L/home/jeroqui/.conan2/p/b/libic229c7a1dc80e2/p/lib -L/home/jeroqui/.conan2/p/b/xz_ut8375de634122a/p/lib -m64 -o /tmp/ffconf.eAkkSIml/test.exe /tmp/ffconf.eAkkSIml/test.o
x86_64-w64-mingw32-ld: unrecognised emulation mode: 64
Supported emulations: i386pep i386pe
C compiler test failed.

I've tried to get conan to not add the -m64 flag, but I haven't been able to get it working. Setting env variables like LDFLAGS= doesn't seam to work either on the conan profile, on the conanfile.py or directly on my terminal. Any suggestions?

Package and Environment Details

  • Package Name/Version: ffmpeg/7.0.1
  • Operating System+version: Linux Pop!_OS 22.04 LTS
  • Compiler+version: x86_64-w64-mingw32-gcc (GCC) 10-posix 20220113
  • Conan version: conan 2.12.1
  • Python version: Python 3.10.12

Conan profile

[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
compiler.exception=seh
compiler.threads=posix
os=Windows

[buildenv]
CC=x86_64-w64-mingw32-gcc
CXX=x86_64-w64-mingw32-g++
LD=x86_64-w64-mingw32-ld
CXXFLAGS=-D_WIN32_WINNT=0x0601
RC=x86_64-w64-mingw32-windres
WINDRES=x86_64-w64-mingw32-windres
RANLIB=x86_64-w64-mingw32-ranlib

Steps to reproduce

Running the suggested minimal conanfile.py from conancenter for ffmpeg with the profile I already pasted:

from conan import ConanFile
from conan.tools.cmake import cmake_layout


class ExampleRecipe(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeDeps", "CMakeToolchain"

    def requirements(self):
        self.requires("ffmpeg/7.0.1")

    def layout(self):
        cmake_layout(self)

Logs

Running the command conan install . --build=missing -pr=windows
conan install . -pr=windows --build=missing

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.exception=seh
compiler.libcxx=libstdc++11
compiler.threads=posix
compiler.version=11
os=Windows
[buildenv]
CC=x86_64-w64-mingw32-gcc
CXX=x86_64-w64-mingw32-g++
LD=x86_64-w64-mingw32-ld
CXXFLAGS=-D_WIN32_WINNT=0x0601
RC=x86_64-w64-mingw32-windres
WINDRES=x86_64-w64-mingw32-windres
RANLIB=x86_64-w64-mingw32-ranlib

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux


======== Computing dependency graph ========
Graph root
    conanfile.py (creditor/1.0): /home/jeroqui/Documents/coding-projects/creditor/conanfile.py
Requirements
    brotli/1.1.0#d56d7bb9ca722942aba17369cb5c0519 - Cache
    bzip2/1.0.8#d00dac990f08d991998d624be81a9526 - Cache
    cpuinfo/cci.20231129#15e94782b128bee8bfd047f6102a4d21 - Cache
    dav1d/1.4.3#5e2459e132c77183bd16d23d12fd8f4a - Cache
    ffmpeg/7.0.1#d0c5c3ef64333e81d1ff2a0bed046ab0 - Cache
    freetype/2.13.2#5d2563803c8558d4ef47271a82c73d20 - Cache
    libaom-av1/3.6.1#a2b22c70d6fce43887881431808ab8a6 - Cache
    libfdk_aac/2.0.3#0115f6598be7303e042684e3a846b12d - Cache
    libiconv/1.17#1ae2f60ab5d08de1643a22a81b360c59 - Cache
    libmp3lame/3.100#44b12d19316eb2b223d98d3e75dae438 - Cache
    libpng/1.6.45#7e4a946509700c2c83e82819b7abbf02 - Cache
    libsvtav1/2.1.0#571c8ea897d8a8dc71ef48dca4c0fc26 - Cache
    libvpx/1.14.1#3b2a56aea1e29b9a8f7753030c620f38 - Cache
    libwebp/1.3.2#52f69c4a31c5cf033fdd9230d77a8e38 - Cache
    libx264/cci.20240224#b59786f05910017eb25a661cc79d68a3 - Cache
    libx265/3.4#719e50b2b2c3fd1b9133fea12da42c62 - Cache
    ogg/1.3.5#062626875f5c8c59f069f76f148098ef - Cache
    openh264/2.4.1#e7b055ba4fc635a6a3e0dbec088e18ea - Cache
    openjpeg/2.5.2#6f7b733e151d1bbf5ed05cbabb846828 - Cache
    openssl/3.4.0#466f081734a3b6fc69eb6c8191e3592c - Cache
    opus/1.4#3c98a306d127dce1e74d58a0e2c850b5 - Cache
    vorbis/1.3.7#37e58f52e59a6232199b34ef402714a6 - Cache
    xz_utils/5.4.5#b885d1d79c9d30cff3803f7f551dbe66 - Cache
    zlib/1.3.1#b8bc2603263cf7eccbd6e17e66b0ed76 - Cache
Build requirements
    cmake/3.31.3#8733a6094cad0031a30ddbd1e6055117 - Cache
    gnu-config/cci.20210814#dc430d754f465e8c74463019672fb97b - Cache
    meson/1.2.2#21b73818ba96d9eea465b310b5bbc993 - Cache
    meson/1.3.2#26ce8a76a36cc275cdfee1d757bc6561 - Cache
    meson/1.4.0#2262941cc8fbb0099dd0c196ca2a6c01 - Cache
    meson/1.4.1#43b753adf9a089cadfa17c8034f5c897 - Cache
    nasm/2.15.05#058c93b2214a49ca1cfe9f8f26205568 - Cache
    nasm/2.16.01#d0aebbd20ccbb6ad9c9c753ab708098c - Cache
    ninja/1.12.1#fd583651bf0c6a901943495d49878803 - Cache
    pkgconf/2.1.0#27f44583701117b571307cf5b5fe5605 - Cache
    pkgconf/2.2.0#6462942a22803086372db44689ba825f - Cache
    yasm/1.3.0#fb800a15413dca19bfaef9e4b5d50694 - Cache
Resolved version ranges
    cmake/[>=3.16 <4]: cmake/3.31.3
    libpng/[>=1.6 <2]: libpng/1.6.45
    ninja/[>=1.10.2 <2]: ninja/1.12.1
    openssl/[>=1.1 <4]: openssl/3.4.0
    pkgconf/[>=2.1 <3]: pkgconf/2.2.0
    pkgconf/[>=2.2 <3]: pkgconf/2.2.0
    zlib/[>=1.2.11 <2]: zlib/1.3.1

======== Computing necessary packages ========
Connecting to remote 'conancenter' anonymously
libsvtav1/2.1.0: Main binary package '6691b81973347aea322db6cac1c3b03a6df3f9ca' missing
libsvtav1/2.1.0: Checking 11 compatible configurations
libsvtav1/2.1.0: Found compatible package '4ca16eafd5ffb142b7bd9a20768fe737c8ecf065': compiler.cppstd=17
libvpx/1.14.1: Main binary package '74f54f6e9006956c7e365ee2768a08b48fe21ce6' missing
libvpx/1.14.1: Checking 11 compatible configurations
libvpx/1.14.1: Found compatible package 'a5132930902213c8ba934dfc0faa5798fe902db6': compiler.cppstd=17
libx265/3.4: Main binary package '2f7757597f4c666e3ca307996d68c1f7e7714ca5' missing
libx265/3.4: Checking 11 compatible configurations
libx265/3.4: Found compatible package '6eaa841b21f69e4e7a6101b42639f7682507bc70': compiler.cppstd=17
Requirements
    brotli/1.1.0#d56d7bb9ca722942aba17369cb5c0519:3105bc9d059d7c222b7062d93343c5503e6a7fc4#6b715e41ef3e1df174dde6cc20d4df4d - Cache
    bzip2/1.0.8#d00dac990f08d991998d624be81a9526:4d2b5417c00f6110e4f4f63d65dbd364917ad214#5ed929f8cb41d4de1748e52abfa9c574 - Cache
    cpuinfo/cci.20231129#15e94782b128bee8bfd047f6102a4d21:70b07ae5b0d547f746b380cd13ab697d77bc3471#79b1b980fc45a2893b13c98e909f43ae - Cache
    dav1d/1.4.3#5e2459e132c77183bd16d23d12fd8f4a:d8ec838f6c1b946fa5e6e9346990d5efc3b2d51b#4e5e9450cd166c6b0a61124741c273f3 - Cache
    ffmpeg/7.0.1#d0c5c3ef64333e81d1ff2a0bed046ab0:098e2e19bb923698943e673a81438b73b40f442d - Build
    freetype/2.13.2#5d2563803c8558d4ef47271a82c73d20:0e124c228894409b7dd3375b235ab11168e4c6c9#24d59a4ff4a27dab235dcf4a3b4495ca - Cache
    libaom-av1/3.6.1#a2b22c70d6fce43887881431808ab8a6:10ebe94ebaebae137674acdf205580d1822613b2#26789dabe2c02ca0b43a176c14cd8718 - Cache
    libfdk_aac/2.0.3#0115f6598be7303e042684e3a846b12d:cf3aa419ca9769933160ae272db71652d3039ec5#b9c6b8c5dcd684866ab1074020815ff5 - Cache
    libiconv/1.17#1ae2f60ab5d08de1643a22a81b360c59:740aa3f6448f44370dbb2d593a7af4b66c9f92f5#0f82a3008bf1132e1a85be623e4e1f84 - Cache
    libmp3lame/3.100#44b12d19316eb2b223d98d3e75dae438:740aa3f6448f44370dbb2d593a7af4b66c9f92f5#36f3f74f6009b1e1fb2f3bff7c3e63b8 - Cache
    libpng/1.6.45#7e4a946509700c2c83e82819b7abbf02:3beefba6ddd39baca0c03dc897f728a882c126d0#52acaa32e62050573831b1e55d4c909b - Cache
    libsvtav1/2.1.0#571c8ea897d8a8dc71ef48dca4c0fc26:4ca16eafd5ffb142b7bd9a20768fe737c8ecf065#91b28fde8c18603d089b3d301167255f - Cache
    libvpx/1.14.1#3b2a56aea1e29b9a8f7753030c620f38:a5132930902213c8ba934dfc0faa5798fe902db6#92bf14261a8ccea68a9e807810919df8 - Cache
    libwebp/1.3.2#52f69c4a31c5cf033fdd9230d77a8e38:53a142b1cd1b7db5cc6663bd56110f1636262644#102dafc4725e17633eb04a55f718b290 - Cache
    libx264/cci.20240224#b59786f05910017eb25a661cc79d68a3:46d98b448a2786583006b9b326d0eef22775111b#d80d7b0a2a108b9ad04ba9f36a9e2993 - Cache
    libx265/3.4#719e50b2b2c3fd1b9133fea12da42c62:6eaa841b21f69e4e7a6101b42639f7682507bc70#a5bad018ec44f713307a3c155146d349 - Cache
    ogg/1.3.5#062626875f5c8c59f069f76f148098ef:740aa3f6448f44370dbb2d593a7af4b66c9f92f5#bb8de6a2fdf06e91f008d7511b2ed9d7 - Cache
    openh264/2.4.1#e7b055ba4fc635a6a3e0dbec088e18ea:cf3aa419ca9769933160ae272db71652d3039ec5#3559264fd9bc52efcaa2ed908a6ba6f3 - Cache
    openjpeg/2.5.2#6f7b733e151d1bbf5ed05cbabb846828:740aa3f6448f44370dbb2d593a7af4b66c9f92f5#ecb6a016c4e8ea2eeed9bfde3ac6db5c - Cache
    openssl/3.4.0#466f081734a3b6fc69eb6c8191e3592c:a226adb60646b4f3d165a828ac90f7d952620c44#18e838a41b3f8e5726528b130f4a0887 - Cache
    opus/1.4#3c98a306d127dce1e74d58a0e2c850b5:aed603690eee73aae4ef15114c995a9e6807883f#640d2430c435f7fdcdddacebf6c2b35c - Cache
    vorbis/1.3.7#37e58f52e59a6232199b34ef402714a6:984a41ae854b57121e3f8d5c76f9068f370f62f1#b7c2438d07b78f68ac51961f187c5a82 - Cache
    xz_utils/5.4.5#b885d1d79c9d30cff3803f7f551dbe66:740aa3f6448f44370dbb2d593a7af4b66c9f92f5#409f691c785da34ea22d52d63f434ab6 - Cache
    zlib/1.3.1#b8bc2603263cf7eccbd6e17e66b0ed76:740aa3f6448f44370dbb2d593a7af4b66c9f92f5#ba82f695c72a14a188c32bbc688ea1c8 - Cache
Build requirements
    nasm/2.16.01#d0aebbd20ccbb6ad9c9c753ab708098c:3593751651824fb813502c69c971267624ced41a#70b9b7478fef3df88a0c7296ba73d3fa - Cache
    pkgconf/2.2.0#6462942a22803086372db44689ba825f:c0b621fd4b3199fe05075171573398833dba85f4#35e5163b1cf42becef616e6b7873202e - Cache
Skipped binaries
    cmake/3.31.3, gnu-config/cci.20210814, meson/1.2.2, meson/1.3.2, meson/1.4.0, meson/1.4.1, nasm/2.15.05, ninja/1.12.1, pkgconf/2.1.0, yasm/1.3.0

======== Installing packages ========
brotli/1.1.0: Already installed! (1 of 26)
bzip2/1.0.8: Already installed! (2 of 26)
cpuinfo/cci.20231129: Already installed! (3 of 26)
libaom-av1/3.6.1: Already installed! (4 of 26)
libfdk_aac/2.0.3: Already installed! (5 of 26)
libiconv/1.17: Already installed! (6 of 26)
libwebp/1.3.2: Already installed! (7 of 26)
nasm/2.16.01: Already installed! (8 of 26)
ogg/1.3.5: Already installed! (9 of 26)
openjpeg/2.5.2: Already installed! (10 of 26)
opus/1.4: Already installed! (11 of 26)
xz_utils/5.4.5: Already installed! (12 of 26)
zlib/1.3.1: Already installed! (13 of 26)
libmp3lame/3.100: Already installed! (14 of 26)
libvpx/1.14.1: Already installed! (15 of 26)
libx264/cci.20240224: Already installed! (16 of 26)
libx265/3.4: Already installed! (17 of 26)
dav1d/1.4.3: Already installed! (18 of 26)
pkgconf/2.2.0: Already installed! (19 of 26)
pkgconf/2.2.0: WARN: The use of 'unix_path_legacy_compat' is deprecated in Conan 2.0 and does not perform path conversions. This is retained for compatibility with Conan 1.x and will be removed in a future version.
openh264/2.4.1: Already installed! (20 of 26)
libpng/1.6.45: Already installed! (21 of 26)
libsvtav1/2.1.0: Already installed! (22 of 26)
openssl/3.4.0: Already installed! (23 of 26)
vorbis/1.3.7: Already installed! (24 of 26)
freetype/2.13.2: Already installed! (25 of 26)

-------- Installing package ffmpeg/7.0.1 (26 of 26) --------
ffmpeg/7.0.1: Building from source
ffmpeg/7.0.1: Package ffmpeg/7.0.1:098e2e19bb923698943e673a81438b73b40f442d
ffmpeg/7.0.1: Copying sources to build folder
ffmpeg/7.0.1: Building your package in /home/jeroqui/.conan2/p/b/ffmpec37b0b436ffbc/b
ffmpeg/7.0.1: Calling generate()
ffmpeg/7.0.1: Generators folder: /home/jeroqui/.conan2/p/b/ffmpec37b0b436ffbc/b/build-release/conan
ffmpeg/7.0.1: Generating aggregated env files
ffmpeg/7.0.1: Generated aggregated env files: ['conanbuild.sh', 'conanrun.bat']
ffmpeg/7.0.1: Calling build()
ffmpeg/7.0.1: apply_conandata_patches(): No patches defined in conandata
ffmpeg/7.0.1: RUN: "/home/jeroqui/.conan2/p/b/ffmpec37b0b436ffbc/b/src/configure" --disable-shared --enable-static --prefix=/ '--bindir=${prefix}/bin' '--libdir=${prefix}/lib' --pkg-config-flags=--static --disable-doc --enable-cross-compile --enable-asm --disable-shared --enable-static --enable-pic --enable-avdevice --enable-avcodec --enable-avformat --enable-swresample --enable-swscale --enable-postproc --enable-avfilter --enable-bzlib --enable-zlib --enable-lzma --enable-iconv --enable-libopenjpeg --enable-libopenh264 --enable-libvorbis --enable-libopus --disable-libzmq --disable-sdl2 --enable-libx264 --enable-libx265 --enable-libvpx --enable-libmp3lame --enable-libfdk-aac --enable-libwebp --enable-libaom --enable-openssl --disable-alsa --disable-libpulse --disable-vaapi --disable-libdrm --disable-vdpau --disable-libxcb --disable-libxcb-shm --disable-libxcb-shape --disable-libxcb-xfixes --disable-appkit --disable-avfoundation --disable-coreimage --disable-audiotoolbox --disable-videotoolbox --disable-securetransport --disable-vulkan --enable-libdav1d --disable-jni --disable-mediacodec --disable-xlib --disable-cuda --disable-cuvid --enable-nonfree --enable-gpl --enable-libsvtav1 --arch=x86_64 --as=/home/jeroqui/.conan2/p/nasmdf98755626bcb/p/bin/nasm --cc=x86_64-w64-mingw32-gcc --cxx=x86_64-w64-mingw32-g++ --ld=x86_64-w64-mingw32-ld --ranlib=x86_64-w64-mingw32-ranlib --pkg-config=/home/jeroqui/.conan2/p/pkgcobe94b5aebe034/p/bin/pkgconf --target-os=mingw32 '--extra-cflags=-m64 -O3' --extra-ldflags=-m64
x86_64-w64-mingw32-gcc is unable to create an executable file.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

ffmpeg/7.0.1: ERROR:
Package '098e2e19bb923698943e673a81438b73b40f442d' build failed
ffmpeg/7.0.1: WARN: Build folder /home/jeroqui/.conan2/p/b/ffmpec37b0b436ffbc/b/build-release
ERROR: ffmpeg/7.0.1: Error in build() method, line 730
	autotools.configure()
	ConanException: Error 1 while executing
the end of config.log shows:
BEGIN /tmp/ffconf.eAkkSIml/test.c
    1	int main(void){ return 0; }
END /tmp/ffconf.eAkkSIml/test.c
x86_64-w64-mingw32-gcc -DNDEBUG -I/home/jeroqui/.conan2/p/b/freetd8d522cfe5ed9/p/include -I/home/jeroqui/.conan2/p/b/freetd8d522cfe5ed9/p/include/freetype2 -I/home/jeroqui/.conan2/p/b/libsv9862cce477f3c/p/include/svt-av1 -I/home/jeroqui/.conan2/p/b/opensf32bb84148b27/p/include -I/home/jeroqui/.conan2/p/b/vorbib2efb2d738443/p/include -I/home/jeroqui/.conan2/p/b/libpn1c271e119251a/p/include -I/home/jeroqui/.conan2/p/b/dav1d0798c06f2d7c3/p/include -I/home/jeroqui/.conan2/p/b/libaoec0c6ff69236b/p/include -I/home/jeroqui/.conan2/p/b/cpuin94c00ccfd6939/p/include -I/home/jeroqui/.conan2/p/b/zlib09a824ccbeb0e/p/include -I/home/jeroqui/.conan2/p/b/libwedcd84ab019a17/p/include -I/home/jeroqui/.conan2/p/b/libfdbad6e447d67d4/p/include -I/home/jeroqui/.conan2/p/b/libmpeb5a9a1a779c7/p/include -I/home/jeroqui/.conan2/p/b/libvp0218afdff461c/p/include -I/home/jeroqui/.conan2/p/b/libx2ec0d07d4a0565/p/include -I/home/jeroqui/.conan2/p/b/libx23198ed0a549b9/p/include -I/home/jeroqui/.conan2/p/b/opus8d5d63e1681f3/p/include -I/home/jeroqui/.conan2/p/b/opus8d5d63e1681f3/p/include/opus -I/home/jeroqui/.conan2/p/b/ogg813050272864b/p/include -I/home/jeroqui/.conan2/p/b/openh3680a2c5cc945/p/include -I/home/jeroqui/.conan2/p/b/openj09e5e15be595a/p/include -I/home/jeroqui/.conan2/p/b/openj09e5e15be595a/p/include/openjpeg-2.5 -I/home/jeroqui/.conan2/p/b/brotl58bc227a041f8/p/include -I/home/jeroqui/.conan2/p/b/brotl58bc227a041f8/p/include/brotli -I/home/jeroqui/.conan2/p/b/bzip2e67b6fd4c7720/p/include -I/home/jeroqui/.conan2/p/b/libic229c7a1dc80e2/p/include -I/home/jeroqui/.conan2/p/b/xz_ut8375de634122a/p/include -DOPJ_STATIC -DLZMA_API_STATIC -m64 -O3 -m64 -O3 -c -o /tmp/ffconf.eAkkSIml/test.o /tmp/ffconf.eAkkSIml/test.c
x86_64-w64-mingw32-ld -m64 -L/home/jeroqui/.conan2/p/b/freetd8d522cfe5ed9/p/lib -L/home/jeroqui/.conan2/p/b/libsv9862cce477f3c/p/lib -L/home/jeroqui/.conan2/p/b/opensf32bb84148b27/p/lib -L/home/jeroqui/.conan2/p/b/vorbib2efb2d738443/p/lib -L/home/jeroqui/.conan2/p/b/libpn1c271e119251a/p/lib -L/home/jeroqui/.conan2/p/b/dav1d0798c06f2d7c3/p/lib -L/home/jeroqui/.conan2/p/b/libaoec0c6ff69236b/p/lib -L/home/jeroqui/.conan2/p/b/cpuin94c00ccfd6939/p/lib -L/home/jeroqui/.conan2/p/b/zlib09a824ccbeb0e/p/lib -L/home/jeroqui/.conan2/p/b/libwedcd84ab019a17/p/lib -L/home/jeroqui/.conan2/p/b/libfdbad6e447d67d4/p/lib -L/home/jeroqui/.conan2/p/b/libmpeb5a9a1a779c7/p/lib -L/home/jeroqui/.conan2/p/b/libvp0218afdff461c/p/lib -L/home/jeroqui/.conan2/p/b/libx2ec0d07d4a0565/p/lib -L/home/jeroqui/.conan2/p/b/libx23198ed0a549b9/p/lib -L/home/jeroqui/.conan2/p/b/opus8d5d63e1681f3/p/lib -L/home/jeroqui/.conan2/p/b/ogg813050272864b/p/lib -L/home/jeroqui/.conan2/p/b/openh3680a2c5cc945/p/lib -L/home/jeroqui/.conan2/p/b/openj09e5e15be595a/p/lib -L/home/jeroqui/.conan2/p/b/brotl58bc227a041f8/p/lib -L/home/jeroqui/.conan2/p/b/bzip2e67b6fd4c7720/p/lib -L/home/jeroqui/.conan2/p/b/libic229c7a1dc80e2/p/lib -L/home/jeroqui/.conan2/p/b/xz_ut8375de634122a/p/lib -m64 -o /tmp/ffconf.eAkkSIml/test.exe /tmp/ffconf.eAkkSIml/test.o
x86_64-w64-mingw32-ld: unrecognised emulation mode: 64
Supported emulations: i386pep i386pe
C compiler test failed.
@jeroqui jeroqui added the bug Something isn't working label Feb 6, 2025
@jeroqui jeroqui changed the title [package] ffmpeg/7.0.1: cross compiling ffmpeg with conan fails [package] ffmpeg/7.0.1: cross compiling ffmpeg fails Feb 6, 2025
@memsharded
Copy link
Member

Thanks @jeroqui for reporting.

This could be a gap in the Conan client too, not only in the recipe.
For some reason it seems that ffmpeg is more problematic than other recipes as it features an unusual autotools-like but not really regular autotools build system.

If this needs fixing in Conan please @jcar87 or @uilianries let me know and we can try to improve the AutootoolsToolchain there.

@jcar87
Copy link
Contributor

jcar87 commented Feb 7, 2025

Hi @jeroqui - just a hunch, could you post the output of the following commands:

  • uname -a
  • file $(which x86_64-w64-mingw32-ld)

Thanks!

@jeroqui
Copy link
Author

jeroqui commented Feb 7, 2025

Sure! Here you go @jcar87 .

$ uname -a
Linux pop-os 6.8.0-76060800daily20240311-generic #202403110203~1711393930~22.04~331756a SMP PREEMPT_DYNAMIC Mon M x86_64 x86_64 x86_64 GNU/Linux
$ file $(which x86_64-w64-mingw32-ld)
/usr/bin/x86_64-w64-mingw32-ld: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=34ddb65e57066e75453879ed0e1c8a94de1e74d7, for GNU/Linux 3.2.0, stripped

What does your gut tell you?

@valgur
Copy link
Contributor

valgur commented Feb 7, 2025

I pushed my various minor fixes related to cross-compilation I've found necessary to reliably cross-compile the ffmpeg recipe here: #26559

Give it a try, maybe that's enough to get it working.

@jeroqui
Copy link
Author

jeroqui commented Feb 7, 2025

Hy @valgur . Thanks a lot for that! I set up a local conan repo to be able to test the recipe on the PR. But I'm getting this error now:

-------- Installing package ffmpeg/7.0.1 (31 of 32) --------
ffmpeg/7.0.1: Building from source
ffmpeg/7.0.1: Package ffmpeg/7.0.1:1dad820adc92efbdad058f6c07141997483b20a3
ffmpeg/7.0.1: Copying sources to build folder
ffmpeg/7.0.1: Building your package in /home/jeroqui/.conan2/p/b/ffmpe22cd474b4786f/b
ffmpeg/7.0.1: Calling generate()
ffmpeg/7.0.1: Generators folder: /home/jeroqui/.conan2/p/b/ffmpe22cd474b4786f/b/build-release/conan
ERROR: ffmpeg/7.0.1: Error in generate() method, line 646
	build_cc = AutotoolsToolchain(self).vars()["CC_FOR_BUILD"]
	KeyError: 'CC_FOR_BUILD'

I tried setting the environment variable on both the build and host profile, and also in my terminal, but it's not working. It's probably a stupid question, but how am I supposed to configure that?

Anyway. I tried hard-coding the variable in my cloned file (build_cc="cc"). And it got past that step. But it's crashing in the same spot as I reported in the start of the issue.

@valgur
Copy link
Contributor

valgur commented Feb 8, 2025

Ugh, looks like that value is only set when the c compiler executable is set in the build profile, e.g.:

[conf]
tools.build:compiler_executables={'c': 'gcc-13', 'cpp': 'g++-13'}

See https://gist.github.com/valgur/5a550530a55b0df98016b89dbb25d861 for a more complete example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants