aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2021-09-18 17:08:42 +0100
committerIain Sandoe <iain@sandoe.co.uk>2022-04-14 06:24:56 +0100
commit916814832ab8d91c15b790c97dd5e382a4e8c229 (patch)
tree514151ff235902252d13c812db3f431684c96dc3 /libgcc
parent13ef16cf960b66dcbf85feb32767c68ae75bfba1 (diff)
Darwin, crts: Build Darwin10 unwinder shim as a library.
We have a small unwinder shim that is only used for Darwin10 (and only then in quite specific cases). To avoid linking this code for every executable or DSO, we can present the crt as a convenience library (rather than a .o file). Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/ChangeLog: * config/darwin.h (LINK_COMMAND_SPEC_A): Use Darwin10 unwinder shim as a convenience library. libgcc/ChangeLog: * config.host: Use convenience library for Darwin10 unwinder shim. * config/t-darwin: Build Darwin10 unwinder shim as a convenience library. (cherry picked from commit 873854387865d18484bd0d39324773cd1e76df85)
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/config.host2
-rw-r--r--libgcc/config/t-darwin6
2 files changed, 7 insertions, 1 deletions
diff --git a/libgcc/config.host b/libgcc/config.host
index 0ab18dcc9ff..f9f55e5eea0 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -215,7 +215,7 @@ case ${host} in
*-*-darwin*)
asm_hidden_op=.private_extern
tmake_file="$tmake_file t-darwin ${cpu_type}/t-darwin t-libgcc-pic t-slibgcc-darwin"
- extra_parts="crt3.o d10-uwfef.o crttms.o crttme.o"
+ extra_parts="crt3.o libd10-uwfef.a crttms.o crttme.o"
;;
*-*-dragonfly*)
tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip"
diff --git a/libgcc/config/t-darwin b/libgcc/config/t-darwin
index 3b5e3428958..4b6317b5d85 100644
--- a/libgcc/config/t-darwin
+++ b/libgcc/config/t-darwin
@@ -18,3 +18,9 @@ LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/config/unwind-dw2-fde-darwin.c \
# Patch to __Unwind_Find_Enclosing_Function for Darwin10.
d10-uwfef.o: $(srcdir)/config/darwin10-unwind-find-enc-func.c
$(crt_compile) -mmacosx-version-min=10.6 -c $<
+
+# Using this crt as a library means that it will not be added to an exe
+# (or module) unless needed.
+libd10-uwfef.a: d10-uwfef.o
+ $(AR_CREATE_FOR_TARGET) $@ d10-uwfef.o
+ $(RANLIB_FOR_TARGET) $@