On Thu, Aug 27, 2015 at 2:00 PM, Lynn A. Boger
<[email protected]> wrote:
> Here is an updated patch, with a summary of the differences from my previous
> patch:
>
> - In my previous patch gcc configure was verifying the gold linker even if
> it was the
> default linker, but that is not necessary since in that case -fuse-ld=gold
> does not
> need to be set. Gold version checking is now only done if the alternate
> linker is gold
> and the default linker is not.
> - The STACK_SPLIT_STACK spec define found in gcc/gcc.c now adds
> -fuse-ld=gold
> if the gcc configure determines the alternate gold linker has split stack
> support.
> - A case statement is now used in gcc configure to verify the gold version,
> to make it
> easier for other platforms to add their checks if necessary. I don't know
> if other
> platforms require this checking; Matthias' patch did not check the version.
> For powerpc64
> big and little endian we have to check the gold linker version because the
> split
> stack support was added recently and older gold linkers won't work.
> - The version checking of the gold linker was removed from the libgo
> configure
> since gcc configure has already decided if it is correct.
> - TARGET_CAN_SPLIT_STACK_64BIT is now defined in sysv4.h if the glibc
> version
> is correct for split stack for powerpc64 big and little endian. This define
> is used in
> go/gospec.c in the same way that TARGET_CAN_SPLIT_STACK is used now but,
> additionally verifies that it is a 64 bit compile. This is necessary
> because split
> stack support is not available for ppc 32 bit big endian in gcc or the gold
> linker.
>
> Bootstrapped and tested on x86_64, ppc64le, ppc64 (ran m32, m64 tests)
>
>
> 2015-08-27 Lynn Boger <[email protected]>
>
> gcc/
> PR target/66870
> config/rs6000/sysv4.h: Define TARGET_CAN_SPLIT_STACK_64BIT
> based on LIBC version.
> config.in: Set up HAVE_GOLD_ALTERNATE.
> configure.ac: Define HAVE_GOLD_ALTERNATE if the version of the
> gold
> linker supports split stack.
> configure: Regenerate.
> gcc.c: Add -fuse-ld=gold to STACK_SPLIT_SPEC if
> HAVE_GOLD_ALTERNATE
> is defined.
> go/gospec.c: (lang_specific_driver): Use
> TARGET_CAN_SPLIT_STACK_64BIT
> to control setting of fsplit-stack and u,pthread_create options for
> 64 bit
> compiles.
I'm not sure who is going to approve this patch overall, but I'd
rather the gospec.c changes weren't so #ifdef heavy. I would set m32
unconditionally. Then write something like
supports_split_stack = 0;
#ifdef TARGET_CAN_SPLIT_STACK
supports_split_stack = 1;
#endif
#ifdef TARGET_CAN_SPLIT_STACK64
if (m32)
supports_split_stack = 0;
#endif
Then change the #ifdef TARGET_CAN_SPLIT_STACK code to test supports_split_stack.
Thanks.
Ian