<html xmlns:v="urn:schemas-microsoft-com:vml" 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:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@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;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 129.75pt 72.0pt 129.7pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoPlainText">Hi Martin,<o:p></o:p></p>
<p class="MsoPlainText">I tried your suggestion of adding "-mllvm -use-unknown-locations=Disable" in the clang CC flag to build test case in my previous email, but it looks still not work in my side with llvm 9.0.0. Could you give me some more advices? Do
I need to use the master LLVM instead of the 9.0.0?<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">$ make -f makefile_clanglto_Oz
<o:p></o:p></p>
<p class="MsoPlainText">"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang" -g -m64 -mcmodel=small -target x86_64-unknown-windows -gcodeview
<span style="color:red">-mllvm -use-unknown-locations=Disable </span>-flto -Oz -c -o main.obj main.c<o:p></o:p></p>
<p class="MsoPlainText">"nasm" -f win64 -o assembly.obj assembly.nasm<o:p></o:p></p>
<p class="MsoPlainText">"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib" /OUT:main.lib main.obj<o:p></o:p></p>
<p class="MsoPlainText">"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib" /OUT:assembly.lib assembly.obj<o:p></o:p></p>
<p class="MsoPlainText">"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/lld-link" /OUT:main.dll /Machine:X64 /DLL /ENTRY:main /DEBUG:GHASH /lldmap main.lib assembly.lib<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">$ /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-pdbutil dump -l main.pdb<o:p></o:p></p>
<p class="MsoPlainText"> Lines<o:p></o:p></p>
<p class="MsoPlainText">============================================================<o:p></o:p></p>
<p class="MsoPlainText">Mod 0000 | `assembly.obj`:<o:p></o:p></p>
<p class="MsoPlainText">Mod 0001 | `/home/jshi19/llvm/wrongcode/lld-link5/lto.tmp`:<o:p></o:p></p>
<p class="MsoPlainText">/home/jshi19/llvm/wrongcode/lld-link5/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)<o:p></o:p></p>
<p class="MsoPlainText"> 0001:00000004-0000001E, line/addr entries = 5<o:p></o:p></p>
<p class="MsoPlainText"> 3 00000004 ! <span style="color:red">0 00000008 !
</span> 5 0000000D ! <span style="color:red">0 00000012 ! </span>9 00000017 !<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Thanks<o:p></o:p></p>
<p class="MsoPlainText">Steven Shi<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><a name="_____replyseparator"></a>> -----Original Message-----</p>
<p class="MsoPlainText">> From: Martin Storsjö <martin@martin.st></p>
<p class="MsoPlainText">> Sent: Friday, January 10, 2020 5:00 AM</p>
<p class="MsoPlainText">> To: David Blaikie <dblaikie@gmail.com></p>
<p class="MsoPlainText">> Cc: Shi, Steven <steven.shi@intel.com>; Reid Kleckner <rnk@google.com>;</p>
<p class="MsoPlainText">> llvm-dev <llvm-dev@lists.llvm.org></p>
<p class="MsoPlainText">> Subject: Re: [llvm-dev] LLD PDB Lines zero number issue</p>
<p class="MsoPlainText">> </p>
<p class="MsoPlainText">> On Thu, 9 Jan 2020, David Blaikie via llvm-dev wrote:</p>
<p class="MsoPlainText">> </p>
<p class="MsoPlainText">> > +rnk who works on COFF debugging things.</p>
<p class="MsoPlainText">> ></p>
<p class="MsoPlainText">> > My understanding is that this has nothing to do with the linker - but is a</p>
<p class="MsoPlainText">> > function of LLVM optimizations creating line zero debug locations. I believe</p>
<p class="MsoPlainText">> > rnk & folks have disabled line zero emission for CodeView debug info in</p>
<p class="MsoPlainText">> some</p>
<p class="MsoPlainText">> > manner - perhaps that needs a flag? or Steven hasn't got a release with</p>
<p class="MsoPlainText">> that</p>
<p class="MsoPlainText">> > change in it?</p>
<p class="MsoPlainText">> </p>
<p class="MsoPlainText">> I think I've run into that with dwarf as well, and there AFAIK it can be</p>
<p class="MsoPlainText">> gotten rid of by adding "-mllvm -use-unknown-locations=Disable".</p>
<p class="MsoPlainText">> </p>
<p class="MsoPlainText">> // Martin</p>
</div>
</body>
</html>