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

libx264: Failed to cross-build for Android from Windows #24640

Open
uilianries opened this issue Jul 16, 2024 · 1 comment
Open

libx264: Failed to cross-build for Android from Windows #24640

uilianries opened this issue Jul 16, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@uilianries
Copy link
Member

          Trying to build this package from windows I have compile-time errors:
Logs
======== Exporting recipe to the cache ========
libx264/cci.20220602: Exported: libx264/cci.20220602#84ac3bad6c78a5ed594cfa2f3c4cce23 (2024-07-16 07:32:16 UTC)

======== Exporting recipe to the cache ========
libx264/cci.20220602: Exporting package recipe: C:\xrsw\repos\conan-center-index\recipes\libx264\all\conanfile.py
libx264/cci.20220602: exports: File 'conandata.yml' found. Exporting it...
libx264/cci.20220602: Copied 1 '.yml' file: conandata.yml
libx264/cci.20220602: Copied 1 '.py' file: conanfile.py
libx264/cci.20220602: Exported to cache folder: C:\Users\edukaj\.conan2\p\libx23c4e3daabf7c5\e
libx264/cci.20220602: Exported: libx264/cci.20220602#84ac3bad6c78a5ed594cfa2f3c4cce23 (2024-07-16 07:32:17 UTC)

======== Input profiles ========
Profile host:
[settings]
arch=armv8
build_type=Debug
compiler=clang
compiler.cppstd=17
compiler.libcxx=c++_static
compiler.version=14
os=Android
os.api_level=31
[tool_requires]
*: ninja/1.11.1, cmake/3.28.1, android-ndk/r25c
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
tools.env.virtualenv:powershell=False

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
tools.env.virtualenv:powershell=False


======== Computing dependency graph ========
Graph root
    cli
Requirements
    libx264/cci.20220602#84ac3bad6c78a5ed594cfa2f3c4cce23 - Cache
Build requirements
    android-ndk/r25c#760aecc4204a86140c455a890ac312f3 - Cache
    cmake/3.28.1#6a1e0a2ffe43d562b8228c1a5aaaac61 - Cache
    msys2/cci.latest#78b1cbee6b821008ca0f7ec6559266f5 - Cache
    ninja/1.11.1#cd30ca226f2040a979c359ebca4817d5 - Cache

======== Computing necessary packages ========
Requirements
    libx264/cci.20220602#84ac3bad6c78a5ed594cfa2f3c4cce23:73c208ea4372810866cb59b149723d8c56728c8a - Build
Build requirements
    android-ndk/r25c#760aecc4204a86140c455a890ac312f3:522dcea5982a3f8a5b624c16477e47195da2f84f#80ca5a47297c567d4d17ee179e2d17d5 - Cache
    cmake/3.28.1#6a1e0a2ffe43d562b8228c1a5aaaac61:522dcea5982a3f8a5b624c16477e47195da2f84f#29e6903b5006c2b2f81003c9ebf7551b - Cache
    msys2/cci.latest#78b1cbee6b821008ca0f7ec6559266f5:956a88975bda9dfcc485e2861d71e74bd7e2b9a5#a3cd3a7c08d8dbaadd1817bc81c39c94 - Cache
    ninja/1.11.1#cd30ca226f2040a979c359ebca4817d5:723257509aee8a72faf021920c2874abc738e029#1a592c653c6d8742bf921f77d92580f4 - Cache

======== Installing packages ========
android-ndk/r25c: Already installed! (1 of 5)
cmake/3.28.1: Already installed! (2 of 5)
cmake/3.28.1: Appending PATH environment variable: C:\Users\edukaj\.conan2\p\b\cmake658582c322d1b\p\bin
cmake/3.28.1: Appending PATH environment variable: C:\Users\edukaj\.conan2\p\b\cmake658582c322d1b\p\bin
msys2/cci.latest: Already installed! (3 of 5)
ninja/1.11.1: Already installed! (4 of 5)

