From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id F004C385737E for ; Sat, 28 May 2022 10:59:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F004C385737E Received: by mail-wr1-x434.google.com with SMTP id p10so8786662wrg.12 for ; Sat, 28 May 2022 03:59:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:reply-to :mime-version:content-transfer-encoding; bh=mmzyHzxa1Dp8e8kL6IKoyXanP89OnntNgkxQvHCTO8E=; b=lNV6jNxdiQH/BJXjFNgyXb7U2JnCMgTcve5Nyb4DkaF9OmEd0s+duaeApVk1QpRBC/ LDxCDi4xlMQ9T3hKctPqE5NvL9O+1xwyeOgRjVwliPxFW68XSmZjVkaj65YZ4oBcrp7a 7eQHhDsMkocVQ7+Wy9dQLgd2IWw8k8XqC0fRF3dZDa553XPWCa51pcBMHa6+DIVt7jH3 6ova+DeTsPIM7WnlO7GkYqHH4XwT8VyrRIhOC7w5gsR4UGX1oxkDsRIBXfMRL1YtGILg u7eN9QhhgRQ6kWymlMTXu0Z65SChgny022N/uj20RyRFR2a67L7gJUsVhzHNjzwWrrVE SqWQ== X-Gm-Message-State: AOAM531+VeP0O842SEomplDhXBSWmTO0YW3BLtLTKwqhtkgGXCsaoi4M /8AT+WfIxWWxVPRqHwAXBEE46hbLehg= X-Google-Smtp-Source: ABdhPJxl89tbH6syHMgzijfjXdBTAJ3abDfqfMseQDqEoiWy3stMzBAb6YK/LXMyjbQD5YibIgVjEQ== X-Received: by 2002:a5d:5442:0:b0:20f:ca5b:bbca with SMTP id w2-20020a5d5442000000b0020fca5bbbcamr28533238wrv.704.1653735557272; Sat, 28 May 2022 03:59:17 -0700 (PDT) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id g11-20020a5d64eb000000b0020fcc655e4asm4217790wri.5.2022.05.28.03.59.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 May 2022 03:59:16 -0700 (PDT) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [pushed] Darwin: Amend REAL_LIBGCC_SPEC comment [NFC]. Date: Sat, 28 May 2022 11:59:06 +0100 Message-Id: <20220528105906.13070-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.24.3 (Apple Git-128) Reply-To: iain@sandoe.co.uk MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2022 10:59:20 -0000 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 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)