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

[vcpkg] Support cross compile arm64-linux, arm-linux triplets on a linux x86_64 host. #13374

Merged
merged 1 commit into from Oct 30, 2020

Conversation

x-projs
Copy link
Contributor

@x-projs x-projs commented Sep 5, 2020

Describe the pull request

  • What does your PR fix?
    Support cross compile arm64-linux, arm-linux triplets on a linux x86_64 host.

  • Which triplets are supported/not supported? Have you updated the CI baseline?
    Support arm64-linux and arm-linux triplets.

  • Does your PR follow the maintainer guide?
    Yes

@Neumann-A
Copy link
Contributor

Personal opinion: All those crosscompiling toolchains should have seperate toolchains and not be cramped into a single universal linux one.

@JackBoosY JackBoosY added the category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed label Sep 7, 2020
@kevinlul
Copy link
Contributor

kevinlul commented Sep 8, 2020

I did something related to this in #11535 but only for an autoconf system for that specific port. Not sure if that would be related though. In that case I depend on the cross-compiler toolchain file.

@x-projs
Copy link
Contributor Author

x-projs commented Sep 10, 2020

Where should we put the cross-compiler toolchain file? If we ask user to supply it, user might not know how to generate it. Ideally, in most of cases, user only need few additional efforts to make cross compiling work.

@kevinlul
Copy link
Contributor

I'm referring to cmake .. -DCMAKE_TOOLCHAIN_FILE=path/to/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=some/cmake/toolchain/for/crosscompiler

@x-projs
Copy link
Contributor Author

x-projs commented Sep 10, 2020

But how does it work with ./vcpkg install ...? Seems we can't pass -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=some/cmake/toolchain/for/crosscompiler to vcpkg install.

@Neumann-A
Copy link
Contributor

But how does it work with ./vcpkg install ...? Seems we can't pass -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=some/cmake/toolchain/for/crosscompiler to vcpkg install.

You add it into the triplet.
Simply use set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE <sometoolchainpath>) in the triplet

@ras0219-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ras0219-msft
Copy link
Contributor

I think this is the right incremental improvement.

Once complexity increases enough, it may make sense to have separate files for each of the different X-to-Y cross targets; however right now we support all Linux targets out of a single file (linux.cmake). Furthermore, the detection of which X-to-Y file to select still would need to exist somewhere. Finally, our toolchain hashing system currently supports only hashing one file for the toolchain and doesn't have a mechanism to determine which specific combo was loaded.

For all these reasons, this looks like a good improvement for our current state and will help inform more improvements into the future.

@JackBoosY
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JackBoosY JackBoosY added the info:reviewed Pull Request changes follow basic guidelines label Oct 30, 2020
@BillyONeal BillyONeal merged commit 5e4d2fa into microsoft:master Oct 30, 2020
@BillyONeal
Copy link
Member

Thanks for your contribution!

@x-projs x-projs deleted the yuboxie/linux-cross-compile branch October 31, 2020 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants