From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 787E315838C for ; Sun, 21 Jan 2024 09:46:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A27D1E29BE; Sun, 21 Jan 2024 09:46:43 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7DA22E29BE for ; Sun, 21 Jan 2024 09:46:43 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9099C34327E for ; Sun, 21 Jan 2024 09:46:42 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2C75197B for ; Sun, 21 Jan 2024 09:46:41 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1705830317.70384d5c6846998d8cb6bcc2ddfcf0830c13c6fa.grobian@gentoo> Subject: [gentoo-commits] repo/proj/prefix:master commit in: sys-devel/binutils-config/files/, sys-devel/binutils-config/ X-VCS-Repository: repo/proj/prefix X-VCS-Files: sys-devel/binutils-config/binutils-config-5.1-r8.ebuild sys-devel/binutils-config/binutils-config-5.1-r9.ebuild sys-devel/binutils-config/files/ldwrapper.c X-VCS-Directories: sys-devel/binutils-config/files/ sys-devel/binutils-config/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 70384d5c6846998d8cb6bcc2ddfcf0830c13c6fa X-VCS-Branch: master Date: Sun, 21 Jan 2024 09:46:41 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 17c95f3b-300b-4568-be37-458892fd02d2 X-Archives-Hash: f787109040b56c524998238780b955b5 commit: 70384d5c6846998d8cb6bcc2ddfcf0830c13c6fa Author: Fabian Groffen gentoo org> AuthorDate: Sun Jan 21 09:45:17 2024 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sun Jan 21 09:45:17 2024 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=70384d5c sys-devel/binutils-config: more macOS linker tweaks This time tested with native linkers on platforms which are seen during stage2 bootstraps: Darwin 23 with dyld-1022.1 Darwin 17 with ld64-409.12 Darwin 9 with ld64-85.2.1 Signed-off-by: Fabian Groffen gentoo.org> ...5.1-r8.ebuild => binutils-config-5.1-r9.ebuild} | 0 sys-devel/binutils-config/files/ldwrapper.c | 27 +++++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/sys-devel/binutils-config/binutils-config-5.1-r8.ebuild b/sys-devel/binutils-config/binutils-config-5.1-r9.ebuild similarity index 100% rename from sys-devel/binutils-config/binutils-config-5.1-r8.ebuild rename to sys-devel/binutils-config/binutils-config-5.1-r9.ebuild diff --git a/sys-devel/binutils-config/files/ldwrapper.c b/sys-devel/binutils-config/files/ldwrapper.c index c9fe7e4bb3..00d4a69f73 100644 --- a/sys-devel/binutils-config/files/ldwrapper.c +++ b/sys-devel/binutils-config/files/ldwrapper.c @@ -392,18 +392,28 @@ main(int argc, char *argv[]) /* call the linker to figure out what options we can use :( * some Developer Tools ld64 versions: - * 12.0: 609 Big Sur, requirement for sdk_version + * Xcode ld64 dyld + * 3.1.1: 85.2.1 Leopard 10.5, sdk_version unknown, + * need macosx_version_min + * 8.2.1: 274.2 xtools-2.2.4, sdk_version plus + * macosx_version_min + * 10.0: 409.12 High Sierra 10.13 like above + * 12.0: 609 Big Sur 11, sdk_version only * 13.0: 711 * 13.3.1: 762 * 14.0: 819.6 * 14.2: 820.1 * 14.3.1: 857.1 - * 15.0: 907 Sanoma, platform_version argument - * all to be found from the PROJECT:ld64-650.9 bit from 1st line + * 15.0: 907 1022.1 Sanoma 23, platform_version iso sdk_version + * all to be found from the PROJECT:ld64-650.9 or + * PROJECT:dyld-1022.1 bit from the first line * NOTE: e.g. my Sanoma mac with CommandLineTools has 650.9 * which is not a version from any Developer Tools ?!? * Currently we need to distinguish XCode 15 according to * bug #910277, so we look for 907 and old targets before 12 */ +#define LD64_3_1 8500 +#define LD64_8_2 27400 +#define LD64_10_0 40900 #define LD64_12_0 60900 #define LD64_15_0 90700 snprintf(target, sizeof(target), "%s -v 2>&1", ld); @@ -412,8 +422,11 @@ main(int argc, char *argv[]) char *proj; long comp; if (fgets(target, sizeof(target), ld64out) != 0 && - (proj = strstr(target, "PROJECT:ld64-")) != NULL) + ((proj = strstr(target, "PROJECT:ld64-")) != NULL || + (proj = strstr(target, "PROJECT:dyld-")) != NULL)) { + /* we don't distinguish between ld64 and dyld here, for + * now it seems the numbers line up for our logic */ proj += sizeof("PROJECT:ld64-") - 1; comp = strtol(proj, &proj, 10); /* we currently have no need to parse fractions, the @@ -446,10 +459,12 @@ main(int argc, char *argv[]) newargv[j++] = "macos"; newargv[j++] = darwin_dt; newargv[j++] = "0.0"; - } else if (ld64ver >= LD64_12_0) { + } else if (ld64ver >= LD64_8_2) { newargv[j++] = "-sdk_version"; newargv[j++] = darwin_dt; - } else { + } + + if (ld64ver < LD64_12_0) { newargv[j++] = "-macosx_version_min"; newargv[j++] = darwin_dt; }