<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="Title" content="">
<meta name="Keywords" content="">
<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;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.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 bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">I believe what's happening here is that clang translates the -fuse-ld=lld into calling the ld.lld executable, which is actually the ELF LLD linker, not the Mach-O one. On 6.0, the Mach-O linker symlink is called ld64.lld instead (and clang
 has been changed to call out to that name) to disambiguate the two. For 5.0, I'm not sure how best to force the Mach-O linker (I'm not familiar with how the distribution is laid out).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">As Saleem said though, Mach-O LLD isn't really ready yet, so you're better off using ld64 (the default linker).<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">llvm-dev <llvm-dev-bounces@lists.llvm.org> on behalf of Julio César Rocha via llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Reply-To: </b>Julio César Rocha <julioc.rocha@gmail.com><br>
<b>Date: </b>Sunday, January 7, 2018 at 7:17 AM<br>
<b>To: </b>"llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org><br>
<b>Subject: </b>[llvm-dev] Fwd: LLD (macOS) usage?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">Hi. I'm using LLVM 5.0.1 on macOS 10.12. <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I have a very simple program (program.c):<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">int main() {}<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">When attempting to compile with LLD, I get this output:<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">$ clang -fuse-ld=lld program.c<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">/opt/llvm/5.0.1/bin/ld.lld: error: unknown argument: -no_deduplicate<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">/opt/llvm/5.0.1/bin/ld.lld: error: unknown argument: -dynamic<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">/opt/llvm/5.0.1/bin/ld.lld: error: unknown argument: -arch<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">/opt/llvm/5.0.1/bin/ld.lld: error: unknown emulation: acosx_version_min<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">/opt/llvm/5.0.1/bin/ld.lld: error: unable to find library -lto_library<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">/opt/llvm/5.0.1/bin/ld.lld: error: /opt/llvm/5.0.1/lib/libLTO.dylib: invalid data encoding<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Looks like the flags passed to the linker are just wrong, but can't find any relevant documentation at
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_docs&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=u7AStivTiQUkhMKu66ZUkCBZPZEq4EYZ0fP-0tIofUw&s=KYkQl_-tlad-fETHEsTQO9QhksIQ7vvHuBrL_1DXAQw&e=" target="_blank">
llvm.org/docs</a>.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Please help?<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>