tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] Fixing the subtle python PLIST breakage on installing with an older version present



Am Sun, 7 Apr 2019 09:15:45 +0200
schrieb "Dr. Thomas Orgis" <thomas.orgis%uni-hamburg.de@localhost>:

> I am against pkgsrc just setting this linker flag.
> I need to look into what these occurences do:
> ./Lib/distutils/tests/test_unixccompiler.py:        self.assertEqual(self.cc.rpath_foo(), '-Wl,--enable-new-dtags,-R/foo')

Well, funny how much we forget, but we got computers for that. Let's
have a look at lang/python37/patches/patch-Lib_distutils_unixccompiler.py:


$NetBSD: patch-Lib_distutils_unixccompiler.py,v 1.1 2018/07/03 03:55:40 adam Exp $

Do not force RUNPATH vs RPATH, trust the compiler to know what the
platform wants.

--- Lib/distutils/unixccompiler.py.orig 2018-03-29 11:57:55.000000000 +0000
+++ Lib/distutils/unixccompiler.py
@@ -234,22 +234,7 @@ class UnixCCompiler(CCompiler):
                 return ["-Wl,+s", "-L" + dir]
             return ["+s", "-L" + dir]
         else:
-            if self._is_gcc(compiler):
-                # gcc on non-GNU systems does not need -Wl, but can
-                # use it anyway.  Since distutils has always passed in
-                # -Wl whenever gcc was used in the past it is probably
-                # safest to keep doing so.
-                if sysconfig.get_config_var("GNULD") == "yes":
-                    # GNU ld needs an extra option to get a RUNPATH
-                    # instead of just an RPATH.
-                    return "-Wl,--enable-new-dtags,-R" + dir
-                else:
-                    return "-Wl,-R" + dir
-            else:
-                # No idea how --enable-new-dtags would be passed on to
-                # ld if this system was using GNU ld.  Don't know if a
-                # system like this even exists.
-                return "-R" + dir
+            return "-Wl,-R" + dir
 
     def library_option(self, lib):
         return "-l" + lib


So current pkgsrc policy is to actively revert the decision by Python
developers to interfere with the system linker setup. The failure to
use the correct libpython3 is no bug in the upstream package, but it
was introduced by this patch. I do agree with this patch, though. But
since it breaks things, fixing the build with LD_PRELOAD is just
completing what this patch began. The decision is to either drop this
patch or to include my RUNSHARED fix, too.

I do not have high hopes arguing with Python folks about RPATH vs.
RUNPATH and the idea of not messing with this at all. But maybe one
should try.


Alrighty then,

Thomas

-- 
Dr. Thomas Orgis
HPC @ Universität Hamburg


Home | Main Index | Thread Index | Old Index