Rui Ueyama | 3e37326 | 2014-03-05 22:35:32 +0000 | [diff] [blame] | 1 | .. raw:: html |
| 2 | |
| 3 | <style type="text/css"> |
| 4 | .none { background-color: #FFCCCC } |
| 5 | .partial { background-color: #FFFF99 } |
| 6 | .good { background-color: #CCFF99 } |
| 7 | </style> |
| 8 | |
| 9 | .. role:: none |
| 10 | .. role:: partial |
| 11 | .. role:: good |
| 12 | |
| 13 | =============== |
| 14 | Windows support |
| 15 | =============== |
| 16 | |
Rui Ueyama | 406c7d9 | 2015-09-03 17:01:18 +0000 | [diff] [blame] | 17 | LLD supports Windows operating system. When invoked as ``lld-link.exe`` or with |
Rui Ueyama | 3e37326 | 2014-03-05 22:35:32 +0000 | [diff] [blame] | 18 | ``-flavor link``, the driver for Windows operating system is used to parse |
| 19 | command line options, and it drives further linking processes. LLD accepts |
| 20 | almost all command line options that the linker shipped with Microsoft Visual |
| 21 | C++ (link.exe) supports. |
| 22 | |
Rui Ueyama | 406c7d9 | 2015-09-03 17:01:18 +0000 | [diff] [blame] | 23 | The current status is that LLD can link itself on Windows x86/x64 |
| 24 | using Visual C++ 2013 as the compiler. |
Rui Ueyama | 3e37326 | 2014-03-05 22:35:32 +0000 | [diff] [blame] | 25 | |
| 26 | Development status |
| 27 | ================== |
| 28 | |
| 29 | Driver |
| 30 | :good:`Mostly done`. Some exotic command line options that are not usually |
| 31 | used for application develompent, such as ``/DRIVER``, are not supported. |
| 32 | Options for Windows 8 app store are not recognized too |
| 33 | (e.g. ``/APPCONTAINER``). |
| 34 | |
| 35 | Linking against DLL |
| 36 | :good:`Done`. LLD can read import libraries needed to link against DLL. Both |
| 37 | export-by-name and export-by-ordinal are supported. |
| 38 | |
| 39 | Linking against static library |
| 40 | :good:`Done`. The format of static library (.lib) on Windows is actually the |
| 41 | same as on Unix (.a). LLD can read it. |
| 42 | |
| 43 | Creating DLL |
| 44 | :good:`Done`. LLD creates a DLL if ``/DLL`` option is given. Exported |
| 45 | functions can be specified either via command line (``/EXPORT``) or via |
| 46 | module-definition file (.def). Both export-by-name and export-by-ordinal are |
| 47 | supported. LLD uses Microsoft ``lib.exe`` tool to create an import library |
| 48 | file. |
| 49 | |
| 50 | Windows resource files support |
| 51 | :good:`Done`. If an ``.rc`` file is given, LLD converts the file to a COFF |
| 52 | file using some external commands and link it. Specifically, ``rc.exe`` is |
| 53 | used to compile a resource file (.rc) to a compiled resource (.res) |
| 54 | file. ``rescvt.exe`` is then used to convert a compiled resource file to a |
| 55 | COFF object file section. Both tools are shipped with MSVC. |
| 56 | |
| 57 | Safe Structured Exception Handler (SEH) |
Rui Ueyama | 406c7d9 | 2015-09-03 17:01:18 +0000 | [diff] [blame] | 58 | :good:`Done` for both x86 and x64. |
Rui Ueyama | 3e37326 | 2014-03-05 22:35:32 +0000 | [diff] [blame] | 59 | |
| 60 | Module-definition file |
| 61 | :partial:`Partially done`. LLD currently recognizes these directives: |
| 62 | ``EXPORTS``, ``HEAPSIZE``, ``STACKSIZE``, ``NAME``, and ``VERSION``. |
| 63 | |
Rui Ueyama | 3e37326 | 2014-03-05 22:35:32 +0000 | [diff] [blame] | 64 | Debug info |
| 65 | :none:`No progress has been made`. Microsoft linker can interpret the CodeGen |
| 66 | debug info (old-style debug info) and PDB to emit an .pdb file. LLD doesn't |
| 67 | support neither. |
| 68 | |
| 69 | |
Rui Ueyama | dcd25e3 | 2014-03-11 22:40:43 +0000 | [diff] [blame] | 70 | Building LLD |
| 71 | ============ |
| 72 | |
Rui Ueyama | 6ab2944 | 2014-03-13 05:48:46 +0000 | [diff] [blame] | 73 | Using Visual Studio IDE/MSBuild |
Dan Liew | ce5377a | 2014-08-06 14:11:47 +0000 | [diff] [blame] | 74 | ------------------------------- |
Rui Ueyama | 6ab2944 | 2014-03-13 05:48:46 +0000 | [diff] [blame] | 75 | |
Rui Ueyama | dcd25e3 | 2014-03-11 22:40:43 +0000 | [diff] [blame] | 76 | 1. Check out LLVM and LLD from the LLVM SVN repository (or Git mirror), |
Rui Ueyama | 6ab2944 | 2014-03-13 05:48:46 +0000 | [diff] [blame] | 77 | #. run ``cmake -G "Visual Studio 12" <llvm-source-dir>`` from VS command prompt, |
Rui Ueyama | dcd25e3 | 2014-03-11 22:40:43 +0000 | [diff] [blame] | 78 | #. open LLVM.sln with Visual Studio, and |
| 79 | #. build ``lld`` target in ``lld executables`` folder |
| 80 | |
| 81 | Alternatively, you can use msbuild if you don't like to work in an IDE:: |
| 82 | |
| 83 | msbuild LLVM.sln /m /target:"lld executables\lld" |
Rui Ueyama | 406c7d9 | 2015-09-03 17:01:18 +0000 | [diff] [blame] | 84 | |
Rui Ueyama | dcd25e3 | 2014-03-11 22:40:43 +0000 | [diff] [blame] | 85 | MSBuild.exe had been shipped as a component of the .NET framework, but since |
| 86 | 2013 it's part of Visual Studio. You can find it at "C:\\Program Files |
| 87 | (x86)\\msbuild". |
| 88 | |
Rui Ueyama | 21f97dd | 2014-03-12 23:40:18 +0000 | [diff] [blame] | 89 | You can build LLD as a 64 bit application. To do that, open VS2013 x64 command |
| 90 | prompt and run cmake for "Visual Studio 12 Win64" target. |
| 91 | |
Rui Ueyama | 6ab2944 | 2014-03-13 05:48:46 +0000 | [diff] [blame] | 92 | Using Ninja |
| 93 | ----------- |
| 94 | |
| 95 | 1. Check out LLVM and LLD from the LLVM SVN repository (or Git mirror), |
| 96 | #. run ``cmake -G ninja <llvm-source-dir>`` from VS command prompt, |
| 97 | #. run ``ninja lld`` |