On Fri, Jun 9, 2017 at 11:22 AM, Jan Hubicka wrote: >> On Fri, Jun 9, 2017 at 3:16 AM, Jan Hubicka wrote: >> > >> >> code compiled with -fsplit-stack, if the cold partition calls a >> >> function that is not compiled with -fsplit-stack (such as a C library >> >> function). The problem is that when the linker sees a split-stack >> >> function call a non-split-stack function, it adjusts the function >> >> header to request more stack space. This doesn't work if the call is >> >> in the cold partition, as the linker doesn't know how to find the >> >> header to adjust. You can see this by trying to build the Go library >> >> using the gold linker with this patch. >> > >> > If code does not work, I wonder why we let user to overwrite the default >> > by hand? In other cases we drop the flag with inform message. >> >> My thinking here is that there is no fundamental reason that the code >> does not work, and the actual problem does not lie in GCC but rather >> in the linker (specifically, gold). It's possible in principle to fix >> gold to make this work, and someone who is using a fixed gold could >> then direct GCC to take advantage of this optimization (and later >> after that version of gold is wide-spread enough we can change GCC to >> drop this patch). > > Thanks for explanation. Perhaps we could have this documented, because > otherwise people will think the option is simply broken. I guess even better > we could have configure autodetection for the broken linker. Committed to mainline with docs as follows. Ian