<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">We’ve discussed this with Jim Grosbach at Apple (CC’d). My understanding is that at this time, the officially supported linker for Apple’s platforms is ld64. We’d love to collaborate with Apple (and any other interested parties, for that
matter) on LLD for Mach-O, and we’d be delighted if it were to become officially supported at some point, but there’s a lot of work to be done first on reaching feature parity with ld64 before that could even be considered :) Once we reach feature parity,
I can envision several good reasons both for sticking with ld64 and for switching to LLD. On our end, we aim to create a feature-complete Mach-O linker. We also aim for the end product to be compelling enough that a switch could be considered, and we’d be
happy to work with Apple on that front if it turns out to be.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">What sort of compatibility test suite did you have in mind? We’re adding lit-style unit tests as we add features (as is standard for LLVM), but we didn’t have anything in mind beyond that right now.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">We saw zld, and the speedups achieved by it make us hopeful of being able to achieve similar results with LLD (since we’ll also have better parallelization and better data structures in the form of the LLVM ones). (I’d also be curious if
zld’s improvements could be contributed back to ld64 so that everyone can take advantage of them, but that’s completely tangential, of course.)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">Dave Lee <davelee.com@gmail.com><br>
<b>Date: </b>Tuesday, March 3, 2020 at 7:37 AM<br>
<b>To: </b>Shoaib Meenai <smeenai@fb.com><br>
<b>Cc: </b>"llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org>, Jez Ng <jezng@fb.com><br>
<b>Subject: </b>Re: [llvm-dev] Contributing LLD for Mach-O<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">Hi Shoaib,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Has there been any recent discussion with anyone on Apple's side? Is there a way forward that results in a single unified open source linker? If not at the start, how would it work if they later want to take maintainership?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Have you thought about a compatibility test suite? If so, I'm curious what the approach will be.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Also for what it's worth, there's a recent fork of ld64's recent source drop, which is optimized for incremental compilation. It also uses non-STL data structures, parallelism, and a disk cache. See
<a href="https://github.com/michaeleisel/zld">https://github.com/michaeleisel/zld</a><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Fri, Feb 28, 2020 at 1:32 PM Shoaib Meenai via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi all,<br>
<br>
We’re planning to contribute a new implementation of LLD for Mach-O, using the same design as the COFF and ELF ports. This design has proven to work very well for those ports, and we’re keen to explore it for Mach-O as well. Our work is based on an initial
prototype created by Peter Collingbourne and Rui Ueyama.<br>
<br>
Our initial commit is up for review at <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D75382&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=Du_g8hPBNR5iofm4w6TR-gFx_aFK-4RNxpEmlx-FMNc&s=z1H0UW2F3uSaikSViTE-eRlQmyNhhrkHNq0aj2VxbfE&e=" target="_blank">
https://reviews.llvm.org/D75382</a>. We’ve intentionally stripped down this initial commit as much as possible to ease reviewing; we’ve kept it to the absolute minimum needed to produce and test a working macOS x86-64 executable for that prints “Hello World”
via a syscall. We have several short-term follow-ups planned to add important functionality, such as linking against archives, universal binaries, dylibs, and tbd files, performing subsection splitting (atomization), and producing dylibs. The follow-ups should
give a good sense of the overall design while still keeping each piece easily reviewable and testable individually. Our end goal is to create a full-featured Mach-O linker, and we’ll be working toward that goal over the next several months (and years, in all
likelihood). We’d appreciate feedback and reviews.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Ddev&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=Du_g8hPBNR5iofm4w6TR-gFx_aFK-4RNxpEmlx-FMNc&s=WEM8UzKRSd0-QQZOXRcgL_Rkt5cgC1soudjdbkMnbgA&e=" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</body>
</html>