From 5e39897ee2c73938fa940c4792d987608aeeebcd Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Sat, 10 Feb 2024 14:44:41 +0000 Subject: x86, libgcc: Implement ia32 basic heap trampoline [PR113855]. The initial heap trampoline implementation was targeting 64b platforms. As the PR demonstrates this creates an issue where it is expected that the same symbols are exported for 32 and 64b. Rather than conditionalize the exports and code-gen on x86_64, this patch provides a basic implementation of the IA32 trampoline. This also avoids potential user confusion, when a 32b target has 64b multilibs, and vice versa; which is the case for Darwin. PR target/113855 gcc/ChangeLog: * config/i386/darwin.h (DARWIN_HEAP_T_LIB): Moved to be available to all sub-targets. * config/i386/darwin32-biarch.h (DARWIN_HEAP_T_LIB): Delete. * config/i386/darwin64-biarch.h (DARWIN_HEAP_T_LIB): Delete. libgcc/ChangeLog: * config.host: Add trampoline support to x?86-linux. * config/i386/heap-trampoline.c (trampoline_insns): Provide a variant for IA32. (union ix86_trampoline): Likewise. (__gcc_nested_func_ptr_created): Implement a basic trampoline for IA32. --- gcc/config/i386/darwin.h | 3 ++- gcc/config/i386/darwin32-biarch.h | 3 --- gcc/config/i386/darwin64-biarch.h | 3 --- 3 files changed, 2 insertions(+), 7 deletions(-) (limited to 'gcc') diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h index 8e64b4e..bf9c45d 100644 --- a/gcc/config/i386/darwin.h +++ b/gcc/config/i386/darwin.h @@ -119,9 +119,10 @@ along with GCC; see the file COPYING3. If not see /* We default to x86_64 for single-arch builds, bi-arch overrides. */ #define DARWIN_ARCH_SPEC "x86_64" #define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC +#endif + #undef DARWIN_HEAP_T_LIB #define DARWIN_HEAP_T_LIB " -lheapt_w " -#endif #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ diff --git a/gcc/config/i386/darwin32-biarch.h b/gcc/config/i386/darwin32-biarch.h index 2180f5a..051ad12 100644 --- a/gcc/config/i386/darwin32-biarch.h +++ b/gcc/config/i386/darwin32-biarch.h @@ -27,9 +27,6 @@ along with GCC; see the file COPYING3. If not see #undef DARWIN_SUBARCH_SPEC #define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC -#undef DARWIN_HEAP_T_LIB -#define DARWIN_HEAP_T_LIB " %{m64:-lheapt_w}" - #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ DARWIN_EXTRA_SPECS \ diff --git a/gcc/config/i386/darwin64-biarch.h b/gcc/config/i386/darwin64-biarch.h index 6208007..8543679 100644 --- a/gcc/config/i386/darwin64-biarch.h +++ b/gcc/config/i386/darwin64-biarch.h @@ -28,9 +28,6 @@ along with GCC; see the file COPYING3. If not see #undef DARWIN_SUBARCH_SPEC #define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC -#undef DARWIN_HEAP_T_LIB -#define DARWIN_HEAP_T_LIB "%{!m32:-lheapt_w}" - #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ DARWIN_EXTRA_SPECS \ -- cgit v1.1