AutootolsToolchain: pass a valid GNU triplet when the compiler is msvc #12881
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog: Bugfix: Fix bug to pass a valid GNU triplet when using AutotoolsToolchain and cross-building on Windows.
Docs: Omit
Close: #7460
Context:
The current implementation of the private
_get_gnu_triplet
returnsx86_64-windows-msvc
. This results in errors when we are cross-building on Windows, since this is not a valid GNU triplet:Specifically for Autotools, the triplet system type is of the format specified here, where we can have:
cpu-company-os
, orcpu-company-kernel-os
In this context,
msvc
is not a valid OS. There is no current convention in GNU for a proper target when the OS is Windows, and the C/C++ runtime are provided by Visual C++, this PR falls back to a generic{arch}-unknown-windows
, where windows is a valid OS. This is the a very generic fallback - whilex86-64-w64-mingw32
may be preferred in some contexts, we don't have enough context to assume it (but could be done in a separate flag), and when Visual C++ with the Microsoft Visual C++ runtime is used, the binaries produced would not strictly be mingw32 binaries.