[LLVMdev] Internal assemblers/linkers (was: Preferring to use GCC instead of LLVM)

Jonas Maebe jonas.maebe at elis.ugent.be
Wed May 14 01:47:00 PDT 2008


On 13 May 2008, at 09:21, Holger Schurig wrote:

> I know one compiler (Free Pascal) that directly can write ELF and
> files and also Windows EXE/DLL files.
>
> So it is actually possible to do this with limited resources (the
> FPC developer community isn't that large). It just has to be
> done.

FWIW, our internal assembler (only available for i386) is more or less  
an integrated Pascal translation of nasm. The linker (only available  
for Windows/i386) is, afaik, an original work. The main reason for the  
latter was that at the time it was written, the "--gc-sections" option  
didn't exist yet for GNU ld, and performing dead code stripping by  
linking in static libraries (which we could already generate using our  
internal assembler) containing a single object file for each global  
symbol is excruciatingly slow with GNU ld.

Further, before we had an internal assembler and linker for Windows,  
we also used the GNU assembler and linker there (and they are still an  
option). And to confirm what others said earlier on: you do not have  
to ship an entire MingW or Cygwin distribution to be able to use them.  
In fact, when you ship the MingW versions of those tools there are no  
external dependencies whatsoever.

You can find the whole bunch (as.exe, ar.exe, ld.exe, strip.exe etc)  
precompiled in e.g. ftp://ftp.freepascal.org/pub/fpc/dist/i386-win32-2.0.4/separate/base.i386-win32.zip 
  (along with some other fpc-related binaries -- note that 2.0.4 is  
not the latest fpc release, but later releases only have a big  
installer available for download and no separate zipfiles with just  
the binaries)


Jonas



More information about the llvm-dev mailing list