You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AutotoolsToolchain in Conan 2.x automatically choses compilers when crossbuilding on Windows for Android, based on the tools.android:ndk_path conf variable:
See also #13443.
This overrides the CC, CXX, etc. environment variables set in the [buildenv] of the Conan profile.
However, this automatism uses the .cmd wrapper scripts, provided by Android NDK, for the compiler, e.g. .../toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android31-clang.cmd. These CMD scripts cause errors when building certain packages.
For example, building openssl/1.1.1 using the recipe from conan-center-index fails in the linking stage with a "command line to long" error due to CMD's low command line length limit.
This could be avoided by using the bash wrapper script, which is also included in the Android NDK, instead of the CMD wrapper script for the compiler. Note, that this can only be reliably used on Windows when a Conan package that is build in a bash shell, i.e. the package recipe declares win_bash = True.
Still, I assume that this applies to many Conan packages which are built with Autotools and thus I propose to chose the compiler file extension based on this flag on Windows.
As an alternative, the compiler variables could be set to the bare clang.exe/clang++.exe executables and the --target parameter, which is otherwise added by the CMD/bash wrapper script, be added to the cflags and cxxflags, instead.
At our company, we have currently added a workaround in the openssl/1.x.x recipe to replace the compiler in the AutotoolsToolchain environment variables in order to make the build work.
Have you read the CONTRIBUTING guide?
I've read the CONTRIBUTING guide
The text was updated successfully, but these errors were encountered:
This has been closed by #17470, that will prioritize Conan defined buildenv (from profiles or from tool-requires). So if the environment define CC/CXX/... variables, then the AutotoolsToolchain will not automatically deduce and define it from the ndk_path. This will be part of Conan 2.11 to be released asap.
What is your suggestion?
The AutotoolsToolchain in Conan 2.x automatically choses compilers when crossbuilding on Windows for Android, based on the tools.android:ndk_path conf variable:
conan/conan/tools/gnu/autotoolstoolchain.py
Line 141 in fd1a84a
See also #13443.
This overrides the CC, CXX, etc. environment variables set in the [buildenv] of the Conan profile.
However, this automatism uses the .cmd wrapper scripts, provided by Android NDK, for the compiler, e.g.
.../toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android31-clang.cmd
. These CMD scripts cause errors when building certain packages.For example, building openssl/1.1.1 using the recipe from conan-center-index fails in the linking stage with a "command line to long" error due to CMD's low command line length limit.
This could be avoided by using the bash wrapper script, which is also included in the Android NDK, instead of the CMD wrapper script for the compiler. Note, that this can only be reliably used on Windows when a Conan package that is build in a bash shell, i.e. the package recipe declares
win_bash = True
.Still, I assume that this applies to many Conan packages which are built with Autotools and thus I propose to chose the compiler file extension based on this flag on Windows.
As an alternative, the compiler variables could be set to the bare
clang.exe
/clang++.exe
executables and the--target
parameter, which is otherwise added by the CMD/bash wrapper script, be added to the cflags and cxxflags, instead.At our company, we have currently added a workaround in the openssl/1.x.x recipe to replace the compiler in the AutotoolsToolchain environment variables in order to make the build work.
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: