Open yourWaifu opened 1 year ago
Related to https://github.com/conan-io/conan/issues/12546 & https://github.com/conan-io/conan/issues/7460
Can be fixed in recipe itself (example: https://github.com/conan-io/conan-center-index/blob/52182ce4a3ded0d2b81662b458651eff88711322/recipes/icu/all/conanfile.py#L125-L131), but it would be nice if conan client could handle that.
Is it better with https://github.com/conan-io/conan-center-index/pull/14282?
with #14282 , I get the following errors
Feel free to reopen this issue. I guess https://github.com/conan-io/conan-center-index/pull/14282 has fixed cross-build from x86_64 to x86, but as you said probably not to ARM64.
Yeah, I don't really care about x64 to x86.
Where's the reopen button?
@SpaceIm reopen this issue please
Sorry I can't, I'm not a maintainer.
/cc @uilianries
@yourWaifu the issue's author always can re-open a closed issue. There a button on the bottom with such action.
I did some testing and found that I can compile the library by using VCPKG instead, but I need Conan for my project. Any ideas for solutions?
libiconv expects windres as a resource compiler. windres comes from binutils, and is exposed in libiconv recipe through msys2. There are 2 issues:
The workaround would be to have a wrapper like the one of vcpkg in order to transform windres arguments to rc.exe
(resource compiler provided by Windows SDK) arguments so that we can call rc.exe instead of windres if compiler is Visual Studio: https://github.com/microsoft/vcpkg/blob/master/scripts/buildsystems/make_wrapper/windres-rc
Obviously if it was handled automatically by conan build helper, it would be less tedious.
Basically, windres is called as windres -i <input_file> -o <output_file> --output-format=<format>
, while rc.exe is rc.exe -fo <output_file> <input_file>
Joining here with the same issue: libiconv.res.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'ARM64'
The only difference - I'm on Windows on ARM machine.
As there are some ARM issues with msys2 (no package ARM support), I've overridden the build profile with msys2/*:arch=x86_64
. This allows the package to complete and be run under emulation.
But it looks like libiconv fails further down the road.
Just to note, I'm trying to build gstreamer package
Getting the same issue as @valsydalv, I'm on an Arm windows box.
[settings]
arch=armv8
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.version=194
os=Windows
msys2/*:arch=x86_64
strawberryperl/*:arch=x86_64
I've tried force passing the host and build tripplets by removing the cross_building(self)
- if cross_building(self) and is_msvc(self):
+ if is_msvc(self):
I do see
checking build system type... aarch64-w64-mingw32
checking host system type... aarch64-w64-mingw32
But I'm still getting a failure
/bin/sh ../libtool --mode=link /c/users/rockd/.conan2/p/b/libic71139687767ac/b/src/build-aux/compile cl -nologo -MD -O2 -Ob2 -FS -o libiconv.la -rpath /lib -version-info 8:1:6 -no-undefined iconv.lo localcharset.lo relocatable.lo libiconv.res.lo
libtool: link: /c/users/rockd/.conan2/p/b/libic71139687767ac/b/src/build-aux/ar-lib lib cr .libs/iconv.lib iconv.obj localcharset.obj relocatable.obj libiconv.res.obj
libiconv.res.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'ARM64'
Description
I'm on an x86_64 machine, trying to compile for a Windows ARM64 machine. I was expecting to work. I don't know of any workarounds.
profile default:
profile arm64:
Command:
Package and Environment Details
Conan profile
Configuration for profile default:
[settings] os=Windows os_build=Windows arch=x86_64 arch_build=x86_64 compiler=Visual Studio compiler.version=16 build_type=Release [options] [conf] tools.cmake.cmaketoolchain:generator=Ninja [build_requires] [env]
Steps to reproduce
conan install libiconv/1.17@ --profile:build default --profile:host arm64 --build missing
Logs
Click to expand log
``` PS C:\Users\wuhao\Documents\Concetto\user_interface> conan install libiconv/1.17@ --profile:build default --profile:host arm64 --build missing Configuration (profile_host): [settings] arch=armv8 build_type=Release compiler=Visual Studio compiler.runtime=MD compiler.version=17 os=Windows os_build=Windows os_target=Windows [options] [build_requires] [env] Configuration (profile_build): [settings] arch=x86_64 arch_build=x86_64 build_type=Release compiler=Visual Studio compiler.runtime=MD compiler.version=16 os=Windows os_build=Windows [options] [build_requires] [env] [conf] tools.cmake.cmaketoolchain:generator=Ninja Installing package: libiconv/1.17 Requirements libiconv/1.17 from 'conancenter' - Cache Packages libiconv/1.17:2af2765e6e5c51d719d532b1228358a56ef2e4f1 - Build Build requirements msys2/cci.latest from 'conancenter' - Cache Build requirements packages msys2/cci.latest:eee3fba89db6d777329de604625af8c30d46f080 - Cache Cross-build from 'Windows:x86_64' to 'Windows:armv8' Installing (downloading, building) binaries... msys2/cci.latest: Already installed! msys2/cci.latest: Creating MSYS_ROOT env var : C:\.conan\2aa826d\1\bin\msys64 msys2/cci.latest: Creating MSYS_BIN env var : C:\.conan\2aa826d\1\bin\msys64\usr\bin msys2/cci.latest: Appending PATH env var with : C:\.conan\2aa826d\1\bin\msys64\usr\bin libiconv/1.17: Applying build-requirement: msys2/cci.latest libiconv/1.17: WARN: Build folder is dirty, removing it: C:\Users\wuhao\.conan\data\libiconv\1.17\_\_\build\2af2765e6e5c51d719d532b1228358a56ef2e4f1 libiconv/1.17: Copying sources to build folder libiconv/1.17: Building your package in C:\Users\wuhao\.conan\data\libiconv\1.17\_\_\build\2af2765e6e5c51d719d532b1228358a56ef2e4f1 libiconv/1.17: Generator txt created conanbuildinfo.txt libiconv/1.17: Calling generate() libiconv/1.17: Aggregating env generators libiconv/1.17: Calling build() libiconv/1.17: apply_conandata_patches(): No patches defined in conandata libiconv/1.17: Calling: > "/c/users/wuhao/.conan/data/libiconv/1.17/_/_/build/2af2765e6e5c51d719d532b1228358a56ef2e4f1/src/configure" --disable-shared --enable-static --prefix=/ --bindir=${prefix}/bin --sbindir=${prefix}/bin --libdir=${prefix}/lib --includedir=${prefix}/include --oldincludedir=${prefix}/include --host=aarch64-windows-msvc --build=x86_64-windows-msvc ********************************************************************** ** Visual Studio 2022 Developer Command Prompt v17.5.0-pre.1.0 ** Copyright (c) 2022 Microsoft Corporation ********************************************************************** [vcvarsall.bat] Environment initialized for: 'x64_arm64' Capturing current environment in C:\Users\wuhao\.conan\data\libiconv\1.17\_\_\build\2af2765e6e5c51d719d532b1228358a56ef2e4f1\build-release\conan\deactivate_msys2_mode.bat Configuring environment variables Capturing current environment in C:\Users\wuhao\.conan\data\libiconv\1.17\_\_\build\2af2765e6e5c51d719d532b1228358a56ef2e4f1\build-release\conan\deactivate_conanautotoolstoolchain.sh Configuring environment variables Capturing current environment in C:\Users\wuhao\.conan\data\libiconv\1.17\_\_\build\2af2765e6e5c51d719d532b1228358a56ef2e4f1\build-release\conan\deactivate_conanbuildenv-release-armv8.sh Configuring environment variables checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for aarch64-windows-msvc-strip... : checking for a race-free mkdir -p... /c/.conan/2aa826d/1/bin/msys64/usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether make sets $(MAKE)... (cached) yes checking for aarch64-windows-msvc-gcc... /c/users/wuhao/.conan/data/libiconv/1.17/_/_/build/2af2765e6e5c51d719d532b1228358a56ef2e4f1/src/build-aux/compile cl -nologo checking whether the C compiler works... yes checking for C compiler default output file name... conftest.exe checking for suffix of executables... .exe checking whether we are cross compiling... yes checking for suffix of object files... obj checking whether the compiler supports GNU C... no checking whether /c/users/wuhao/.conan/data/libiconv/1.17/_/_/build/2af2765e6e5c51d719d532b1228358a56ef2e4f1/src/build-aux/compile cl -nologo accepts -g... no checking for /c/users/wuhao/.conan/data/libiconv/1.17/_/_/build/2af2765e6e5c51d719d532b1228358a56ef2e4f1/src/build-aux/cchecking for /c/users/wuhao/.conan/data/libiconv/1.17/_/_/build/2af2765e6e5c51d719d532b1228358a56ef2e4f1/src/build-aux/compile cl -nologo option to enable C99 features... unsupported checking for /c/users/wuhao/.conan/data/libiconv/1.17/_/_/build/2af2765e6e5c51d719d532b1228358a56ef2e4f1/src/build-aux/compile cl -nologo option to enable C89 features... unsupported checking whether /c/users/wuhao/.conan/data/libiconv/1.17/_/_/build/2af2765e6e5c51d719d532b1228358a56ef2e4f1/src/build-aux/compile cl -nologo understands -c and -o together... yes checking whether the compiler is clang... no checking for compiler option needed when checking for declarations... none checking whether make supports the include directive... yes (GNU style) checking dependency style of /c/users/wuhao/.conan/data/libiconv/1.17/_/_/build/2af2765e6e5c51d719d532b1228358a56ef2e4f1/src/build-aux/compile cl -nologo... none checking how to run the C preprocessor... /c/users/wuhao/.conan/data/libiconv/1.17/_/_/build/2af2765e6e5c51d719d532b1228358a56ef2e4f1/src/build-aux/compile cl -nologo -E checking for strip... /c/.conan/2aa826d/1/bin/msys64/usr/bin/strip checking for aarch64-windows-msvc-strip... (cached) : checking build system type... Invalid configuration `x86_64-windows-msvc': OS `msvc' not recognized configure: error: /bin/sh /c/users/wuhao/.conan/data/libiconv/1.17/_/_/build/2af2765e6e5c51d719d532b1228358a56ef2e4f1/srlibiconv/1.17: libiconv/1.17: ERROR: Package '2af2765e6e5c51d719d532b1228358a56ef2e4f1' build failed libiconv/1.17: WARN: Build folder C:\Users\wuhao\.conan\data\libiconv\1.17\_\_\build\2af2765e6e5c51d719d532b1228358a56ef2e4f1\build-release ERROR: libiconv/1.17: Error in build() method, line 122 autotools.configure() ConanException: Error 1 while executing "/c/users/wuhao/.conan/data/libiconv/1.17/_/_/build/2af2765e6e5c51d719d532b1228358a56ef2e4f1/src/configure" --disable-shared --enable-static --prefix=/ --bindir=${prefix}/bin --sbindir=${prefix}/bin --libdir=${prefix}/lib --includedir=${prefix}/include --oldincludedir=${prefix}/include --host=aarch64-windows-msvc --build=x86_64-windows-msvc```