Can I compile on Windows using nothing but the LLVM toolchain?

#1

Most of this conversation is MS Build tools vs MingW, but what about the Clang/LLVM build tools? I have been using nim for windows and their use of LLVM works fine.

4 Likes

Why do I need Microsoft C++ build tools?
#2

That would be great. Visual Studio is huge and takes a while to download and install, so it’s an inconvenience for new or casual Rust users.

AFAIK Rust now ships with LLVM’s linker and linker-flavor flag exists, so it might be able to actually produce an executable on its own.

I’m not sure if it still needs some libraries from the Windows SDK to run.

5 Likes

#3

Currently Rust relies on import libraries to link to symbols from system libraries. In order to not rely on them RFC 2627 would need to be implemented and stabilized. Once that is done it’s just a matter of updating winapi to use it (and updating std to use winapi), and creating a new pure Rust target without any CRT dependence. So while this cannot really be done yet, it’s something that may be possible in the future.

4 Likes

#4

I’m really looking forward to do that. As far as I know msvc build tools do have the same licensing conditions as Visual Studio has. So you could have issues if you where to create a commercial application with this. Correct me if I am mistaken here.

0 Likes

#5

That… may be true. I’m not (currently) going to go looking for the msvc linker’s license, but I suspect it’s the same as the rest of the package, as you suggest.

However, simply releasing commercial software is permitted with the community edition. You have to have more than 5 developers, or revenue exceeding 1M USD to require the professional license, as of the last time I read the license terms. There is also a specific clause allowing development of open-source (or free? I don’t remember the specifics) software with the community edition.

I don’t think those terms are very onerous, generally.

0 Likes

#6

I am not sure if I understand correctly, but you can download only the MSVC build tools without Visual Studio, the IDE, here: https://visualstudio.microsoft.com/downloads/

Scroll down to the expandable Tools for Visual Studio 2019 section and download the Build Tools for VS2019.

Sorry if you knew that already / this wasn’t what you meant.

0 Likes

#7

Thank you! I knew that though :slight_smile: . I was refering to the licensing terms. As @Zarenor was stating there are certain rules applying if you are creating commercial products with MSVC build tools. I was asking for those licensing conditions. I’d rather give the money to the rust community :smiley:

0 Likes

#8

Not to beat the circular dead horse here, but LLVM integration would solve the issue around needing the commercially binding MS Build Tools.

I realize it may take work to get there, and lord knows I don’t have the time to help (wish I did). However, some of the other new languages do provide their own linker/integrate with LLVM so that the MS Build Tools are not necessary.

At this point its just an extra hurdle to adoption for people interested in a licenses free cross platform experience which you get with Nim, Go, or D.

0 Likes