Comments (5)
I don't think its possible. AFAIK, Clang isn't ABI compatible with MSVC.
from msvcdocker.
https://clang.llvm.org/docs/MSVCCompatibility.html
First, Clang attempts to be ABI-compatible, meaning that Clang-compiled code should be able to link against MSVC-compiled code successfully. However, C++ ABIs are particularly large and complicated, and Clang’s support for MSVC’s C++ ABI is a work in progress.
from msvcdocker.
Now, that's very interesting. It looks like clang-cl is
the first-ever open-source C++ compiler that’s ABI-compatible with Microsoft Visual C++ (MSVC)
Both Chrome and Firefox use clang-cl/lld-link, so its not just a beta feature.
At first glance it seems like we could cross-compile with clang on a Linux host. Some thoughts:
- Wine would still be necessary to run any unit/integration/automated tests.
- Getting tools like CMake to use clang-cl might be problematic on a non-Windows host. For example, CMake doesn't have an MSVC generator on Linux hosts.
- clang-cl requires at least Windows SDK headers/libs. It's unclear how to get those files. Perhaps we could install them on a Windows VM and copy them over into a Docker image just like we do with MSVC proper.
- It's unclear if the MSVCRT runtime is part of the Windows SDK or not. If we have to install MSVC in order to get the CRT for clang, is it worth it to use clang? (Perhaps... running the compiler outside of Wine seems compelling.)
It's definitely worth looking into. Thanks for the info!
from msvcdocker.
clang-cl requires at least Windows SDK headers/libs. It's unclear how to get those files. Perhaps we could install them on a Windows VM and copy them over into a Docker image just like we do with MSVC proper.
If we have to install MSVC in order to get the CRT for clang, is it worth it to use clang
Or you can install (or just download) VS in Windows, obtain a direct link to msi files by proxying all the requests via mitmproxy, then download only the needed msis by direct links and install (requires wine, but .net is not needed) or unpack (doesn't require wine, only msitools) only them. Should consume much less space than full VS build tools installed by the installer (the installer lacks customization, for example it installs toolchains for unneeded platforms and there is (at least was the last time I have installed MSVC and on the feedback site the support have claimed that adding customization to the installer is not planned) no way to disable it other than not to use it at all);
Getting tools like CMake to use clang-cl might be problematic on a non-Windows host.
In fact on Windows host it is problematic to use CMake + CLang + MinGW since Kitware have embedded a check and shows the message "this setup is unsupported" so I have to patch CMake stdlib in order to build CLang + MinGW on Windows host. It is obviously a bug in CMake. So if CLang + MSVC is unsupported, you may need to create a patch file and apply it after cmake installation. And a toolchain file is obviously needed.
For example, CMake doesn't have an MSVC generator on Linux hosts.
You don't need clang-cl. The only difference of clang-cl from usual clang is MSVC-compatible command line interface. You can compile with usual clang using usual flags like in GCC and still use MS libs and runtime.
It's unclear if the MSVCRT runtime is part of the Windows SDK or not.
It isn't and Windows SDK really depends on MSVC. MinGW and ReactOS use 9wn SDKs and DDKs which are far from being complete.
from msvcdocker.
@KOLANICH With b6ac118 I've updated the project to support clang-cl
. Thanks for the suggestion!
from msvcdocker.
Related Issues (15)
- PowerShell support HOT 2
- msbuild with cmake HOT 7
- update base image to Ubuntu 18.04 bionic HOT 1
- run wine as non-root user HOT 5
- Current version of vagrant is running the snapshot batch scripts as powershell scripts instead HOT 3
- makefile/vagrantfile doesn't check for dependencies HOT 12
- subinacl.msi link not found HOT 2
- expected Clang 10.0.0 or newer HOT 1
- Can't find cl.exe when building msvc10 HOT 1
- The msvc16 (master) version cannot compile the helloworld
- Support for msvc 16 (Visual Studio 2019) HOT 2
- WINEPATH -> PATH length limited to 1024 characters HOT 4
- wine isn't installing HOT 1
- Running VS 2019 installer within Wine HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msvcdocker.