* [pushed] Darwin: Amend REAL_LIBGCC_SPEC comment [NFC].
@ 2022-05-28 10:59 Iain Sandoe
0 siblings, 0 replies; only message in thread
From: Iain Sandoe @ 2022-05-28 10:59 UTC (permalink / raw)
To: gcc-patches
This comment had got out of sync with reality, partly due to merging
of patches. Updated to reflect the current implementation.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/ChangeLog:
* config/darwin.h (REAL_LIBGCC_SPEC): Update the comment block
describing this macro.
---
gcc/config/darwin.h | 38 +++++++++++++-------------------------
1 file changed, 13 insertions(+), 25 deletions(-)
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 3682bd2b2c5..b73e12372d8 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -465,48 +465,36 @@ extern GTY(()) int darwin_ms_struct;
#define LIB_SPEC "%{!static:-lSystem}"
-/*
- Note that by default, -lgcc_eh is not linked against.
- This is because,in general, we need to unwind through system libraries that
- are linked with the shared unwinder in libunwind (or libgcc_s for 10.4/5).
+/* Note that by default, -lgcc_eh (which provides a statically-linked unwinder)
+ is not used. This is because, in general, we need to unwind through system
+ libraries that are linked with the shared unwinder in libunwind (or libgcc_s
+ for OSX 10.4/5 [darwin8/9]).
- For -static-libgcc: < 10.6, use the unwinder in libgcc_eh (and find
- the emultls impl. there too).
+ When -static-libgcc is forced: < 10.6, use the unwinder in libgcc_eh (and
+ find the emultls impl. there too).
For -static-libgcc: >= 10.6, the unwinder *still* comes from libSystem and
we find the emutls impl from lemutls_w. In either case, the builtins etc.
- are linked from -lgcc.
+ are linked from -lgcc. The eh library is still available so that it could
+ be specified explicitly if there is some reason to do so.
When we have specified shared-libgcc or any case that might require
exceptions, we pull the libgcc content (including emulated tls) from
- -lgcc_s.1 in GCC and the unwinder from /usr/lib/libgcc_s.1 for < 10.6 and
+ -lgcc_s.1.1 in GCC and the unwinder from /usr/lib/libgcc_s.1 for < 10.6 and
libSystem for >= 10.6 respectively.
Otherwise, we just link the emutls/builtins from convenience libs.
- If we need exceptions, prior to 10.3.9, then we have to link the static
- eh lib, since there's no shared version on the system.
-
- In all cases, libgcc_s.1 will be installed with the compiler, or any app
- built using it, so we can link the builtins and emutls shared on all.
-
We have to work around that DYLD_XXXX are disabled in macOS 10.11+ which
means that any bootstrap trying to use a shared libgcc with a bumped SO-
name will fail. This means that we do not accept shared libgcc for these
- versions.
+ versions (the primary reason for forcing a shared libgcc was that it
+ contained the unwinder on Darwin8 and 9).
- For -static-libgcc: >= 10.6, the unwinder *still* comes from libSystem and
- we find the emutls impl from lemutls_w. In either case, the builtins etc.
- are linked from -lgcc.
->
- Otherwise, we just link the shared version of gcc_s.1.1 and pick up
- exceptions:
+ When using the shared version of gcc_s.1.1 the unwinder is provided by:
* Prior to 10.3.9, then we have to link the static eh lib, since there
- is no shared version on the system.
+ is no shared unwinder version on the system.
* from 10.3.9 to 10.5, from /usr/lib/libgcc_s.1.dylib
* from 10.6 onwards, from libSystem.dylib
-
- In all cases, libgcc_s.1.1 will be installed with the compiler, or any app
- built using it, so we can link the builtins and emutls shared on all.
*/
#undef REAL_LIBGCC_SPEC
#define REAL_LIBGCC_SPEC \
--
2.24.3 (Apple Git-128)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-28 10:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-28 10:59 [pushed] Darwin: Amend REAL_LIBGCC_SPEC comment [NFC] Iain Sandoe
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).