Skip to content

Commit

Permalink
Fix py39 in ArchLinux using lto (in a different way than mac) (#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelotduarte committed Jul 13, 2021
1 parent 445c80c commit 030dd11
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import setuptools.command.build_ext

WIN32 = sys.platform == "win32"
DARWIN = sys.platform == "darwin"

if sys.version_info < (3, 6, 0):
sys.exit("Python3 versions lower than 3.6.0 are not supported.")
Expand Down Expand Up @@ -76,7 +77,7 @@ def build_extension(self, ext):
library_dirs.append(get_config_var("LIBPL"))
abiflags = get_config_var("abiflags")
libraries.append(f"python{get_python_version()}{abiflags}")
if get_config_var("LINKFORSHARED") and sys.platform != "darwin":
if get_config_var("LINKFORSHARED") and not DARWIN:
extra_args.extend(get_config_var("LINKFORSHARED").split())
if get_config_var("LIBS"):
extra_args.extend(get_config_var("LIBS").split())
Expand All @@ -86,11 +87,10 @@ def build_extension(self, ext):
extra_args.extend(get_config_var("BASEMODLIBS").split())
if get_config_var("LOCALMODLIBS"):
extra_args.extend(get_config_var("LOCALMODLIBS").split())
# fix a bug using macOS on Github Actions
if "--with-lto" in get_config_var("CONFIG_ARGS"):
extra_args.append("-flto")
if DARWIN:
# macOS on Github Actions
extra_args.append("-Wl,-export_dynamic")
if sys.platform != "darwin":
else:
extra_args.append("-s")
extra_args.append("-Wl,-rpath,$ORIGIN/lib")
extra_args.append("-Wl,-rpath,$ORIGIN/../lib")
Expand Down

0 comments on commit 030dd11

Please sign in to comment.