[package] libiconv/1.15: Fails to cross compile on windows
See original GitHub issuePackage and Environment Details (include every applicable attribute)
- Package Name/Version: libiconv/1.15
- Operating System+version: Windows 10
- Compiler+version: Visual Studio 2017 15.9.14
- Conan version: conan 1.20.3
- Python version: Python 3.8.0
Conan profile (output of conan profile show default
or conan profile show <profile>
if custom profile is in use)
[settings]
os=Windows
os_build=Windows
arch=x86
arch_build=x86_64
compiler=Visual Studio
compiler.version=15
build_type=RelWithDebInfo
[options]
[build_requires]
[env]
Steps to reproduce (Include if Applicable)
-
conan remote add bincrafters "https://api.bintray.com/conan/bincrafters/public-conan"
-
git clone https://github.com/bincrafters/conan-qt.git
-
cd conan-qt
-
git checkout
stable/5.13.2 -
conan create . qt/5.13.2@bincrafters/stable --build missing
Logs (Include/Attach if Applicable)
Click to expand log
libiconv/1.15: Applying build-requirement: msys2/20161025
libiconv/1.15: Copying sources to build folder
libiconv/1.15: Building your package in C:\projects\.conan\data\libiconv\1.15\_\_\build\d3c57f1b4faa70d5d60e94d8531667d77c8367ac
libiconv/1.15: Generator txt created conanbuildinfo.txt
libiconv/1.15: Calling build()
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.14
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'
libiconv/1.15: run_in_windows_bash: C:\projects\.conan\data\msys2\20161025\_\_\package\3cbd862cb7a3ea47ed1220dc027f344262d5224f\bin\usr\bin\bash.exe --login -c ^"cd \^"/c/projects/.conan/data/libiconv/1.15/_/_/build/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/source_subfolder\^" ^&^& PATH=\^"/c/projects/.conan/data/msys2/20161025/_/_/package/3cbd862cb7a3ea47ed1220dc027f344262d5224f/bin/usr/bin:$PATH\^" ^&^& chmod +x build-aux/ar-lib build-aux/compile ^"
libiconv/1.15: Calling:
> /c/projects/.conan/data/libiconv/1.15/_/_/build/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/source_subfolder/configure --prefix=C:/projects/.conan/data/libiconv/1.15/_/_/package/d3c57f1b4faa70d5d60e94d8531667d77c8367ac --enable-static --disable-shared CPPFLAGS=-IC:/projects/.conan/data/libiconv/1.15/_/_/package/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/include LDFLAGS=-LC:/projects/.conan/data/libiconv/1.15/_/_/package/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/lib RANLIB=: "CC=$PWD/build-aux/compile cl -nologo" CFLAGS=-MD "CXX=$PWD/build-aux/compile cl -nologo" CXXFLAGS=-MD "CPPFLAGS=-D_WIN32_WINNT=0x0600 -IC:/projects/.conan/data/libiconv/1.15/_/_/package/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/include" LDFLAGS=-LC:/projects/.conan/data/libiconv/1.15/_/_/package/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/lib LD=link "NM=dumpbin -symbols" STRIP=: "AR=$PWD/build-aux/ar-lib lib" RANLIB=: --host=i686-windows-msvc
libiconv/1.15: run_in_windows_bash: C:\projects\.conan\data\msys2\20161025\_\_\package\3cbd862cb7a3ea47ed1220dc027f344262d5224f\bin\usr\bin\bash.exe --login -c ^"cd \^"/c/projects/.conan/data/libiconv/1.15/_/_/build/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/source_subfolder\^" ^&^& PATH=\^"/c/projects/.conan/data/msys2/20161025/_/_/package/3cbd862cb7a3ea47ed1220dc027f344262d5224f/bin/usr/bin:$PATH\^" ^&^& /c/projects/.conan/data/libiconv/1.15/_/_/build/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/source_subfolder/configure --prefix=C:/projects/.conan/data/libiconv/1.15/_/_/package/d3c57f1b4faa70d5d60e94d8531667d77c8367ac --enable-static --disable-shared CPPFLAGS=-IC:/projects/.conan/data/libiconv/1.15/_/_/package/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/include LDFLAGS=-LC:/projects/.conan/data/libiconv/1.15/_/_/package/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/lib RANLIB=: \^"CC=$PWD/build-aux/compile cl -nologo\^" CFLAGS=-MD \^"CXX=$PWD/build-aux/compile cl -nologo\^" CXXFLAGS=-MD \^"CPPFLAGS=-D_WIN32_WINNT=0x0600 -IC:/projects/.conan/data/libiconv/1.15/_/_/package/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/include\^" LDFLAGS=-LC:/projects/.conan/data/libiconv/1.15/_/_/package/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/lib LD=link \^"NM=dumpbin -symbols\^" STRIP=: \^"AR=$PWD/build-aux/ar-lib lib\^" RANLIB=: --host=i686-windows-msvc ^"
libiconv/1.15: configure: loading site script /mingw32/etc/config.site
libiconv/1.15: checking for a BSD-compatible install... /usr/bin/install -c
libiconv/1.15: checking whether build environment is sane... yes
libiconv/1.15: checking for i686-windows-msvc-strip... :
libiconv/1.15: checking for a thread-safe mkdir -p... /c/projects/.conan/data/msys2/20161025/_/_/package/3cbd862cb7a3ea47ed1220dc027f344262d5224f/bin/usr/bin/mkdir -p
libiconv/1.15: checking for gawk... gawk
libiconv/1.15: checking whether make sets $(MAKE)... yes
libiconv/1.15: checking whether make supports nested variables... yes
libiconv/1.15: checking whether make sets $(MAKE)... (cached) yes
libiconv/1.15: checking for i686-windows-msvc-gcc... /c/projects/.conan/data/libiconv/1.15/_/_/build/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/source_subfolder/build-aux/compile cl -nologo
libiconv/1.15: checking whether the C compiler works... yes
libiconv/1.15: checking for C compiler default output file name... conftest.exe
libiconv/1.15: checking for suffix of executables... .exe
libiconv/1.15: checking whether we are cross compiling... no
libiconv/1.15: checking for suffix of object files... obj
libiconv/1.15: checking whether we are using the GNU C compiler... no
libiconv/1.15: checking whether /c/projects/.conan/data/libiconv/1.15/_/_/build/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/source_subfolder/build-aux/compile cl -nologo accepts -g... no
libiconv/1.15: checking for /c/projects/.conan/data/libiconv/1.15/_/_/build/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/source_subfolder/build-aux/compile cl -nologo option to accept ISO C89... none needed
libiconv/1.15: checking whether /c/projects/.conan/data/libiconv/1.15/_/_/build/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/source_subfolder/build-aux/compile cl -nologo understands -c and -o together... yes
libiconv/1.15: checking for style of include used by make... GNU
libiconv/1.15: checking dependency style of /c/projects/.conan/data/libiconv/1.15/_/_/build/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/source_subfolder/build-aux/compile cl -nologo... none
libiconv/1.15: checking how to run the C preprocessor... /c/projects/.conan/data/libiconv/1.15/_/_/build/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/source_subfolder/build-aux/compile cl -nologo -E
libiconv/1.15: checking for strip... /c/projects/.conan/data/msys2/20161025/_/_/package/3cbd862cb7a3ea47ed1220dc027f344262d5224f/bin/usr/bin/strip
libiconv/1.15: checking build system type... i686-w64-mingw32
! libiconv/1.15: checking host system type... Invalid configuration `i686-windows-msvc': system `msvc' not recognized
! libiconv/1.15: configure: error: /bin/sh build-aux/config.sub i686-windows-msvc failed
libiconv/1.15:
libiconv/1.15: WARN: Package is corrupted, removing folder: C:\projects\.conan\data\libiconv\1.15\_\_\package\d3c57f1b4faa70d5d60e94d8531667d77c8367ac
libiconv/1.15: WARN: Build folder is dirty, removing it: C:\projects\.conan\data\libiconv\1.15\_\_\build\d3c57f1b4faa70d5d60e94d8531667d77c8367ac
libiconv/1.15: WARN: Error running `configure --help`: Error 1 while executing /c/projects/.conan/data/libiconv/1.15/_/_/build/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/source_subfolder/configure --help
libiconv/1.15: ERROR: Package 'd3c57f1b4faa70d5d60e94d8531667d77c8367ac' build failed
libiconv/1.15: WARN: Build folder C:\projects\.conan\data\libiconv\1.15\_\_\build\d3c57f1b4faa70d5d60e94d8531667d77c8367ac
ERROR: libiconv/1.15: Error in build() method, line 115
self._build_autotools()
while calling '_build_autotools', line 109
env_build.configure(args=configure_args, host=host, build=build)
ConanException: Error 1 while executing /c/projects/.conan/data/libiconv/1.15/_/_/build/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/source_subfolder/configure --prefix=C:/projects/.conan/data/libiconv/1.15/_/_/package/d3c57f1b4faa70d5d60e94d8531667d77c8367ac --enable-static --disable-shared CPPFLAGS=-IC:/projects/.conan/data/libiconv/1.15/_/_/package/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/include LDFLAGS=-LC:/projects/.conan/data/libiconv/1.15/_/_/package/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/lib RANLIB=: "CC=$PWD/build-aux/compile cl -nologo" CFLAGS=-MD "CXX=$PWD/build-aux/compile cl -nologo" CXXFLAGS=-MD "CPPFLAGS=-D_WIN32_WINNT=0x0600 -IC:/projects/.conan/data/libiconv/1.15/_/_/package/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/include" LDFLAGS=-LC:/projects/.conan/data/libiconv/1.15/_/_/package/d3c57f1b4faa70d5d60e94d8531667d77c8367ac/lib LD=link "NM=dumpbin -symbols" STRIP=: "AR=$PWD/build-aux/ar-lib lib" RANLIB=: --host=i686-windows-msvc
Context
I’m trying to cross compile Qt 5.13.2 on Windows using VS2017 15.9.14, but the Qt package fails when cross compiling one of its dependencies: libiconv/1.15
.
Worth noting, if I change my profile to purposefully target x64 bit binaries, libiconv/1.15
seems to build okay
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Missing "libiconv.h" when crosscompiling for Windows with ...
I'm assuming your mingw crosscompiler is installed in /usr/x86_64-w64-mingw32, change it to the installation path where his "include" and "lib" ...
Read more >MXE (M cross environment)
Introduction. MXE (M cross environment) is a GNU Makefile that compiles a cross compiler and cross compiles many free libraries such as SDL...
Read more >Cross compile problem - glib and libiconv
I'm trying to cross compile GTK+ 2.4.4 for uClinux running on the ARM, ... I can configure, make and make install libiconv with...
Read more >Troubleshooting — conan 1.16.1 documentation
Maybe the package creator didn't build and shared pre-built packages at all and only uploaded the package recipe, or maybe they are only...
Read more >MXE (M cross environment) - R Developer Page
Compiler and runtime: MinGW-w64. Target OS, Packages. Static, Shared. 32 bit Windows, 99% (379/381), 72% ( ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, so
detected_architecture()
falls because it relies on a simple heuristic coming from here: https://github.com/conan-io/conan/blob/eadcd70ec7ccedc6d90b5360feff421e46cc6582/conans/client/tools/oss.py#L69Which relies on
platform.machine
which comes from lib/platform.pyOn Windows, this appears to look at the environment variable
PROCESSOR_ARCHITECTURE
, which reportedAMD64
, thus triggeringcross_building
to reportTrue
.I can trick this Conan package to pretend it’s not cross-compiling by setting the following environment variable:
This allows me to create the package without modifying the package recipe (suggested by @kunitsyn)
Seems it’s my fault, here should be an exception for msvc cross building.
But when I changed host to i686-w64-mingw32 by changing
if not tools.cross_building(self.settings)
toif not tools.cross_building(self.settings) or self._is_msvc:
I got “fatal error LNK1112: module machine type ‘x64’ conflicts with target machine type ‘X86’”, seems here are more works to do.