<div dir="ltr">This is already fixed.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 17, 2013 at 12:17 PM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com" target="_blank">kcc@google.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">+Sergey Matveev<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 10, 2013 at 2:00 AM, Andy Jost <span dir="ltr"><<a href="mailto:Andrew.Jost@synopsys.com" target="_blank">Andrew.Jost@synopsys.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">Ok, after familiarizing myself with clone it appears to me this is a bug in compiler-rt.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">From the clone man page:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="text-indent:.5in">In Linux 2.4 and earlier, clone() does not take arguments ptid, tls, and ctid.
<u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal">The source file passes those arguments without any fencing to check the Linux version. Also, ptid, tls, and ctid are only used in conjunction with certain flags (e.g., CLONE_PARENT_SETTID), but none of those flags are set.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">It looks like the fix (for all Linux versions) would be to simply remove the last three arguments from the call.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">-Andy<u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a>]
<b>On Behalf Of </b>Andy Jost<br>
<b>Sent:</b> Tuesday, July 09, 2013 2:44 PM<br>
<b>To:</b> <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a><br>
<b>Subject:</b> [LLVMdev] Error building compiler-rt<u></u><u></u></span></p>
</div>
</div><div><div>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I get the following error while building compiler-rt:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:.5in">/slowfs/msret_s1_us03/ajost/src/llvm-3.3.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux.cc:315:22: error: no matching function for call to 'clone'<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in"> pid_t tracer_pid = clone(TracerThread, tracer_stack.Bottom(),<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in"> ^~~~~<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in">/usr/include/bits/sched.h:71:12: note: candidate function not viable: requires 4 arguments, but 7 were provided<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in">extern int clone (int (*__fn) (void *__arg), void *__child_stack,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Inside sched.h, clone is indeed declared with four arguments, but, interestingly, the man page for clone provides this prototype:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> #include <sched.h><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> int clone(int (*fn)(void *), void *child_stack,<u></u><u></u></p>
<p class="MsoNormal"> int flags, void *arg, ...<u></u><u></u></p>
<p class="MsoNormal"> /* pid_t *pid, struct user_desc *tls, pid_t *ctid */ );<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’m running RedHat EL 2.6.9-89.ELlargesmp without root privileges.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Is this a bug in LLVM? Do I just have an old version of clone that’s not supported by LLVM? I can try just removing the last three arguments from the compiler-rt source, but is that the best solution? If someone can point out a clean
way to fix this, then I don’t mind trying to contribute a patch (I would need to learn how).<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Also, is this something that autoconf should have detected? What should it have done about it?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">-Andy <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div></div></div>
</div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>