-------- Installing package libx264/cci.20220602 (5 of 5) --------
libx264/cci.20220602: Building from source
libx264/cci.20220602: Package libx264/cci.20220602:73c208ea4372810866cb59b149723d8c56728c8a
libx264/cci.20220602: Copying sources to build folder
libx264/cci.20220602: Building your package in C:\Users\edukaj\.conan2\p\b\libx28fa659b0e788b\b
libx264/cci.20220602: Calling generate()
libx264/cci.20220602: Generators folder: C:\Users\edukaj\.conan2\p\b\libx28fa659b0e788b\b\build-debug\conan
libx264/cci.20220602: Generating aggregated env files
libx264/cci.20220602: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
libx264/cci.20220602: Calling build()
libx264/cci.20220602: RUN: "/c/users/edukaj/.conan2/p/b/libx28fa659b0e788b/b/src/configure" --enable-static --prefix=/ --bindir=${prefix}/bin --libdir=${prefix}/lib --includedir=${prefix}/include --host=aarch64-linux-android
 --bit-depth=all --disable-cli --enable-pic --enable-debug --cross-prefix=C:\Users\edukaj\.conan2\p\b\androc34b498ce5137\p\bin\toolchains\llvm\prebuilt\windows-x86_64\bin\llvm- --sysroot=C:\Users\edukaj\.conan2\p\b\androc34b498ce5137\p\bin\toolchains\llvm\prebuilt\windows-x86_64\sysroot --extra-cflags=-fno-finite-math-only 
mkdir: cannot create directory '/dev/shm': Read-only file system

Creating /dev/shm directory failed.
POSIX semaphores and POSIX shared memory will not work

mkdir: cannot create directory '/dev/mqueue': Read-only file system

Creating /dev/mqueue directory failed.
POSIX message queues will not work

No working C compiler found.

libx264/cci.20220602: ERROR:
Package '73c208ea4372810866cb59b149723d8c56728c8a' build failed
libx264/cci.20220602: WARN: Build folder C:\Users\edukaj\.conan2\p\b\libx28fa659b0e788b\b\build-debug
ERROR: libx264/cci.20220602: Error in build() method, line 169
        autotools.configure()
        ConanException: Error 1 while executing
conanautotoolstoolchain.sh
script_folder="C:\Users\edukaj\.conan2\p\b\libx28fa659b0e788b\b\build-debug\conan"
echo "echo Restoring environment" > "$script_folder\deactivate_conanautotoolstoolchain.sh"
for v in CC CXX CPPFLAGS CXXFLAGS CFLAGS LDFLAGS PKG_CONFIG_PATH
do
    is_defined="true"
    value=$(printenv $v) || is_defined="" || true
    if [ -n "$value" ] || [ -n "$is_defined" ]
    then
        echo export "$v='$value'" >> "$script_folder\deactivate_conanautotoolstoolchain.sh"
    else
        echo unset $v >> "$script_folder\deactivate_conanautotoolstoolchain.sh"
    fi
done


export CC="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android31-clang.cmd"
export CXX="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android31-clang++.cmd"
export CPPFLAGS="$CPPFLAGS"
export CXXFLAGS="$CXXFLAGS -fPIC --sysroot C:/Users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g"
export CFLAGS="$CFLAGS -fPIC --sysroot C:/Users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g"
export LDFLAGS="$LDFLAGS --sysroot C:/Users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/sysroot"
export PKG_CONFIG_PATH="/c/users/edukaj/.conan2/p/b/libx28fa659b0e788b/b/build-debug/conan:$PKG_CONFIG_PATH"
conanautotoolstoolchain.sh
script_folder="C:\Users\edukaj\.conan2\p\b\libx28fa659b0e788b\b\build-debug\conan"
echo "echo Restoring environment" > "$script_folder\deactivate_conanbuild_android.sh"
for v in AS
do
    is_defined="true"
    value=$(printenv $v) || is_defined="" || true
    if [ -n "$value" ] || [ -n "$is_defined" ]
    then
        echo export "$v='$value'" >> "$script_folder\deactivate_conanbuild_android.sh"
    else
        echo unset $v >> "$script_folder\deactivate_conanbuild_android.sh"
    fi
