[LLVMdev] win32 assemblers and linkers for llvm

Owen Anderson resistor at mac.com
Mon May 12 20:38:55 PDT 2008


There's also then entire GNU toolchain, through MinGW and/or Cygwin.

--Owen

On May 12, 2008, at 8:57 PM, Razvan Aciu wrote:

> I made some researches how llvm, possibly with other tools, can be a  
> full
> backend for compiler writers (with the final result being an  
> executable file
> or dynamic linked library). Here are the results:
>
> A. Assemblers
>
> When I saw that the I86 target for llvm with the Intel syntax  
> targets MASM
> (I tested with the MASM version from http://www.masm32.com/ ), it  
> was a bad
> surprise for me. This is especially because the MASM license forbids  
> MASM
> redistribution both for free or commercial projects so practically  
> this
> target is useless for a compiler writer who want to distribute his  
> compiler.
> I think the only excuse for this choice is if the developer didn't  
> know
> other assemblers syntax or existence.
> There were some discussions here that in this situation the JIT  
> interpreter
> can be used. It can be done, but only with a temporary status. I  
> don't think
> that someone who makes for example an installer or animated e- 
> greetings in
> which he uses LLVM for scripting and wants to distribute his work,  
> wants his
> products to have over 3-4 MB (VM+JIT+Runtime). Especially after the  
> clang
> will be production ready, I don't think it will be used only as a C  
> compiler
> for a JIT interpreted code.
> Fortunately there are other better options for an I86 target  
> assembler:
>
> 1. NASM ( http://sourceforge.net/projects/nasm ) - it can be used  
> both in
> Windows and in Linux (and MacOS), without any syntax change. The only
> drawback for it is the LGPL license, which allows some developers to  
> link to
> it only using NASM like an external tool or a dynamic library, not  
> as a
> static library.
>
> 2. YASM ( http://www.tortall.net/projects/yasm/ ) - it is NASM  
> compatible
> and has a BSD license, much as llvm has. A strong point for YASM is  
> that it
> is from start built like a library (the same as llvm), so it can be  
> simply
> integrated in a developer tool. YASM is my personal favorite for llvm
> integration.
>
> 3. FASM ( http://flatassembler.net/ ) - it is an assembler written in
> assembler, which works on Windows and Linux. It has a liberal  
> license and as
> a strong point it can produce directly executables or dynamic  
> libraries,
> without a linker. The major problem with it is that it can only be
> interfaced hardly with code written in C/C++, because it is written in
> assembler, so I think FASM can be used mainly as a command line  
> utility and
> not as a library.
>
> Like a patch, I suggest to rename the intel syntax for the I86  
> target in
> masm-intel (or leave it intel even if I don't know if peoples are  
> using it
> now in their projects), and create another target, like nasm-intel. It
> should be a simple problem of tweaking some templates (but don't put  
> me to
> do it :) ).
>
> B. Linkers ( COFF format )
>
> I think most of the linking phase should be done inside the llvm  
> linker,
> using the native llvm format, because it is a very good optimizing  
> linker.
> Especially after clang will be able to compile the standard C  
> library (and
> other libraries), there is no reason to use native object libraries  
> for
> other reasons than linking functions located in dynamic libraries,  
> or for
> some special cases where the functions are written in other  
> languages, like
> the native assembler, etc.
> I checked many linkers, but most of them seems not maintained  
> anymore or
> they are producing bad files (like ALINK, http://alink.sourceforge.net/ 
>  ).
>
> I saw only one linker that I liked: uldar (
> http://sourceforge.net/project/showfiles.php?group_id=93970 ), made  
> by the
> guys from http://www.ultimatepp.org/ . It is a package of a linker  
> and a
> librarian, so it can also create libraries. The source code is  
> provided
> inside the U++ package under a very liberal license.
>
> Razvan
>
> PS: Chris, I'm working on the MSVC patch.
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080512/e7670265/attachment.bin>


More information about the llvm-dev mailing list