From patchwork Thu Jan 18 14:27:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 84347 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 53A3B385E448 for ; Thu, 18 Jan 2024 14:27:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 61FB53858416 for ; Thu, 18 Jan 2024 14:27:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 61FB53858416 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 61FB53858416 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705588029; cv=none; b=KudNo7SASjsvNv072IrPZdKtiKHznm9KcDBsJ6JzoCeJo/pB0w+3MxF8D5XKLVK5/Mx0N1Z2a2XiXJUoKDMzXgYsnXNjleY77OcatYMR/HWIt/sklxaSRPZUEoZjsd2u5EBV1r4NnU98NCQ6mBMLJSORL7IfQxiW2TSzmI6ASjY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705588029; c=relaxed/simple; bh=rzPszNubMDcRX/TkK56zWd34oZctRxs3f9Ox5cnALIk=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=EmTXcyIobfClN6yFze7dQbRqph5r0ULIMPU/3I/btU4kJ6GKULWWMfQx9kbyklV9sKT8G6mJqGIHFYmbg49n/G7n6zY9ax2B2iAVDcs8P51s0+WCpDoOtO7xB85IxmnfKEuUcKK0p5xwEsBjXby0ODuVPfEl7QWRxWZ4Mlwq3JE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40e8ff22383so7812465e9.0 for ; Thu, 18 Jan 2024 06:27:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705588024; x=1706192824; 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=uPJH4HqemVhppfCNB6P3ws2v6AbtEgRcLfCwCn55BWQ=; b=VSEpVCIN/oLc5/ue2B2opnwFJF44PgroXlezDhcfmmA9DxW9h9zSg7BratJmxAODCZ 5fIN13vPDVjmeEqcy2RR8Ry2EfsuQHfNe/jItqtd5R2JELo0zBPnL8zo43A6rGLve2kL dQ6P8hZQ3Ag79vFe8tvN4MIynGBETljB1pABMp1gX4F6d9se9iDcr3y0j95X7LH6+Hhm AxQdXPhg2dLti2kwRruRFAGPegAiQvCQagh+A9It0OULF79QoD60gJ7n8PGz6ERArCRn 8DZKoeAD2sAa3GAHSo/LWwn9tgizorb7alNpRVk70+EvJgHXh8VCh8ShGvNKL71Ev0VB 7eHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705588024; x=1706192824; 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=uPJH4HqemVhppfCNB6P3ws2v6AbtEgRcLfCwCn55BWQ=; b=CEzy6O1vW+22t5HE7/rjhvWqLznAfUF9iJUc9/natDwNRfWpBjOtU/7+Anw1cWtqf3 MpMGB/6IQB415ppLTE/esGj8Gn7aiiA2+pjvhkxOxoW2YeIqi1Qb9NS58bmhYUGUb4i+ 0DHmm9crC6s+VcyCGA3LldptXIeHht0xQYRjfv1FTOBF83hK+kJ9IpY27QvCHqH9F788 ndwidv56/tj5i9OpklRd1U0siUcpDDKB9I+eqtoSdJF2gHa75jMtmtWqBCd1I8t/NNgS 5IJ+9BdBSVMBJV9ZqcRoIWNZ557KcyH785a0ccBgwafAcC17eG3xB80VrmPSpygJQcE1 S8aw== X-Gm-Message-State: AOJu0Ywbc66vpHBxEGNRclUuQHJdIYTeUn1xoDSr1lZzq3Ss6yu2qVLd P38bGpayEtW5fxBrk0hKdban+rUe87fEjawITB0XXBG18dNocpWCJvR/Tl5A X-Google-Smtp-Source: AGHT+IFYRT6XNPpAYBGBvkfRo2A336Dv3NXZc3/QgcwUrBh3sP3auFZmi+Oe7vgTt98l6X0FGsdQZQ== X-Received: by 2002:a05:600c:1f8d:b0:40e:8df4:ef96 with SMTP id je13-20020a05600c1f8d00b0040e8df4ef96mr535083wmb.153.1705588023840; Thu, 18 Jan 2024 06:27:03 -0800 (PST) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id g6-20020a05600c4ec600b0040e6b0a1bc1sm19197325wmq.12.2024.01.18.06.27.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Jan 2024 06:27:03 -0800 (PST) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [pushed] Darwin: Suppress adding embedded rpaths for earlier OS versions. Date: Thu, 18 Jan 2024 14:27:02 +0000 Message-Id: <20240118142702.24668-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, 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.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+patchwork=sourceware.org@gcc.gnu.org The current setup leads to spurious test fails, where we are building for macOS 10.4 or earlier. Tested on x86_64, i868, powerpc Darwin, x86_64 Linux, pushed to trunk, thanks Iain --- 8< --- When we have @rpath support by virtue of the OS version we're hosting on we still need to omit those rpath entries when targeting < 10.5 (or the linker will complain). To do this we (maybe ab-)use a property of the spec function expansion that a non-null return value can be used as the true input to a second spec (whereas, unfortunately, we cannot pass specs to the version function at present). gcc/ChangeLog: * config/darwin.h (DARWIN_RPATH_SPEC): Arrange for the %P spec to be conditional on macosx-version-min. Signed-off-by: Iain Sandoe --- gcc/config/darwin.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index e94a29c639c..cb96d67b3b1 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -612,8 +612,7 @@ extern GTY(()) int darwin_ms_struct; director as one being loaded. */ #define DARWIN_RPATH_SPEC \ "%:version-compare(>= 10.5 mmacosx-version-min= -rpath) \ - %:version-compare(>= 10.5 mmacosx-version-min= @loader_path) \ - %P " + %{%:version-compare(>= 10.5 mmacosx-version-min= @loader_path): %P }" #else #define DARWIN_RPATH_SPEC "" #endif