<div dir="ltr">> <span style="font-family:arial,sans-serif;font-size:13px">Hm? On the contrary, in the attached file  "libclang_rt.profile.x86_64.</span><span style="font-family:arial,sans-serif;font-size:13px">a" is listed *after* its dependencies, in particular, after "-lc".</span><div style="font-family:arial,sans-serif;font-size:13px">> I think this is wrong, and we should just fix it in the driver. "-nodefautlibs" shouldn't be a problem here, as you seem to add "-lc", "-lpthread"</div><div style="font-family:arial,sans-serif;font-size:13px">> etc. manually to your linker invocation.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Yep. Sorry if I was unclear. I believe we are in agreement.</div><div style="font-family:arial,sans-serif;font-size:13px">The linked libraries that come before "libclang_rt.profile.x86_64.a" are the ones libc++ manually specifies. </div><div style="font-family:arial,sans-serif;font-size:13px">They actually need to appear after "libclang_rt.profile.x86_64.a" but there is no way to make that happen.</div><div style="font-family:arial,sans-serif;font-size:13px">When -nodefaultlibs is not passed the linker driver automatically puts the required libraries after "libclang_rt.profile.x86_64.a" so the issues doesn't arise.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">/Eric</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 10, 2014 at 3:33 PM, Alexey Samsonov <span dir="ltr"><<a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sun, Nov 9, 2014 at 10:39 PM, Eric Fiselier <span dir="ltr"><<a href="mailto:eric@efcs.ca" target="_blank">eric@efcs.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I'm working on making libc++ generate code coverage data. This means that libclang_rt.profile.x86_64.a is put into the link command before '-lc' and other dependencies.</div><div>I suspect this change in library order causes the linker errors I see while running the tests.</div><div><br></div><div>I have a couple of questions:</div><div>  - Should -ftest-coverage be passed when linking libc++?</div><div>  - Is there a way to link libclang_rt.profile.x86_64.a after the given linker flags</div><div><br></div><div><br></div><div>This file shows the ld invocation with and without -nodefaultlibs as well as the error produced when</div><div>linking tests w/ -nodefaultlibs</div><div><a href="http://pastebin.com/QWagJpsW" target="_blank">http://pastebin.com/QWagJpsW</a></div></div></blockquote><div><br></div></div></div><div>Hm? On the contrary, in the attached file  "libclang_rt.profile.x86_64.a" is listed *after* its dependencies, in particular, after "-lc".</div><div>I think this is wrong, and we should just fix it in the driver. "-nodefautlibs" shouldn't be a problem here, as you seem to add "-lc", "-lpthread"</div><div>etc. manually to your linker invocation.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><div dir="ltr"><div><br></div><div><br></div><div>Any help is appreciated</div><span><font color="#888888"><div><br></div><div>/Eric</div><div><br></div></font></span></div>
<br></span><span class="">_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</font></span></div></div>
</blockquote></div><br></div>