Hello World in LLVM-Assembly on Windows

As an experienced programmer, I feel pretty dumb asking this question: is there a step-by-step guide explaining how to write “Hello World” -Program in LLVM-Assembly Language, which leads to a simple “hello.exe” that can be executed on standard Windows PC?

I followed dozens of such lessons explaining how to check, do, compile llvm, etc. But either they require some other Software (which leads to another marathon tutorial), or they got some "Path / File / Dll not found" -Error (which leads to another marathon tutorial). I have reached llvm.exe to execute ... once. Now Windows reports an application crash ?!

Now I feel completely lost in the maze of obsolete tutorials, errors, incompatibilities, emulators / virtual machines, IDEs, Crosslinks, 32 and 64-bit, with WinDW / WinGW, from / from Cygwin, from / from Visual Studio, from / out clang, experimental, unsupported, missing environment variables, etc.

I expected to find an installer or archive containing a bunch of pre-compiled dll and exe files that can be used on the command line from the box. I just want to use a simple llvm toolkit - not clang, but Visual Studio (if possible) - just like javac.exe, masm.exe, fasm.exe, link.exe, ...

If I have to compile llvm myself, the ability to achieve this through Eclipse-CDT will be great - I could not import the project without any FileNotFound-Errors; which was associated with some specific incompatibilities with respect to the directory structure ... cmake should have solved this problem, but the only tutorial I have found so far is about cmake-gui - which it could not install for other reasons ...

Can someone point me to a modern tutorial on how to get a working llvm-as.exe file or write a step-by-step instruction on how he / she reached the above?

Thanks in advance - I lost three days on this: /

+8
assembly windows eclipse-cdt llvm
source share
2 answers

LLVM has historically provided second-rate support on Windows, but more recently, things have changed, so you have a good timeline. Read this LLVM blog post just a month ago. He points to this binary assembly page of the LLVM toolbar for Windows. When you have the tools, the flow to the “hello world” is similar to other platforms. It would be nice to start with the LLVM tutorial .

FWIW also exists the beginning of work in the Windows manual , although I’m not sure how relevant this blog post is, mentioned above. However, the LLVM "hello world" IR file is created in this process.

+4
source share

At first I recommended binaries from http://www.drangon.org/mingw/ , but they don't seem to work at all. My recommendation is to forget about MinGW now and build using Microsoft Visual Studio 2010+. At the very least, tools like "llc" work. I do not know if it is possible to refer to the Windows API, but I think so.

0
source share

All Articles