Skip to content

Commit 547d4fe

Browse files
committed
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 <a.gatti@frob.it>
1 parent 381ac74 commit 547d4fe

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

unix-ffi/ffilib/ffilib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def open(name, maxver=10, extra=()):
1717
pass
1818

1919
def libs():
20-
if sys.platform == "linux":
20+
if sys.platform in ("linux", "freebsd"):
2121
yield "%s.so" % name
2222
for i in range(maxver, -1, -1):
2323
yield "%s.so.%u" % (name, i)
@@ -39,7 +39,7 @@ def libs():
3939

4040

4141
def libc():
42-
return open("libc", 6)
42+
return open("libc", 7)
4343

4444

4545
# Find out bitness of the platform, even if long ints are not supported

0 commit comments

Comments
 (0)