Skip to content

Commit

Permalink
wolfssl: enable dispatch on 10.6 ppc
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 committed Dec 30, 2024
1 parent d98cc8a commit f7fca4c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
4 changes: 4 additions & 0 deletions devel/wolfssl/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ legacysupport.newest_darwin_requires_legacy 15

name wolfssl
version 5.7.4
revision 1
categories devel security
maintainers {wolfssl.com:facts @JacobBarthelmeh} openmaintainer
homepage https://wolfssl.com/wolfSSL/Products-wolfssl.html
Expand Down Expand Up @@ -35,6 +36,9 @@ configure.args --enable-all \
--disable-jobserver \
--disable-silent-rules

# Drop this if building on 10a190:
patchfiles-append 0010-macOS-enable-dispatch-on-10.6-powerpc.patch

# Enabling this option does not work at least on 10.6:
# src/internal.c:41288: error: 'errSecSuccess' undeclared (first use in this function)
# Arguably we do not need archaic system certificates anyway.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From d9535aaabb5a55f22ab946448be1a879ed0bca97 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <[email protected]>
Date: Tue, 31 Dec 2024 03:37:59 +0800
Subject: [PATCH] macOS: enable dispatch on 10.6 powerpc

This assumes 10.6.8 on powerpc. API of 10a190 differs and will not work.
---
wolfcrypt/src/wc_port.c | 3 +--
wolfssl/wolfcrypt/types.h | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c
index 2ee85e3f3..82dfd0471 100644
--- a/wolfcrypt/src/wc_port.c
+++ b/wolfcrypt/src/wc_port.c
@@ -4074,8 +4074,7 @@ char* mystrnstr(const char* s1, const char* s2, unsigned int n)
}

#ifdef WOLFSSL_COND
- #if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 \
- && !defined(__ppc__)
+ #if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
/* Apple style dispatch semaphore */
int wolfSSL_CondInit(COND_TYPE* cond)
{
diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h
index f8042cf82..ff769d471 100644
--- a/wolfssl/wolfcrypt/types.h
+++ b/wolfssl/wolfcrypt/types.h
@@ -1513,8 +1513,7 @@ typedef struct w64wrapper {
typedef size_t THREAD_TYPE;
#define WOLFSSL_THREAD
#elif defined(WOLFSSL_PTHREADS)
- #if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 \
- && !defined(__ppc__)
+ #if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
#include <dispatch/dispatch.h>
typedef struct COND_TYPE {
wolfSSL_Mutex mutex;

0 comments on commit f7fca4c

Please sign in to comment.