<div dir="ltr"><div>But, where do you actually check for __SSP__</div><div><br></div><div>The guard just checks for not windows and not dynamic <a href="https://github.com/ghc/ghc/commit/686e72253aed3880268dd6858eadd8c320f09e97#diff-03f5bc5a50fd8ae13e902782c4392c38R1157">https://github.com/ghc/ghc/commit/686e72253aed3880268dd6858eadd8c320f09e97#diff-03f5bc5a50fd8ae13e902782c4392c38R1157</a></div><div><br></div><div>shouldn't it just be checking for defined(__SSP__) instead? This check is currently only correct if the distro has turned stack protector on by default.</div><div><br></div><div><br></div><div>Regards,</div><div>Tamar<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 16, 2020 at 3:46 PM Moritz Angermann <<a href="mailto:moritz.angermann@gmail.com">moritz.angermann@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="auto">I’ve tried to reproduce this and it turns out, I fail to. You are somehow building the rts either with _FORTYFY_SOURCE or __SSP__, but then your linker ends up not passing -lssp or the equivalent for your tool chain.</div><div dir="auto"><br></div><div dir="auto">At this point I’m tempted to add an additional ARM arch guard. While that would be conceptually wrong, it would reduce the cases where this could go wrong to a rarely used platform. Maybe @Ben Gamari has an idea?</div></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 16 Jul 2020 at 10:25 PM, Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-GB">
<div>
<p class="MsoNormal"><span>Moritz<u></u><u></u></span></p>
<p class="MsoNormal"><span>How’s it going getting this patch committed?<u></u><u></u></span></p>
<p class="MsoNormal"><span>It’s painful manually applying a fix, but then NOT committing that to master by mistake<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>Thanks</span></p></div></div><div lang="EN-GB"><div><p class="MsoNormal"><span><u></u><u></u></span></p>
<p class="MsoNormal"><span>s<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<div style="border-style:none none none solid;border-left:1.5pt solid blue;padding:0cm 0cm 0cm 4pt">
<div>
<div style="border-style:solid none none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Moritz Angermann <<a href="mailto:moritz.angermann@gmail.com" target="_blank">moritz.angermann@gmail.com</a>>
<br>
<b>Sent:</b> 14 July 2020 12:14<br>
<b>To:</b> Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>><br>
<b>Cc:</b> <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<b>Subject:</b> Re: HEAD doesn't build. Totally stalled.<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
For some reason, you end up in the defined RTS_SSP_SYMBOLS, I believe and then the RTS wants __stack_chk symbols. Which it can’t find when linking. <u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
Replacing<u></u><u></u></p>
</div>
<div>
<pre style="white-space:pre-wrap;font-family:monospace">#if !defined(mingw32_HOST_OS) && !defined(DYNAMIC)<u style="font-family:monospace"></u><u style="font-family:monospace"></u></pre>
<pre style="font-family:monospace">#define RTS_SSP_SYMBOLS                                \<u style="font-family:monospace"></u><u style="font-family:monospace"></u></pre>
<pre style="font-family:monospace">      SymI_NeedsProto(__stack_chk_guard)               \<u style="font-family:monospace"></u><u style="font-family:monospace"></u></pre>
<pre style="font-family:monospace">      SymI_NeedsProto(__stack_chk_fail)<u style="font-family:monospace"></u><u style="font-family:monospace"></u></pre>
<pre style="font-family:monospace">#else<u style="font-family:monospace"></u><u style="font-family:monospace"></u></pre>
<pre style="font-family:monospace">#define RTS_SSP_SYMBOLS<u style="font-family:monospace"></u><u style="font-family:monospace"></u></pre>
<pre style="font-family:monospace">#endif<u style="font-family:monospace"></u><u style="font-family:monospace"></u></pre>
<pre style="white-space:pre-wrap;font-family:monospace">With just<u style="font-family:monospace"></u><u style="font-family:monospace"></u></pre>
<pre style="white-space:pre-wrap;font-family:monospace"><u style="font-family:monospace"></u> <u style="font-family:monospace"></u></pre>
<pre style="white-space:pre-wrap;font-family:monospace">#define RTS_SSP_SYMBOLS<u style="font-family:monospace"></u><u style="font-family:monospace"></u></pre>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Should do. I hope. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Currently only on mobile phone :-/<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Cheers,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> Moritz<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Tue, 14 Jul 2020 at 7:06 PM, Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-style:none none none solid;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">thanks.  What specifically do I comment out?<u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div style="border-style:none none none solid;border-left:1.5pt solid blue;padding:0cm 0cm 0cm 4pt">
<div>
<div style="border-style:solid none none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Moritz Angermann <<a href="mailto:moritz.angermann@gmail.com" target="_blank">moritz.angermann@gmail.com</a>>
<br>
<b>Sent:</b> 14 July 2020 12:00<br>
<b>To:</b> Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>><br>
<b>Cc:</b> <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<b>Subject:</b> Re: HEAD doesn't build. Totally stalled.</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:6pt">This was my fault. Not sure why this wasn’t caught in CI. <u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:6pt">It’s due to the addition of the symbols here<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:6pt"> <u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:6pt"><a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fghc%2Fghc%2Fcommit%2F686e72253aed3880268dd6858eadd8c320f09e97%23diff-03f5bc5a50fd8ae13e902782c4392c38R1159&data=02%7C01%7Csimonpj%40microsoft.com%7C39f8b294c72e460d79fe08d827e6fa9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303220283532757&sdata=C8UXF5FKuQ3MuoRuV5UgOH2bftZ3GMgXiKx4B1BAtZM%3D&reserved=0" target="_blank">https://github.com/ghc/ghc/commit/686e72253aed3880268dd6858eadd8c320f09e97#diff-03f5bc5a50fd8ae13e902782c4392c38R1159</a><u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:6pt"> <u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:6pt">You should be able to just comment them out. I’ll prepare a proper fix. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:6pt"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:6pt">Cheers,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:6pt"> Moritz <u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:6pt"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:6pt">On Tue, 14 Jul 2020 at 6:41 PM, Simon Peyton Jones via ghc-devs <<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-style:none none none solid;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt">
<div>
<div>
<p class="MsoNormal">I’m getting this failure in a clean HEAD build. Any ideas?    I’m totally stalled because I can’t build GHC any more.<u></u><u></u></p>
<p class="MsoNormal">I’m using Windows Subsystem for Linux (WSL).<u></u><u></u></p>
<p class="MsoNormal">Help help!<u></u><u></u></p>
<p class="MsoNormal">Thanks<u></u><u></u></p>
<p class="MsoNormal">Simon<u></u><u></u></p>
<p><span style="color:red">/home/simonpj/code/HEAD-9/rts/dist/build/libHSrts_thr_p.a(RtsSymbols.thr_p_o): RtsSymbols.c:rtsSyms: error: undefined reference to '__stack_chk_guard'</span><u></u><u></u></p>
<p>collect2: error: ld returned 1 exit status<u></u><u></u></p>
<p>`cc' failed in phase `Linker'. (Exit code: 1)<u></u><u></u></p>
<p>utils/iserv/<a href="https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fghc.mk%3A105%2F&data=02%7C01%7Csimonpj%40microsoft.com%7C39f8b294c72e460d79fe08d827e6fa9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303220283542753&sdata=BRO3xbuVoyYupwHcYZf0QUnvNG4obhyfMQt8OYEVkBw%3D&reserved=0" target="_blank">ghc.mk:105</a>:
 recipe for target 'utils/iserv/stage2_p/build/tmp/ghc-iserv-prof' failed<u></u><u></u></p>
<p>make[1]: *** [utils/iserv/stage2_p/build/tmp/ghc-iserv-prof] Error 1<u></u><u></u></p>
<p>make[1]: *** Waiting for unfinished jobs....<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<a href="https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.haskell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fghc-devs&data=02%7C01%7Csimonpj%40microsoft.com%7C39f8b294c72e460d79fe08d827e6fa9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303220283552748&sdata=pA9JfE5GLqIWANkrpRmbXbZUCTNcRNzWFKM%2FjyWms0c%3D&reserved=0" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>

</blockquote></div></div>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div>