[PATCH 3/4] split-stack for powerpc64

Lynn A. Boger laboger@linux.vnet.ibm.com
Wed May 20 16:01:00 GMT 2015


Anytime go code built with gccgo is linked against libraries
built with gcc (without split stack) there could be mixing of split stack
  and non split stack code.  I think that will be a common case.
My understanding is that if you don't use the gold linker in these
cases, it is possible that the app could fail and it won't be clear why.

Maybe the gold linker isn't required to make it work for most cases,
but it will fail for some cases without it.

On 05/20/2015 07:58 AM, David Edelsohn wrote:
> On Wed, May 20, 2015 at 8:13 AM, Lynn A. Boger
> <laboger@linux.vnet.ibm.com> wrote:
>>
>> On 05/19/2015 07:52 PM, Alan Modra wrote:
>>> On Tue, May 19, 2015 at 07:40:15AM -0500, Lynn A. Boger wrote:
>>>> Questions on the use of the options for split stack:
>>>>
>>>> - The way this is implemented, split stack is generated if the
>>>> target platform supports split stack, on ppc64/ppc64le as well
>>>> as on x86, and the use of -fno-split-stack doesn't seem to affect it
>>>> for any of these.  Is that the way it should work?  I would expect
>>>> -fno-split-stack to disable it completely.
>>> Can you give a testcase to show what you mean?  Picking one of the go
>>> testsuite programs at random, I see
>>> $ gcc/xgcc -Bgcc/ -S -I powerpc64le-linux/libgo
>>> /src/gcc-virgin/gcc/testsuite/go.test/test/args.go
>>> $ grep morestack args.s
>>>          bl __morestack
>>>          bl __morestack
>>> $ gcc/xgcc -Bgcc/ -fno-split-stack -S -I powerpc64le-linux/libgo
>>> /src/gcc-virgin/gcc/testsuite/go.test/test/args.go
>>> $ grep morestack args.s
>>> $
>>> That shows -fno-split-stack being honoured.
>> You are correct.  I made some mistake in my testing.
>>>> - The comments say that the gold linker is used for some
>>>> situations but I don't see any reference in the code to enabling
>>>> the gold linker for ppc64le, ppc64, or x86.  Is the user expected
>>>>    to add the option for the gold linker if needed?
>>> At the moment I believe this is true.
>>
>> I have been trying to use the gold linker with your patch and seems to work
>> fine.  I added the following to
>> the STACK_SPLIT_SPEC in gcc/gcc.c to enable the gold linker if -fsplit-stack
>> is set, but that will cause problems
>>   on systems where the gold linker (and the correct level of binutils for
>> Power) is not available.  Is this an
>> absolute requirement to use split stack?  Could the configure determine if
>> gold is available and
>> generate this one way or another?
>>
>> --- gcc.c       (revision 223217)
>> +++ gcc.c       (working copy)
>> @@ -541,7 +541,8 @@ proper position among the other output files.  */
>>      libgcc.  This is not yet a real spec, though it could become one;
>>      it is currently just stuffed into LINK_SPEC.  FIXME: This wrapping
>>      only works with GNU ld and gold.  */
>> -#define STACK_SPLIT_SPEC " %{fsplit-stack: --wrap=pthread_create}"
>> +#define STACK_SPLIT_SPEC \
>> +  " %{fsplit-stack: --wrap=pthread_create -fuse-ld=gold}"
>>
>>   #ifndef LIBASAN_SPEC
>>   #define STATIC_LIBASAN_LIBS \
> Lynn,
>
> split-stack does not require Gold linker.  This is a non-starter.
>
> Gold is necessary for some corner cases of mixing split-stack and
> non-split-stack modules.
>
> - David
>
>
>



More information about the Gcc-patches mailing list