From patchwork Thu May 2 12:53:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1930612 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=CFVEBojU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VVYlg2sgTz1ydT for ; Thu, 2 May 2024 22:53:51 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5D35E3858CDB for ; Thu, 2 May 2024 12:53:49 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 8A9793858D20 for ; Thu, 2 May 2024 12:53:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A9793858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8A9793858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::329 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714654406; cv=none; b=G1NZ8fMF4IGJsOhFsBf6MhvO63PR7/tINZNSDszl326rkGR0fTtfnmgekQBDz1PSOeJ3cO/n5p9qV1unIKpcofylAysMhEAYuD5bTX23ZMjoXAoaREimRiR9LE9jk2k473f3Ow7F6SnkKKapxMpT4WMJz43r5amUFWAwynEwL9Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714654406; c=relaxed/simple; bh=03Rtidc1ESqVHhH3IBe3a9Mbq09Bl+HwcV6nHpyIQV4=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=Gewy6YMbb7VyjVqW9FmVFIQQGhzKemWA8dRCQ7GcFfjZdExTyEaJbRifP5lkoWZrYpZ7NCSR6yONchTfa2D4Wm+nnO/BdJEnJmfLUpS5oJ6/HA9dcZR9qG8jU/lkjPLDoX882yf/UndzBN++JC9S79+vsUDd7ejVFGRXs99gsKc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-41c7ac71996so26665815e9.3 for ; Thu, 02 May 2024 05:53:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714654403; x=1715259203; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=5NSVZftzeTL9V3fcUzcilUVRWp7YEOBI73s7qpH8plA=; b=CFVEBojUbOuomZvPLUpdDdHoLzf5gY4YMpfVY1s16kDbGOR+pzUOQ+EjoF9bRY1qdG 2mKdy5/y67gfEmLneZG/luZtKTzFPq9Y98s/9ZpOJtdWHPEoGEhb8OSihsngVUXFxeHK 0NYgCBC2NwSG1Ii9IfM9e7I+nIQ43wIr4KV95w5h95vGrVJBxWeWx5P3EFzEeyO7ZkGX 3zgD1LxYEUz3snu5jk4W1sJmK98ichuyS3RoxtbgIZRdtQ2jTGZBxXCu7rCY8+ol/zHT DM922Iql+0rTo1i1b38DTdDB9Nd0wqKZAouhz7bhXX6R+UftjvTsDYhkVLLz+1nyCpZg MEag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714654403; x=1715259203; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5NSVZftzeTL9V3fcUzcilUVRWp7YEOBI73s7qpH8plA=; b=TDhUglMcwYzYNyxOw50S+glBI7lnh4Y2c8bEzZVFcmpMTYFa6MzG9OS60zMnWVYCQ6 WdFM79Uztiui9RDCzrKHPgNQkEX2anpTECc22EJ6j++wKSUJxEmCYjaIjWwXdZBet08h 9c1D/c+4el7ty2NQJ6fZHY3LagU9l+w3aZRthtPKI5QMDy2EnXGIaATLvzs7kGlkfYeA z3OiGFUeNGbxyTf3rEl7Q3sVWhq1lDV9z8+KkF3W6aYzzMkZnNKgWt3NWjwp6jxnKS4I yJ8K4hwQbaImm4kQ6XCRrU23KgybpEJwuutMvHfZnrrusPGfjN82InKrHPzr2wzg1yc6 ZhgA== X-Gm-Message-State: AOJu0YyDcOcXrb4V/XZeaecdkeSOJ449kqn+Qfl9k16OlOM2L+gCa2ZM 68SXR3jKdUbSLWMu+GYd21DjiX9hFS0cK9yIBHoNZrnlh+5otfzBo2bieQ== X-Google-Smtp-Source: AGHT+IGwtWqmGLkgmJCFg1t6RbR0VW7IjB6wt4e2Gn7UBztoe+h34Tsj2v/nkIYz9Be/7dS+dU5WiA== X-Received: by 2002:a05:600c:1e26:b0:41b:6753:30be with SMTP id ay38-20020a05600c1e2600b0041b675330bemr4054582wmb.38.1714654403056; Thu, 02 May 2024 05:53:23 -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 g1-20020a5d6981000000b0034d8b0b5329sm1199319wru.87.2024.05.02.05.53.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 May 2024 05:53:22 -0700 (PDT) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org, jakub@redhat.com Subject: [pushed] Objective-C, NeXT, v2: Correct a regression in code-gen. Date: Thu, 2 May 2024 13:53:21 +0100 Message-Id: <20240502125321.92955-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.39.2 (Apple Git-143) MIME-Version: 1.0 X-Spam-Status: No, score=-8.5 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 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: iain@sandoe.co.uk Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org My testing of the GCC-14 release branch revealed an Objective-C regression in code-gen, the fix has been tested on x86_64, i686 and powerpc darwin, pushed to trunk. I will shortly apply this to the open branches, since they are affected too. Given that this is completely local to Darwin and Objective-C (and pretty trivial too) - would it be acceptable for GCC-14.1? thanks Iain --- 8< --- There have been several changes in the ABI of Objective-C which depend on the OS version targetted. In this case Protocols and LabelProtocols should be made weak/hidden/extern from macOS 10.7 however there was a mistake in the code causing this to occur from macOS 10.6. Fixed thus. gcc/objc/ChangeLog: * objc-next-runtime-abi-02.cc (WEAK_PROTOCOLS_AFTER): New. (next_runtime_abi_02_protocol_decl): Use WEAK_PROTOCOLS_AFTER to determine this ABI change. (build_v2_protocol_list_address_table): Likewise. Signed-off-by: Iain Sandoe --- gcc/objc/objc-next-runtime-abi-02.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/objc/objc-next-runtime-abi-02.cc b/gcc/objc/objc-next-runtime-abi-02.cc index cdf559b9bea..248ef641281 100644 --- a/gcc/objc/objc-next-runtime-abi-02.cc +++ b/gcc/objc/objc-next-runtime-abi-02.cc @@ -72,6 +72,7 @@ along with GCC; see the file COPYING3. If not see #define TAG_MSGSENDSUPER_STRET "objc_msgSendSuper2_stret" #define USE_FIXUP_BEFORE 100600 +#define WEAK_PROTOCOLS_AFTER 100700 #define TAG_FIXUP "_fixup" @@ -1025,7 +1026,7 @@ next_runtime_abi_02_protocol_decl (tree p) /* static struct _objc_protocol _OBJC_Protocol_; */ snprintf (buf, BUFSIZE, "_OBJC_Protocol_%s", IDENTIFIER_POINTER (PROTOCOL_NAME (p))); - if (flag_next_runtime >= USE_FIXUP_BEFORE) + if (flag_next_runtime >= WEAK_PROTOCOLS_AFTER) { decl = create_hidden_decl (objc_v2_protocol_template, buf); DECL_WEAK (decl) = true; @@ -2315,7 +2316,7 @@ build_v2_protocol_list_address_table (void) gcc_assert (ref->id && TREE_CODE (ref->id) == PROTOCOL_INTERFACE_TYPE); snprintf (buf, BUFSIZE, "_OBJC_LabelProtocol_%s", IDENTIFIER_POINTER (PROTOCOL_NAME (ref->id))); - if (flag_next_runtime >= USE_FIXUP_BEFORE) + if (flag_next_runtime >= WEAK_PROTOCOLS_AFTER) { decl = create_hidden_decl (objc_protocol_type, buf, /*is def=*/true); DECL_WEAK (decl) = true;