brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.5 KiB · 38688a9 Raw
109 lines · plain
1.. raw:: html2 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:: none10.. role:: partial11.. role:: good12 13===============14Windows support15===============16 17LLD supports Windows operating system. When invoked as ``lld-link.exe`` or with18``-flavor link``, the driver for Windows operating system is used to parse19command line options, and it drives further linking processes. LLD accepts20almost all command line options that the linker shipped with Microsoft Visual21C++ (link.exe) supports.22 23The current status is that LLD is used to link production builds of large24real-world binaries such as Firefox and Chromium.25 26Development status27==================28 29Driver30  :good:`Mostly done`. Some exotic command line options that are not usually31  used for application development, such as ``/DRIVER``, are not supported.32 33Linking against DLL34  :good:`Done`. LLD can read import libraries needed to link against DLL. Both35  export-by-name and export-by-ordinal are supported.36 37Linking against static library38  :good:`Done`. The format of static library (.lib) on Windows is actually the39  same as on Unix (.a). LLD can read it.40 41Creating DLL42  :good:`Done`. LLD creates a DLL if ``/DLL`` option is given. Exported43  functions can be specified either via command line (``/EXPORT``) or via44  module-definition file (.def). Both export-by-name and export-by-ordinal are45  supported.46 47Windows resource files support48  :good:`Done`. If an ``.res`` file is given, LLD converts the file to a COFF49  file using LLVM's Object library.50 51Safe Structured Exception Handler (SEH)52  :good:`Done` for both x86 and x64.53 54Module-definition file55  :partial:`Partially done`. LLD currently recognizes these directives:56  ``EXPORTS``, ``HEAPSIZE``, ``STACKSIZE``, ``NAME``, and ``VERSION``.57 58Debug info59  :good:`Done`.  LLD can emit PDBs that are at parity with those generated by60  link.exe.  However, LLD does not support /DEBUG:FASTLINK.61 62 63Downloading LLD64===============65 66The Windows version of LLD is included in the `pre-built binaries of LLVM's67releases <https://releases.llvm.org/download.html>`_ and in the `LLVM Snapshot68Builds <https://llvm.org/builds/>`_.69 70Building LLD71============72 73Using Visual Studio IDE/MSBuild74-------------------------------75 761. Check out LLVM and LLD from the LLVM SVN repository (or Git mirror),77#. run ``cmake -G "Visual Studio 12" <llvm-source-dir>`` from VS command prompt,78#. open LLVM.sln with Visual Studio, and79#. build ``lld`` target in ``lld executables`` folder80 81Alternatively, you can use msbuild if you don't like to work in an IDE::82 83  msbuild LLVM.sln /m /target:"lld executables\lld"84 85MSBuild.exe had been shipped as a component of the .NET framework, but since862013 it's part of Visual Studio. You can find it at "C:\\Program Files87(x86)\\msbuild".88 89You can build LLD as a 64-bit application. To do that, open VS2013 x64 command90prompt and run cmake for "Visual Studio 12 Win64" target.91 92Using Ninja93-----------94 951. 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``98 99Extensions100==========101 102LLD flags103---------104 105* ``/build-id``: Always generate GUID hash. When PDB is generated, LLD uses PDB106  content hash for GUID. Otherwise, LLD uses output binary content hash for GUID.107  LLD also provides ``__buildid`` symbol pointing to the 16 bytes GUID hash if108  there is a reference to it.109