vcpkg icon indicating copy to clipboard operation
vcpkg copied to clipboard

How do I ... Implement Crosscompiling

Open Pantau123 opened this issue 7 years ago • 9 comments

Hi, i want to know if there is a opportunity to make a Setup for triplet arm-Linux a crosscompiler from Windows to arm Linux (for example the linaro cross Compiler)???

Pantau123 avatar Oct 17 '19 15:10 Pantau123

If you provide a functioning toolchain that can cross-compile from windows to linux arm you can create a triplet which uses it.

cbezault avatar Oct 17 '19 17:10 cbezault

I Need an example… I had test it with a user defined triplet, but that fails with Errors...

Pantau123 avatar Oct 17 '19 17:10 Pantau123

https://github.com/qis/toolchains

Qis has a few examples of custom toolchains. Not exactly the one you're looking for (that probably doesn't exist).

cbezault avatar Oct 17 '19 19:10 cbezault

Using arm with Linux is not supported for vcpkg even when you're building natively, see #3647.

I assume that means that cross compiling for arm Linux with vcpkg is also impossible, but I don't know much about cross compilation so I could be wrong. It would certainly be an impressive workaround.

arthur-tacca avatar Oct 18 '19 06:10 arthur-tacca

vcpkg supported for in platform -windows msvc x64, x86 -macos -linux x64, x86[?]

and you can use any toolchain for cross-compile you just need to write it correctly

the main and only problem that will arise is the compatibility of PORTs that you yourself will have to edit for the platform

EXAMPLE from under windows to mipsel platform https://github.com/microsoft/vcpkg/issues/7794#issuecomment-523830219

MVoz avatar Oct 18 '19 10:10 MVoz

the main and only problem that will arise is the compatibility of PORTs that you yourself will have to edit for the platform

Agreed, your mileage may vary. My recent experience with cross-compiling certain ports (Linux x64 to Linux aarch64) is that some portfiles assume that if you're compiling for arm64, then your host must be a Windows machine. They then proceed to hard-code a bunch of stuff for Windows. I had to give up on Boost and cpprestsdk because of this -- just installed the packages directly via apt install.

marcbertola avatar Oct 18 '19 17:10 marcbertola

It's a big Advantage if you can develope your Application with VS and use CMAKE to cross compile and use both to checkin in your tfs and the tfs produce a correct arm Application.

Pantau123 avatar Nov 15 '19 14:11 Pantau123

Actually quite a delusion that linux - arm (raspberry pi) is not supported in vcpkg. vcpkg itself can be build natively, but then .... would need an example to proceed myself, otherwise too much time to invest. Regards

zweistein-frm2 avatar Dec 19 '19 07:12 zweistein-frm2

Thanks for posting this issue. This issue has been fixed, so I am closing this issue for now.

LilyWangL avatar Feb 19 '20 09:02 LilyWangL