Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/distutils/tests/test_unixccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_runtime_libdir_option(self):

# darwin
sys.platform = 'darwin'
self.assertEqual(self.cc.rpath_foo(), '-L/foo')
self.assertEqual(self.cc.rpath_foo(), '-Wl,-rpath,/foo')

# hp-ux
sys.platform = 'hp-ux'
Expand Down
3 changes: 1 addition & 2 deletions Lib/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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix ``--rpath (-R)`` option of ``build_ext`` for clang on OSX. It now gets translated correctly to ``-Wl,-rpath,[argument of -R]`` instead of ``-L [argument of -R]``.