Skip to content

Commit

Permalink
revert a patch that causes _availability_version_check to not be found
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Sep 2, 2024
1 parent 9d14a80 commit 787bfcd
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
3 changes: 2 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ source:
sha256: 09c08693a9afd6236f27a2ebae62cda656eba19021ef3f94d59e931d662d4856
patches:
- patches/0001-no-code-sign.patch
- patches/0002-Revert-Declare-_availability_version_check-as-weak_i.patch

build:
number: 0
number: 1

requirements:
build:
Expand Down
4 changes: 2 additions & 2 deletions recipe/patches/0001-no-code-sign.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From bf3c5b20918704c6f07f5aecef840376fd3b0806 Mon Sep 17 00:00:00 2001
From dd35ef6087b81d9d7fc658f1c35557eec1cb733f Mon Sep 17 00:00:00 2001
From: Isuru Fernando <isuruf@gmail.com>
Date: Mon, 22 Apr 2019 02:00:30 -0500
Subject: [PATCH] no code sign
Subject: [PATCH 1/2] no code sign

---
compiler-rt/cmake/Modules/AddCompilerRT.cmake | 28 -------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From d37bc1428cd192a6fa3a967a509805b95a761910 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Mon, 2 Sep 2024 14:30:13 +1100
Subject: [PATCH 2/2] Revert "Declare _availability_version_check as
weak_import instead of looking it"

This reverts commit b653a2823fe4b4c9c6d85cfe119f31d8e70c2fa0.
---
compiler-rt/lib/builtins/os_version_check.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/compiler-rt/lib/builtins/os_version_check.c b/compiler-rt/lib/builtins/os_version_check.c
index 182eabe7a6ae..ebfb2dfc72dd 100644
--- a/compiler-rt/lib/builtins/os_version_check.c
+++ b/compiler-rt/lib/builtins/os_version_check.c
@@ -86,10 +86,6 @@ typedef Boolean (*CFStringGetCStringFuncTy)(CFStringRef, char *, CFIndex,
CFStringEncoding);
typedef void (*CFReleaseFuncTy)(CFTypeRef);

-extern __attribute__((weak_import))
-bool _availability_version_check(uint32_t count,
- dyld_build_version_t versions[]);
-
static void _initializeAvailabilityCheck(bool LoadPlist) {
if (AvailabilityVersionCheck && !LoadPlist) {
// New API is supported and we're not being asked to load the plist,
@@ -98,8 +94,8 @@ static void _initializeAvailabilityCheck(bool LoadPlist) {
}

// Use the new API if it's is available.
- if (_availability_version_check)
- AvailabilityVersionCheck = &_availability_version_check;
+ AvailabilityVersionCheck = (AvailabilityVersionCheckFuncTy)dlsym(
+ RTLD_DEFAULT, "_availability_version_check");

if (AvailabilityVersionCheck && !LoadPlist) {
// New API is supported and we're not being asked to load the plist,

0 comments on commit 787bfcd

Please sign in to comment.