Óscar Fuentes
2011-Oct-16 14:02 UTC
[LLVMdev] Is there a separate linker for LLVM in Windows?
Don Quixote de la Mancha <quixote at dulcineatech.com> writes:> On Sat, Oct 15, 2011 at 7:35 PM, Ivan Krasin <krasin at google.com> wrote: >> I'm not related to the topic starter, but I see at least one huge >> disadvantage of the dependency on link.exe. >> W/o such a dependency it would be possible reliably generate Windows >> executables on Linux or Mac, which has its own benefits (e.g. >> distributed compilation) > > GRUB, the Grand Unified Build that the Lilypond music engraving system > uses does something like that. > > If you build the GNU Binutils in a cross-compilation mode you can do that. > > Our examples ought to at least mention that one can use Gnu ld on any > platform that ld runs on to link executables for any platform it > generates binraries for. > > Even better would be to provide instructions for building such a > cross-linker. I'd love to write those instructions myself it but I've > got a lot on my plate right now.Or just get it from your Linux distro. For instance, the mingw32-binutils package in Debian-based distros will provide a nice `ld' for cross-compiling to Windows.
Don Quixote de la Mancha
2011-Oct-16 15:53 UTC
[LLVMdev] Is there a separate linker for LLVM in Windows?
On Sun, Oct 16, 2011 at 7:02 AM, Óscar Fuentes <ofv at wanadoo.es> wrote:> Or just get it from your Linux distro.I didn't realize. That's Just Dandy.> For instance, the > mingw32-binutils package in Debian-based distros will provide a nice > `ld' for cross-compiling to Windows.One Mac OS X there are various i386-mingw32 packages in MacPorts: http://www.macports.org/ports.php?by=name&substr=mingw Here are the MacPorts installation instructions: http://www.macports.org/install.php Fedora has a lot of packages that have been built with MingW: https://admin.fedoraproject.org/pkgdb/acls/list/?searchwords=mingw32* There doesn't seem to be a 64-bit port of MingW yet. I would expect GNU Binutils to support 64-bit Windows if you built its source yourself - is that the case? The key part of MingW that makes Windows development possible on so many other platforms is that they have written their own Win32 header files and C runtime library. That way one does not need a Visual Studio license to use its library and headers. To do 64-bit development on Windows completely without Visual Studio, one would need those headers. However, there is a "Lite" version of Visual Studio that Microsoft distributes for free. If it includes the 64-bit headers one could use those until MingW completes its 64-bit support. -- Don Quixote de la Mancha Dulcinea Technologies Corporation Software of Elegance and Beauty http://www.dulcineatech.com quixote at dulcineatech.com
Török Edwin
2011-Oct-16 16:02 UTC
[LLVMdev] Is there a separate linker for LLVM in Windows?
On 2011-10-16 18:53, Don Quixote de la Mancha wrote:> On Sun, Oct 16, 2011 at 7:02 AM, Óscar Fuentes <ofv at wanadoo.es> wrote: >> Or just get it from your Linux distro. > > I didn't realize. That's Just Dandy. > >> For instance, the >> mingw32-binutils package in Debian-based distros will provide a nice >> `ld' for cross-compiling to Windows. > > One Mac OS X there are various i386-mingw32 packages in MacPorts: > > http://www.macports.org/ports.php?by=name&substr=mingw > > Here are the MacPorts installation instructions: > > http://www.macports.org/install.php > > Fedora has a lot of packages that have been built with MingW: > > https://admin.fedoraproject.org/pkgdb/acls/list/?searchwords=mingw32* > > There doesn't seem to be a 64-bit port of MingW yet.http://mingw-w64.sourceforge.net/ It provides both 32-bit and 64-bit (cross)compilers. Best regards, --Edwin
Óscar Fuentes
2011-Oct-16 16:25 UTC
[LLVMdev] Is there a separate linker for LLVM in Windows?
Don Quixote de la Mancha <quixote at dulcineatech.com> writes: [snip]> There doesn't seem to be a 64-bit port of MingW yet. I would expect > GNU Binutils to support 64-bit Windows if you built its source > yourself - is that the case?There are Debian pacakges for MinGW-64. I don't know if you can build your own from Binutils sources or need to patch them.> The key part of MingW that makes Windows development possible on so > many other platforms is that they have written their own Win32 header > files and C runtime library.Header files, yes. C runtime library, no. Just the imports library, which is enough.> That way one does not need a Visual > Studio license to use its library and headers. > > To do 64-bit development on Windows completely without Visual Studio, > one would need those headers. > > However, there is a "Lite" version of Visual Studio that Microsoft > distributes for free. If it includes the 64-bit headers one could use > those until MingW completes its 64-bit support.AFAIK, you can do 64 bit Windows development (including cross-compiling) with MinGW alone. Maybe it doesn't include 100% of the Windows SDK, but should be enough for most cases. So, back on topic, it is possible to link object files generated with LLVM without resorting to Microsoft's linker. And it is possible to link Windows applications on other systems too, all thanks to MinGW's `ld'.
Seemingly Similar Threads
- [LLVMdev] Is there a separate linker for LLVM in Windows?
- [LLVMdev] Proposal: MCLinker - an LLVM integrated linker
- [LLVMdev] Is there a separate linker for LLVM in Windows?
- [LLVMdev] Proposal: MCLinker - an LLVM integrated linker
- [LLVMdev] LLC ARM Backend maintainer