aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/common/config/i386/i386-common.cc17
-rw-r--r--gcc/config/i386/gnu-user-common.h5
-rw-r--r--gcc/config/i386/gnu.h5
3 files changed, 14 insertions, 13 deletions
diff --git a/gcc/common/config/i386/i386-common.cc b/gcc/common/config/i386/i386-common.cc
index cae0b88..7496d17 100644
--- a/gcc/common/config/i386/i386-common.cc
+++ b/gcc/common/config/i386/i386-common.cc
@@ -1714,16 +1714,21 @@ ix86_option_init_struct (struct gcc_options *opts)
field in the TCB, so they cannot be used together. */
static bool
-ix86_supports_split_stack (bool report ATTRIBUTE_UNUSED,
+ix86_supports_split_stack (bool report,
struct gcc_options *opts ATTRIBUTE_UNUSED)
{
+#ifdef TARGET_THREAD_SPLIT_STACK_OFFSET
+ if (opts->x_linux_libc != LIBC_GLIBC)
+#endif
+ {
+ if (report)
+ error ("%<-fsplit-stack%> currently only supported on GNU/Linux");
+ return false;
+ }
+
bool ret = true;
-#ifndef TARGET_THREAD_SPLIT_STACK_OFFSET
- if (report)
- error ("%<-fsplit-stack%> currently only supported on GNU/Linux");
- ret = false;
-#else
+#ifdef TARGET_THREAD_SPLIT_STACK_OFFSET
if (!HAVE_GAS_CFI_PERSONALITY_DIRECTIVE)
{
if (report)
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
index 7525f78..23b54c5 100644
--- a/gcc/config/i386/gnu-user-common.h
+++ b/gcc/config/i386/gnu-user-common.h
@@ -66,8 +66,7 @@ along with GCC; see the file COPYING3. If not see
#define STACK_CHECK_STATIC_BUILTIN 1
/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives and
- targets glibc. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE && OPTION_GLIBC
+ assembler has full support for the CFI directives. */
+#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
#define TARGET_CAN_SPLIT_STACK
#endif
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index daa505a..401e60c 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -35,10 +35,7 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
#endif
-/* -fsplit-stack uses a field in the TCB at a fixed offset. This
- field is only available for glibc. Disable -fsplit-stack for
- other libc implementations to avoid silent TCB corruptions. */
-#if defined (TARGET_LIBC_PROVIDES_SSP) && OPTION_GLIBC
+#ifdef TARGET_LIBC_PROVIDES_SSP
/* i386 glibc provides __stack_chk_guard in %gs:0x14. */
#define TARGET_THREAD_SSP_OFFSET 0x14