HEAD doesn't build. Totally stalled.

Phyx lonetiger at gmail.com
Thu Jul 16 18:45:16 UTC 2020


But, where do you actually check for __SSP__

The guard just checks for not windows and not dynamic
https://github.com/ghc/ghc/commit/686e72253aed3880268dd6858eadd8c320f09e97#diff-03f5bc5a50fd8ae13e902782c4392c38R1157

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.


Regards,
Tamar

On Thu, Jul 16, 2020 at 3:46 PM Moritz Angermann <moritz.angermann at gmail.com>
wrote:

> 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.
>
> 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?
>
> On Thu, 16 Jul 2020 at 10:25 PM, Simon Peyton Jones <simonpj at microsoft.com>
> wrote:
>
>> Moritz
>>
>> How’s it going getting this patch committed?
>>
>> It’s painful manually applying a fix, but then NOT committing that to
>> master by mistake
>>
>>
>>
>> Thanks
>>
>> s
>>
>>
>>
>> *From:* Moritz Angermann <moritz.angermann at gmail.com>
>> *Sent:* 14 July 2020 12:14
>> *To:* Simon Peyton Jones <simonpj at microsoft.com>
>> *Cc:* ghc-devs at haskell.org
>> *Subject:* Re: HEAD doesn't build. Totally stalled.
>>
>>
>>
>> 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.
>>
>>
>>
>> Replacing
>>
>> #if !defined(mingw32_HOST_OS) && !defined(DYNAMIC)
>>
>> #define RTS_SSP_SYMBOLS                                \
>>
>>       SymI_NeedsProto(__stack_chk_guard)               \
>>
>>       SymI_NeedsProto(__stack_chk_fail)
>>
>> #else
>>
>> #define RTS_SSP_SYMBOLS
>>
>> #endif
>>
>> With just
>>
>>
>>
>> #define RTS_SSP_SYMBOLS
>>
>>
>>
>> Should do. I hope.
>>
>>
>>
>> Currently only on mobile phone :-/
>>
>>
>>
>> Cheers,
>>
>>  Moritz
>>
>>
>>
>> On Tue, 14 Jul 2020 at 7:06 PM, Simon Peyton Jones <simonpj at microsoft.com>
>> wrote:
>>
>> thanks.  What specifically do I comment out?
>>
>>
>>
>> *From:* Moritz Angermann <moritz.angermann at gmail.com>
>> *Sent:* 14 July 2020 12:00
>> *To:* Simon Peyton Jones <simonpj at microsoft.com>
>> *Cc:* ghc-devs at haskell.org
>> *Subject:* Re: HEAD doesn't build. Totally stalled.
>>
>>
>>
>> This was my fault. Not sure why this wasn’t caught in CI.
>>
>> It’s due to the addition of the symbols here
>>
>>
>>
>>
>> https://github.com/ghc/ghc/commit/686e72253aed3880268dd6858eadd8c320f09e97#diff-03f5bc5a50fd8ae13e902782c4392c38R1159
>> <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>
>>
>>
>>
>> You should be able to just comment them out. I’ll prepare a proper fix.
>>
>>
>>
>> Cheers,
>>
>>  Moritz
>>
>>
>>
>> On Tue, 14 Jul 2020 at 6:41 PM, Simon Peyton Jones via ghc-devs <
>> ghc-devs at haskell.org> wrote:
>>
>> I’m getting this failure in a clean HEAD build. Any ideas?    I’m totally
>> stalled because I can’t build GHC any more.
>>
>> I’m using Windows Subsystem for Linux (WSL).
>>
>> Help help!
>>
>> Thanks
>>
>> Simon
>>
>> /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'
>>
>> collect2: error: ld returned 1 exit status
>>
>> `cc' failed in phase `Linker'. (Exit code: 1)
>>
>> utils/iserv/ghc.mk:105
>> <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>:
>> recipe for target 'utils/iserv/stage2_p/build/tmp/ghc-iserv-prof' failed
>>
>> make[1]: *** [utils/iserv/stage2_p/build/tmp/ghc-iserv-prof] Error 1
>>
>> make[1]: *** Waiting for unfinished jobs....
>>
>> _______________________________________________
>> ghc-devs mailing list
>> ghc-devs at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>> <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>
>>
>> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20200716/1587eff6/attachment.html>


More information about the ghc-devs mailing list