Skip to content

Commit b77c847

Browse files
committed
[#95]Fix build for macOS
1 parent 19bd94f commit b77c847

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

build_tasks.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from tempfile import TemporaryFile
77
from platform import architecture, machine
88
from sys import platform
9-
from typing import Optional, Any
9+
from typing import Optional, Any, List
1010
from urllib.request import urlopen
1111

1212
# Monkeypatch for Python 3.11
@@ -45,6 +45,15 @@ class SupportedPlatformEnum(Enum):
4545
LINUX_ARM64 = 8
4646
LINUX_ARM32 = 9
4747

48+
@classmethod
49+
def all_linux_platforms(cls) -> List["SupportedPlatformEnum"]:
50+
return [
51+
cls.LINUX_32,
52+
cls.LINUX_64,
53+
cls.LINUX_ARM32,
54+
cls.LINUX_ARM64,
55+
]
56+
4857

4958
CURRENT_PLATFORM = None
5059
if architecture()[0] == "64bit":

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@
8484
else:
8585
BASE_NASSL_EXT_SETUP["extra_compile_args"].append("-Wall")
8686

87-
# Hide internal OpenSSL symbols to avoid "symbol confusion" when Python loads the system's OpenSSL libraries
88-
# https://github.com/nabla-c0d3/nassl/issues/95
89-
BASE_NASSL_EXT_SETUP["extra_link_args"].append("-Wl,--exclude-libs=ALL")
87+
if CURRENT_PLATFORM in SupportedPlatformEnum.all_linux_platforms():
88+
# Hide internal OpenSSL symbols to avoid "symbol confusion" when Python loads the system's OpenSSL libraries
89+
# https://github.com/nabla-c0d3/nassl/issues/95
90+
BASE_NASSL_EXT_SETUP["extra_link_args"].append("-Wl,--exclude-libs=ALL")
9091

9192
if CURRENT_PLATFORM == SupportedPlatformEnum.LINUX_64:
9293
# Explicitly disable executable stack on Linux 64 to address issues with Ubuntu on Windows

0 commit comments

Comments
 (0)