public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Iain D Sandoe <iains@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r10-10791] Darwin, crts: Build Darwin10 unwinder shim as a library.
Date: Sun, 29 May 2022 19:10:59 +0000 (GMT)	[thread overview]
Message-ID: <20220529191059.8DDC13829BDD@sourceware.org> (raw)

https://gcc.gnu.org/g:e1533cab245c561dc86c287807847b1de0db8804

commit r10-10791-ge1533cab245c561dc86c287807847b1de0db8804
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sat Sep 18 17:08:42 2021 +0100

    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)

Diff:
---
 gcc/config/darwin.h    | 2 +-
 libgcc/config.host     | 2 +-
 libgcc/config/t-darwin | 6 ++++++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 64f12d76625..6bcd1d18ffc 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -230,7 +230,7 @@ extern GTY(()) int darwin_ms_struct;
       %{%:sanitize(address): -lasan } \
       %{%:sanitize(undefined): -lubsan } \
       %(link_ssp) \
-      %:version-compare(>< 10.6 10.7 mmacosx-version-min= -ld10-uwfef.o) \
+      %:version-compare(>< 10.6 10.7 mmacosx-version-min= -ld10-uwfef) \
       %(link_gcc_c_sequence) \
     }}}\
     %{!nostdlib:%{!r:%{!nostartfiles:%E}}} %{T*} %{F*} "\
diff --git a/libgcc/config.host b/libgcc/config.host
index ab58027e68e..324bbdacbec 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -218,7 +218,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) $@


                 reply	other threads:[~2022-05-29 19:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220529191059.8DDC13829BDD@sourceware.org \
    --to=iains@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).