done


export AS="C:\Users\edukaj\.conan2\p\b\androc34b498ce5137\p\bin\toolchains\llvm\prebuilt\windows-x86_64\bin\aarch64-linux-android31-clang.cmd"
conanbuildenv-debug-armv8.sh
script_folder="C:\Users\edukaj\.conan2\p\b\libx28fa659b0e788b\b\build-debug\conan"
echo "echo Restoring environment" > "$script_folder\deactivate_conanbuildenv-debug-armv8.sh"
for v in ANDROID_NDK_ROOT ANDROID_NDK_HOME NDK_ROOT CHOST SYSROOT ANDROID_NATIVE_API_LEVEL CC CXX AS LD AR RANLIB STRIP ADDR2LINE NM OBJCOPY OBJDUMP READELF ANDROID_PLATFORM ANDROID_TOOLCHAIN ANDROID_ABI ANDROID_STL PATH MSYS_ROOT MSYS_BIN
do
    is_defined="true"
    value=$(printenv $v) || is_defined="" || true
    if [ -n "$value" ] || [ -n "$is_defined" ]
    then
        echo export "$v='$value'" >> "$script_folder\deactivate_conanbuildenv-debug-armv8.sh"
    else
        echo unset $v >> "$script_folder\deactivate_conanbuildenv-debug-armv8.sh"
    fi
done


export ANDROID_NDK_ROOT="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin"
export ANDROID_NDK_HOME="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin"
export NDK_ROOT="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64"
export CHOST="aarch64-linux-android"
export SYSROOT="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/sysroot"
export ANDROID_NATIVE_API_LEVEL="31"
export CC="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android31-clang.cmd"
export CXX="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android31-clang++.cmd"
export AS="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android31-clang.cmd"
export LD="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android31-clang++.cmd"
export AR="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar.exe"
export RANLIB="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ranlib.exe"
export STRIP="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-strip.exe"
export ADDR2LINE="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-addr2line.exe"
export NM="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-nm.exe"
export OBJCOPY="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-objcopy.exe"
export OBJDUMP="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-objdump.exe"
export READELF="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-readelf.exe"
export ANDROID_PLATFORM="android-31"
export ANDROID_TOOLCHAIN="clang"
export ANDROID_ABI="arm64-v8a"
export ANDROID_STL="c++_static"
export PATH="/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin:/c/users/edukaj/.conan2/p/b/androc34b498ce5137/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin:/c/users/edukaj/.conan2/p/b/cmake658582c322d1b/p/bin:/c/users/edukaj/.conan2/p/b/ninjaa01dcbf33dfe3/p/bin:/c/users/edukaj/.conan2/p/msys2498b23cfe9db2/p/bin:/c/users/edukaj/.conan2/p/msys2498b23cfe9db2/p/bin/msys64/usr/bin:$PATH"
export MSYS_ROOT="/c/users/edukaj/.conan2/p/msys2498b23cfe9db2/p/bin/msys64"
export MSYS_BIN="/c/users/edukaj/.conan2/p/msys2498b23cfe9db2/p/bin/msys64/usr/bin"

Originally posted by @elvisdukaj in #24587 (comment)

@uilianries
Copy link
Member Author

@elvisdukaj I moved your comment to a new issue, so we can investigate it better.

I only use Linux to cross-compile and it's working. My guess: libx265 does not support your configuration, I'll take a look. Thank you for posting your complete log.

@uilianries uilianries self-assigned this Jul 16, 2024
@uilianries uilianries added the bug Something isn't working label Jul 16, 2024
@uilianries uilianries changed the title libx264: Failed to cross-build for Androi from Windows libx264: Failed to cross-build for Android from Windows Jul 16, 2024
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

1 participant