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

AutootolsToolchain: pass a valid GNU triplet when the compiler is msvc #12881

Merged

Conversation

jcar87
Copy link
Contributor

@jcar87 jcar87 commented Jan 10, 2023

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 returns x86_64-windows-msvc. This results in errors when we are cross-building on Windows, since this is not a valid GNU triplet:

config.sub x86-64-windows-msvc    
Invalid configuration `x86-64-windows-msvc': OS `msvc' not recognized

Specifically for Autotools, the triplet system type is of the format specified here, where we can have:

  • cpu-company-os, or
  • cpu-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 - while x86-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.

@jcar87 jcar87 marked this pull request as ready for review January 10, 2023 17:55
@memsharded memsharded added this to the 2.0.0-beta8 milestone Jan 11, 2023
@memsharded memsharded merged commit 0f73ed7 into conan-io:develop2 Jan 11, 2023
@jcar87 jcar87 deleted the hotfix/autotools-msvc-gnu-triplet branch January 11, 2023 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants