From 547d4fea1b3709caa9045ef173b61e377190b15b Mon Sep 17 00:00:00 2001 From: Alessandro Gatti Date: Thu, 11 Jun 2026 18:12:02 +0200 Subject: [PATCH] unix-ffi/ffilib/ffilib.py: Extend libc versions range. This commit extends the range of libc library versions that are looked up when required by user code. FreeBSD 14.1-RELEASE and later versions require an update to the range since they bumped up their libc major version, from 6 to 7. This has the side-effect of guaranteeing at least one failed lookup on modern Linux systems, where the libc is still at version 6. With updated FreeBSD support in MicroPython core, now `sys.platform` properly returns `freebsd`. This required a minor change in the code deciding whether to look for `.so`, `.dylib`, or `.dll` files, since `linux` is no longer the default fallback for generic unix systems. Signed-off-by: Alessandro Gatti --- unix-ffi/ffilib/ffilib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix-ffi/ffilib/ffilib.py b/unix-ffi/ffilib/ffilib.py index e79448fea..3df244900 100644 --- a/unix-ffi/ffilib/ffilib.py +++ b/unix-ffi/ffilib/ffilib.py @@ -17,7 +17,7 @@ def open(name, maxver=10, extra=()): pass def libs(): - if sys.platform == "linux": + if sys.platform in ("linux", "freebsd"): yield "%s.so" % name for i in range(maxver, -1, -1): yield "%s.so.%u" % (name, i) @@ -39,7 +39,7 @@ def libs(): def libc(): - return open("libc", 6) + return open("libc", 7) # Find out bitness of the platform, even if long ints are not supported