On 2024/03/03 07:59, Theo de Raadt wrote:
> Does it work if this is modified to just ask for "libc.so"?

Yes. Conservative approach just doing this for libc:

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/python/3.10/Makefile,v
retrieving revision 1.37
diff -u -p -r1.37 Makefile
--- Makefile    14 Nov 2023 12:33:56 -0000      1.37
+++ Makefile    3 Mar 2024 15:20:11 -0000
@@ -4,7 +4,7 @@
 # Python itself.
 
 FULL_VERSION =         3.10.13
-REVISION =             0
+REVISION =             1
 SHARED_LIBS =          python3.10 0.0
 VERSION_SPEC =         >=3.10,<3.11
 PORTROACH =            limit:^3\.10
Index: patches/patch-Lib_ctypes_util_py
===================================================================
RCS file: patches/patch-Lib_ctypes_util_py
diff -N patches/patch-Lib_ctypes_util_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Lib_ctypes_util_py    3 Mar 2024 15:20:11 -0000
@@ -0,0 +1,20 @@
+allow dlopen() to search for libc rather than parsing ldconfig -r to
+decide on a version number.
+
+(would this make sense for all libraries? I'm not sure exactly what
+parameters this might be called with, whether it's just a bare name or
+could have a path/version in it).
+
+Index: Lib/ctypes/util.py
+--- Lib/ctypes/util.py.orig
++++ Lib/ctypes/util.py
+@@ -204,6 +204,9 @@ elif os.name == "posix":
+             return nums or [sys.maxsize]
+ 
+         def find_library(name):
++            if sys.platform.startswith("openbsd") and name == "c":
++                return "libc.so"
++
+             ename = re.escape(name)
+             expr = r':-l%s\.\S+ => \S*/(lib%s\.\S+)' % (ename, ename)
+             expr = os.fsencode(expr)

Reply via email to