aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/fuchsia.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2022-01-24 11:13:39 +0100
committerJakub Jelinek <jakub@redhat.com>2022-01-24 11:13:39 +0100
commit2c31a8be4a5db11a0a0e97c366dded6362421086 (patch)
tree05d4bf8380fcdc83d6c63f02290e640b806628bd /gcc/config/fuchsia.h
parentc106529eb219976426eeb9b3e47ad7f496e89b0e (diff)
downloadgcc-2c31a8be4a5db11a0a0e97c366dded6362421086.zip
gcc-2c31a8be4a5db11a0a0e97c366dded6362421086.tar.gz
gcc-2c31a8be4a5db11a0a0e97c366dded6362421086.tar.bz2
properly disable -fsplit-stack on non-glibc targets [PR104170]
On Sat, Jan 22, 2022 at 10:32:21AM +0100, Martin Liška wrote: > I've just noticed the patch broke a few cross compilers: > > s390x-ibm-tpf: > > /home/marxin/buildworker/zen2-cross-compilers/build/gcc/common/config/s390/s390-common.cc: In function ‘bool s390_supports_split_stack(bool, gcc_options*)’: > /home/marxin/buildworker/zen2-cross-compilers/build/gcc/common/config/s390/s390-common.cc:126:13: error: ‘struct gcc_options’ has no member named ‘x_linux_libc’ > 126 | if (opts->x_linux_libc == LIBC_GLIBC) > | ^~~~~~~~~~~~ > > i686-kopensolaris-gnu, i686-symbolics-gnu > > /home/marxin/buildworker/zen2-cross-compilers/build/gcc/common/config/i386/i386-common.cc: In function ‘bool ix86_supports_split_stack(bool, gcc_options*)’: > /home/marxin/buildworker/zen2-cross-compilers/build/gcc/common/config/i386/i386-common.cc:1721:13: error: ‘struct gcc_options’ has no member named ‘x_linux_libc’ > 1721 | if (opts->x_linux_libc != LIBC_GLIBC) > | ^~~~~~~~~~~~ > make[1]: *** [Makefile:2418: i386-common.o] Error 1 > > Can you please take a look? Btw. do you have a bugzilla account? I bet instead of opts->x_linux_libc != LIBC_GLIBC it needs to use #ifdef OPTION_GLIBC if (!OPTION_GLIBC) #endif or so. I think the first committed patch actually used that but used it in #if directive, which is wrong because it is something that needs to be evaluated at runtime. That doesn't work well either, because the *supports_split_stack hooks have opts argument and OPTION_GLIBC doesn't take that. So, here is a patch that introduces OPTION_*_P macros that take opts as an argument and redefines OPTION_* using those (similarly to how the option scripts create TARGET_*_P and TARGET_* macros). 2022-01-24 Jakub Jelinek <jakub@redhat.com> PR bootstrap/104170 * config/linux.h (OPTION_GLIBC_P, OPTION_UCLIBC_P, OPTION_BIONIC_P, OPTION_MUSL_P): Define. (OPTION_GLIBC, OPTION_UCLIBC, OPTION_BIONIC, OPTION_MUSL): Redefine using OPTION_*_P macros. * config/alpha/linux.h (OPTION_GLIBC_P, OPTION_UCLIBC_P, OPTION_BIONIC_P, OPTION_MUSL_P): Define. (OPTION_GLIBC, OPTION_UCLIBC, OPTION_BIONIC, OPTION_MUSL): Redefine using OPTION_*_P macros. * config/rs6000/linux.h (OPTION_GLIBC_P, OPTION_UCLIBC_P, OPTION_BIONIC_P, OPTION_MUSL_P): Define. (OPTION_GLIBC, OPTION_UCLIBC, OPTION_BIONIC, OPTION_MUSL): Redefine using OPTION_*_P macros. * config/rs6000/linux64.h (OPTION_GLIBC_P, OPTION_UCLIBC_P, OPTION_BIONIC_P, OPTION_MUSL_P): Define. (OPTION_GLIBC, OPTION_UCLIBC, OPTION_BIONIC, OPTION_MUSL): Redefine using OPTION_*_P macros. * config/fuchsia.h (OPTION_MUSL_P): Redefine. * config/glibc-stdint.h (OPTION_MUSL_P): Define if not defined. * common/config/s390/s390-common.cc (s390_supports_split_stack): Re-add ATTRIBUTE_UNUSED to opts parameter. If OPTION_GLIBC_P is defined, use OPTION_GLIBC_P (opts) as condition, otherwise assume if (false). * common/config/i386/i386-common.cc (ix86_supports_split_stack): If OPTION_GLIBC_P is defined use !OPTION_GLIBC_P (opts) as condition, otherwise assume if (true).
Diffstat (limited to 'gcc/config/fuchsia.h')
-rw-r--r--gcc/config/fuchsia.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/config/fuchsia.h b/gcc/config/fuchsia.h
index e013265..0baf6f1f 100644
--- a/gcc/config/fuchsia.h
+++ b/gcc/config/fuchsia.h
@@ -52,6 +52,8 @@ along with GCC; see the file COPYING3. If not see
/* We are using MUSL as our libc. */
#undef OPTION_MUSL
#define OPTION_MUSL 1
+#undef OPTION_MUSL_P
+#define OPTION_MUSL_P(opts) 1
#ifndef TARGET_SUB_OS_CPP_BUILTINS
#define TARGET_SUB_OS_CPP_BUILTINS()