8000 bpo-45371: Fix distutils' rpath support for clang (GH-28732) · python/cpython@ef61960 · GitHub
[go: up one dir, main page]

Skip to content

Commit ef61960

Browse files
authored
bpo-45371: Fix distutils' rpath support for clang (GH-28732)
Signed-off-by: Christian Heimes <christian@python.org>
1 parent 07cf10b commit ef61960

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Lib/distutils/unixccompiler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ def library_dir_option(self, dir):
215215
return "-L" + dir
216216

217217
def _is_gcc(self, compiler_name):
218-
return "gcc" in compiler_name or "g++" in compiler_name
218+
# clang uses same syntax for rpath as gcc
219+
return any(name in compiler_name for name in ("gcc", "g++", "clang"))
219220

220221
def runtime_library_dir_option(self, dir):
221222
# XXX Hackish, at the very least. See Python bug #445902:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix clang rpath issue in :mod:`distutils`. The UnixCCompiler now uses
2+
correct clang option to add a runtime library directory (rpath) to a shared
3+
library.

0 commit comments

Comments
 (0)
0