diff options
author | Lynn Boger <laboger@linux.vnet.ibm.com> | 2015-09-30 18:06:11 -0500 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2015-09-30 23:06:11 +0000 |
commit | 402565b61f9783473472fcfd729efa8c1e355d2b (patch) | |
tree | 37eb8b2f85d9a656044717d6a82ffa026692d05c /gcc/go | |
parent | 7dc396e20f0efa59cad65d95d53ff1541d9ae807 (diff) | |
download | gcc-402565b61f9783473472fcfd729efa8c1e355d2b.zip gcc-402565b61f9783473472fcfd729efa8c1e355d2b.tar.gz gcc-402565b61f9783473472fcfd729efa8c1e355d2b.tar.bz2 |
re PR go/66870 (split stack issues on ppc64le and ppc64)
PR target/66870
* config/rs6000/sysv4.h (TARGET_CAN_SPLIT_STACK_64BIT): Define.
* configure.ac: Define HAVE_GOLD_ALTERNATE_SPLIT_STACK on Power
based on gold linker version.
* gcc.c: Add -fuse-ld=gold to STACK_SPLIT_SPEC if
HAVE_GOLD_ALTERNATE_SPLIT_STACK defined.
* configure, config.in: Regenerate.
go:
* gospec.c (lang_specific_driver): Set appropriate split stack
options for 64 bit compiles based on TARGET_CAN_SPLIT_STACK_64BIT.
From-SVN: r228311
Diffstat (limited to 'gcc/go')
-rw-r--r-- | gcc/go/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/go/gospec.c | 27 |
2 files changed, 27 insertions, 6 deletions
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index 2fa56ab..a6e8dd5 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,9 @@ +2015-10-01 Lynn Boger <laboger@linux.vnet.ibm.com> + + PR target/66870 + * gospec.c (lang_specific_driver): Set appropriate split stack + options for 64 bit compiles based on TARGET_CAN_SPLIT_STACK_64BIT. + 2015-09-10 Chris Manghane <cmang@google.com> * go-gcc.cc (Gcc_backend::type_size): Return -1 for diff --git a/gcc/go/gospec.c b/gcc/go/gospec.c index 9ccbe75..2c60ee7 100644 --- a/gcc/go/gospec.c +++ b/gcc/go/gospec.c @@ -106,6 +106,9 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, /* The total number of arguments with the new stuff. */ int num_args = 1; + /* Supports split stack */ + int supports_split_stack = 0; + /* Whether the -o option was used. */ bool saw_opt_o = false; @@ -117,6 +120,9 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, /* Whether the -S option was used. */ bool saw_opt_S = false; + /* Whether the -m32 option was used. */ + bool saw_opt_m32 ATTRIBUTE_UNUSED = false; + /* The first input file with an extension of .go. */ const char *first_go_file = NULL; @@ -152,6 +158,10 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, library = (library == 0) ? 1 : library; break; + case OPT_m32: + saw_opt_m32 = true; + break; + case OPT_pg: case OPT_p: saw_profile_flag = true; @@ -236,15 +246,22 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, /* Copy the 0th argument, i.e., the name of the program itself. */ new_decoded_options[j++] = decoded_options[i++]; - /* If we are linking, pass -fsplit-stack if it is supported. */ #ifdef TARGET_CAN_SPLIT_STACK - if (library >= 0) + supports_split_stack = 1; +#endif + +#ifdef TARGET_CAN_SPLIT_STACK_64BIT + if (!saw_opt_m32) + supports_split_stack = 1; +#endif + + /* If we are linking, pass -fsplit-stack if it is supported. */ + if ((library >= 0) && supports_split_stack) { generate_option (OPT_fsplit_stack, NULL, 1, CL_DRIVER, &new_decoded_options[j]); j++; } -#endif /* NOTE: We start at 1 now, not 0. */ while (i < argc) @@ -381,19 +398,17 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, generate_option (OPT_shared_libgcc, NULL, 1, CL_DRIVER, &new_decoded_options[j++]); -#ifdef TARGET_CAN_SPLIT_STACK /* libgcc wraps pthread_create to support split stack, however, due to relative ordering of -lpthread and -lgcc, we can't just mark __real_pthread_create in libgcc as non-weak. But we need to link in pthread_create from pthread if we are statically linking, so we work- around by passing -u pthread_create to the linker. */ - if (static_link) + if (static_link && supports_split_stack) { generate_option (OPT_Wl_, "-u,pthread_create", 1, CL_DRIVER, &new_decoded_options[j]); j++; } -#endif #if defined(TARGET_SOLARIS) && !defined(USE_GLD) /* We use a common symbol for go$zerovalue. On Solaris, when not |