Skip to content

Commit beed95f

Browse files
Roumen Petrovmingwandroid
authored andcommitted
unixcompiler: mingw&cygwin ld do not have --enable-new-dtags
I (Ray Donnelly) synthesised this commit as I can't find it in Roumen's split series.
1 parent 65020ed commit beed95f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Lib/distutils/unixccompiler.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,13 @@ def runtime_library_dir_option(self, dir):
238238
# -Wl whenever gcc was used in the past it is probably
239239
# safest to keep doing so.
240240
if sysconfig.get_config_var("GNULD") == "yes":
241-
# GNU ld needs an extra option to get a RUNPATH
241+
# GNU ELF ld needs an extra option to get a RUNPATH
242242
# instead of just an RPATH.
243-
return "-Wl,--enable-new-dtags,-R" + dir
243+
if sys.platform in ["win32", "cygwin"] or \
244+
"mingw" in compiler:
245+
return []
246+
else:
247+
return "-Wl,--enable-new-dtags,-R" + dir
244248
else:
245249
return "-Wl,-R" + dir
246250
else:

0 commit comments

Comments
 (0)