<p dir="ltr">I'll come up with a address-space-based proof of concept.</p>
<br><div class="gmail_quote"><div dir="ltr">On Wed, Feb 10, 2016, 17:05 Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Feb 10, 2016 at 5:04 PM Hal Finkel <<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000"><br><hr><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><b>From: </b>"Eric Christopher" <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>><br><b>To: </b>"Tim Shen" <<a href="mailto:timshen@google.com" target="_blank">timshen@google.com</a>>, <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>, "Hal Finkel" <<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>>, "Kit Barton" <<a href="mailto:kbarton@ca.ibm.com" target="_blank">kbarton@ca.ibm.com</a>><br><b>Sent: </b>Wednesday, February 10, 2016 6:59:50 PM<br><b>Subject: </b>Re: [llvm-dev] [PPC] Linker fails on -fstack-protector</blockquote></div></div><div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000"><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><br><br><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Jan 25, 2016 at 11:58 AM Tim Shen via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>When -fstack-protector is turned on, linker fails to find the symbol "<span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap">__stack_chk_guard" because at least for powerpc64le, glibc doesn't provide this symbol. Instead, they put the stack guard into TCB.</span></div><div><span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap">x86 fixed this issue by injecting a special address space (which is later translated to TCB register access) and hard code the offset of stack_guard, but I don't see a easy way to handle address spaces in ppc.</span></div></div></blockquote><br></div></div></blockquote></div></div><div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000"><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"></blockquote><br>Why is handling address spaces in ppc any more difficult than doing so for x86?<br></div></div></blockquote><div><br></div></div></div><div dir="ltr"><div class="gmail_quote"><div>Shouldn't be at all, mostly just seems that a bunch of it hasn't been set up yet.</div></div></div><div dir="ltr"><div class="gmail_quote"><div><br></div><div>-eric</div></div></div><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000"><br> -Hal</div></div><div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000"><br><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap"></span></div><div><span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap">A cleaner solution could be adding an IR intrinsic llvm.get_tcb_address() and hard code the offset of stack_guard member, since they aren't supposed to change.</span></div><div><br></div>Details are in the bug: <a href="https://llvm.org/bugs/show_bug.cgi?id=26226" target="_blank">https://llvm.org/bugs/show_bug.cgi?id=26226</a><br><div><br></div><div>Any ideas?</div><div><br></div></div></blockquote><div><br></div><div>Not a huge fan of a ppc specific intrinsic (which it should be, so llvm.ppc... if we go that route) to do this. I actually rather liked the cleanliness of the address space solution for x86. How much work would it be to do that? Alternately: Hal, Kit, what do you two think as far as the ppc backend?</div><div><br></div><div>The other solution you mentioned - combining the slot load into the existing intrinsic might work, we'd just need to figure out how to autoupgrade everything into it which might be a bit more difficult than fixing the backends and dealing. Have you looked into how the autoupgrade would work?</div><div><br></div><div>Thanks!</div><div><br></div><div>-eric</div><div> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>Thanks!</div></div>
_______________________________________________<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>
</blockquote><br><br><br></div></div><div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000">-- <br><div><span name="x"></span>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory<span name="x"></span><br></div></div></div></blockquote></div></div></blockquote></div>