From patchwork Wed Aug 7 19:30:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1970202 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=NDcBxSUG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4WfKzX70zqz1yfC for ; Thu, 8 Aug 2024 05:31:20 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CEB3C3858289 for ; Wed, 7 Aug 2024 19:31:18 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id 73BC93858C41 for ; Wed, 7 Aug 2024 19:30:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 73BC93858C41 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 73BC93858C41 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723059060; cv=none; b=Cct/xm/3U7j0StbWtbrfwffzWsIwg1azbJ6/nD0LmWYXaHRpA0bp3B7xS+TG+yWyWjfw8cYO0YTG24lAugfjY0jP9KAHW0RUuO1fOKpbchDl2/pLP9fYqr8UA618kkV0On36mOcCf6efkwrgH6ACPw+KFAuFr1Q/DNGBDkkw+6k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723059060; c=relaxed/simple; bh=NcV+kDEvpq9nAPvcHmklOTGXIx6OpCA9xvs2Mq3EN2U=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=NTVCY6Bokj8GKeRR4EqGaTEkt+8uLJamOFb3jMapeJAlSj3kf075JeRfvRMmZDIS1Ai51T7cnx6U7QsyduD580Nqk1/OM596jfiIf5jwrLXGz89NBZY/jC2XSfjdwrGVHkR/3PYot4aRqZ2QDq/P1YRbNbGly6U4bCEhBO+ydfU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4280bca3960so1579535e9.3 for ; Wed, 07 Aug 2024 12:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723059056; x=1723663856; 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=7mWLarCc41rOr/jpMDEGIthk4scFi2BpYk8CXonTkdc=; b=NDcBxSUGdgHVXRv9AT4Ycb5BPqUJS8WNj7cEeFZzLjyX0Z1yjWdzxcJ6TWEoqJfPeT wMELu1qNArv32ZNBFZYmXC9FmuAX/D2Gq0ea7d7XtW8UGBtY3GjBb5iE+YHBsnL0yUKI uPFgzbSzf1hn8m/90r5zZluX7xBzBmXxOUkcEllP6Hh1ZGy1lJsNXiBEQ4mG7DQ+Uuyw 783Ex2fUH8hKzO4Sw4Pki8q5SQHIGi6vt/kJ1Pv5cI0kf3AMh7bLwLxYAEnqItHts+EV WYQlokaC7APFOrbOiO0322ChiAGV8clDQEoz5A5oPLJp39p25Uxo3F/e0QgtabaDQdEO 09MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723059056; x=1723663856; 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=7mWLarCc41rOr/jpMDEGIthk4scFi2BpYk8CXonTkdc=; b=nVvM7EQ0naDa+lPoXOXsUQL9O75T6oW+qgABiz2qzcm9V+Vgu1i7MnGWRYzpazx/f6 LQdbBNH1jwqZEW8ChIjkqF2Yq1DiWLMzaclsveAFbB3qtjnVC2Hu2+UtW7TKTkGVX9bj KgpL/W1KlT+4caC3oCXxxEhHitAgZwpMaON5T7Oldl0Ot01q7KIcafgixQcBLdGr8lMc o9lhrl/60VSPapYzF/z2uoOFz9E42lV6G2L4miSlL3CW1Gph7Qd7pLETaRQH6tV655Wz tp4pV31W77whCVjIZ/VHhRQqA7ng5sGJxMM6nsqns8NAhhTz66+T7BQdwf1WziQPYn8i yYXQ== X-Gm-Message-State: AOJu0YytwY5BSOCiiLA2WzKU0R3gvFxHY5xsgpSoyRpNi/Jkw7hKm0ob /Qn7qo9EDoOiZw8P9CYCOxqrN5imcm6KKWAYrcy+Sot54NjUtRLaxzu1G61j X-Google-Smtp-Source: AGHT+IFqZ97FHYTkkHFWw50RpoD5zbqpTgXA3JZKuuFH8PlKtrhbT2iVZIVukLfUi7sTv9KgUtrAzg== X-Received: by 2002:a05:600c:4585:b0:428:23c8:1e54 with SMTP id 5b1f17b1804b1-428e6b009a9mr147671335e9.18.1723059056065; Wed, 07 Aug 2024 12:30:56 -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 ffacd0b85a97d-36bbd0598a7sm16815714f8f.67.2024.08.07.12.30.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Aug 2024 12:30:55 -0700 (PDT) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [pushed] Darwin: Recognise -weak_framework in the driver [PR116237]. Date: Wed, 7 Aug 2024 20:30:54 +0100 Message-Id: <20240807193054.88905-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.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 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 Tested on x86_64-darwin21, pushed to trunk, thanks Iain --- 8< --- XCode compilers recognise the weak_framework linker option in the driver and forward it. This patch makes GCC adopt the same behaviour. PR target/116237 gcc/ChangeLog: * config/darwin.h (SUBTARGET_DRIVER_SELF_SPECS): Add a spec for weak_framework. * config/darwin.opt: Handle weak_framework driver option. Signed-off-by: Iain Sandoe --- gcc/config/darwin.h | 2 ++ gcc/config/darwin.opt | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index c09b9e9dc94..377599074a7 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -264,6 +264,8 @@ extern GTY(()) int darwin_ms_struct; "%{weak_reference_mismatches*:\ -Xlinker -weak_reference_mismatches -Xlinker %*} \ % Do not export the global symbols listed in . +weak_framework +Driver RejectNegative Separate +-weak_framework Make a weak link to the specified framework. + weak_reference_mismatches Driver RejectNegative Separate -weak_reference_mismatches Specifies what to do if a symbol import conflicts between file (weak in one and not in another) the default is to treat the symbol as non-weak.