summaryrefslogtreecommitdiff
path: root/debian/patches/distutils-link.diff
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/distutils-link.diff')
-rw-r--r--debian/patches/distutils-link.diff24
1 files changed, 24 insertions, 0 deletions
diff --git a/debian/patches/distutils-link.diff b/debian/patches/distutils-link.diff
new file mode 100644
index 0000000..b8ad3cf
--- /dev/null
+++ b/debian/patches/distutils-link.diff
@@ -0,0 +1,24 @@
+# DP: Don't add standard library dirs to library_dirs and runtime_library_dirs.
+
+Index: b/Lib/distutils/unixccompiler.py
+===================================================================
+--- a/Lib/distutils/unixccompiler.py
++++ b/Lib/distutils/unixccompiler.py
+@@ -155,6 +155,17 @@ class UnixCCompiler(CCompiler):
+ runtime_library_dirs)
+ libraries, library_dirs, runtime_library_dirs = fixed_args
+
++ # filter out standard library paths, which are not explicitely needed
++ # for linking
++ system_libdirs = ['/lib', '/lib64', '/usr/lib', '/usr/lib64']
++ multiarch = sysconfig.get_config_var("MULTIARCH")
++ if multiarch:
++ system_libdirs.extend(['/lib/%s' % multiarch, '/usr/lib/%s' % multiarch])
++ library_dirs = [dir for dir in library_dirs
++ if not dir in system_libdirs]
++ runtime_library_dirs = [dir for dir in runtime_library_dirs
++ if not dir in system_libdirs]
++
+ lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs,
+ libraries)
+ if not isinstance(output_dir, (str, type(None))):