Skip to content

Commit

Permalink
distutils: pass -rpath on macOS when requested
Browse files Browse the repository at this point in the history
Fix -R option of build_ext for macOS (darwin)

Resolves this old bug against distutils that expired due to PIP 632:
https://bugs.python.org/issue36353

Applies patch originally submitted to CPython:
python/cpython#12418
  • Loading branch information
tovrstra authored and acolinisi committed Apr 4, 2021
1 parent 35e1c9d commit 694904e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions distutils/unixccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ def runtime_library_dir_option(self, dir):
# we use this hack.
compiler = os.path.basename(sysconfig.get_config_var("CC"))
if sys.platform[:6] == "darwin":
# MacOSX's linker doesn't understand the -R flag at all
return "-L" + dir
return "-Wl,-rpath," + dir
elif sys.platform[:7] == "freebsd":
return "-Wl,-rpath=" + dir
elif sys.platform[:5] == "hp-ux":
Expand Down

0 comments on commit 694904e

Please sign in to comment.