]> git.ipfire.org Git - thirdparty/gcc.git/commit
libgcc: Make heap trampoline support dynamic [PR113403].
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 28 Jan 2024 13:31:56 +0000 (13:31 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Tue, 30 Jan 2024 09:33:09 +0000 (09:33 +0000)
commit506e74f53a5e4f607284d3c41da17cdd3eca4fb8
tree2164d58210734142c354fbc6b0ce9a9c25e54fdb
parent7b3b3788c579856abcfdc6eed589c64dc7e88cdb
libgcc: Make heap trampoline support dynamic [PR113403].

In order to handle system security constraints during GCC build
and test and that most platform versions cannot link to libgcc_eh
since the unwinder there is incompatible with the system one.

1. We make the support functions weak definitions.
2. We include them as a CRT for platform conditions that do not
   allow libgcc_eh.
3. We ensure that the weak symbols are exported from DSOs (which
   includes exes on Darwin) so that the dynamic linker will
   pick one instance (which avoids duplication of trampoline
   caches).

PR libgcc/113403

gcc/ChangeLog:

* config/darwin.h (DARWIN_SHARED_WEAK_ADDS, DARWIN_WEAK_CRTS): New.
(REAL_LIBGCC_SPEC): Move weak CRT handling to separate spec.
* config/i386/darwin.h (DARWIN_HEAP_T_LIB): New.
* config/i386/darwin32-biarch.h (DARWIN_HEAP_T_LIB): New.
* config/i386/darwin64-biarch.h (DARWIN_HEAP_T_LIB): New.
* config/rs6000/darwin.h (DARWIN_HEAP_T_LIB): New.

libgcc/ChangeLog:

* config.host: Build libheap_t.a for i686/x86_64 Darwin.
* config/aarch64/heap-trampoline.c (HEAP_T_ATTR): New.
(allocate_tramp_ctrl): Allow a target to build this as a weak def.
(__gcc_nested_func_ptr_created): Likewise.
* config/i386/heap-trampoline.c (HEAP_T_ATTR): New.
(allocate_tramp_ctrl): Allow a target to build this as a weak def.
(__gcc_nested_func_ptr_created): Likewise.
* config/t-darwin: Build libheap_t.a (a CRT with heap trampoline
support).
gcc/config/darwin.h
gcc/config/i386/darwin.h
gcc/config/i386/darwin32-biarch.h
gcc/config/i386/darwin64-biarch.h
gcc/config/rs6000/darwin.h
libgcc/config.host
libgcc/config/aarch64/heap-trampoline.c
libgcc/config/i386/heap-trampoline.c
libgcc/config/t-darwin