Native build clarification

It appears that when you link bitcode files into a native executable using llvm-ld, that gcc is used for the final step.

I would like to create a tool that creates native executables without requiring gcc/clang. Is that currently supported with llvm?

It appears that when you link bitcode files into a native executable using llvm-ld, that gcc is used for the final step.

I would like to create a tool that creates native executables without requiring gcc/clang. Is that currently supported with llvm?

To create executables, LLVM relies on the system linker (gcc, visual c, etc.). Even Clang uses the system linker for the final link step.

It’s not so easy to create a linker that has all the bells and whistles, especially on windows.
You have to look at the totality of options, linker files, shared objects, etc.
It’s not a weekend project.

If you want to read the elf manual and gnu ld and then write a new one you could do that. Clang can easily be fixed to incorporate it either as a default or as an optional linker. The GNU ld for mingw must know a lot about windows linking but probably not all.

In some worlds Coff format is still relevant.

Microsoft has their own form of Coff that they use even today.

Back in the early days of Windows NT I wrote one for that OS because Microsoft stopped distributing one with the OS and spent a lot of time reverse engineering Microsofts until I could really do all that it could do. Traditionally the OS manufacturer wrote the linker and did not document things well enough for someone else to.

Clang is not just for linux; people are going to build embedded bare metal apps and the OS itself (linux for example) and need many obscure features.

I think writing a new elf linker for linux and bare metal is possible but I would forget about supporting COFF and Microsoft format and other OS’s like BSD or at least leave that open for someone else to add that can really add all the bells and whistles for that OS.

reed

It looks like someone got started on this project:

http://www.llvm.org/devmtg/2010-11/Spencer-ObjectFiles.pdf

Does anyone know what kind of progress has been made?

It looks like it is kind of stalled:

~/extern/llvm.head/lib/Object $ svn log

It’s looks the progress is very slow, is there any problem here?

2011/5/15 Hans Stimer <hans.stimer@gmail.com>