| (GLIBC_([0-9.]+))
| (libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)
| (musl-([0-9.]+))
- | (libc.musl(?:-\w+)?.so(?:\.(\d[0-9.]*))?)
+ | ((?:libc\.|ld-)musl(?:-\w+)?.so(?:\.(\d[0-9.]*))?)
""",
re.ASCII | re.VERBOSE)
elif V(glibcversion) > V(ver):
ver = glibcversion
elif so:
- if lib != 'glibc':
+ if lib not in ('glibc', 'musl'):
lib = 'libc'
if soversion and (not ver or V(soversion) > V(ver)):
ver = soversion
(b'/aports/main/musl/src/musl-1.2.5.7', ('musl', '1.2.5.7')),
(b'libc.musl.so.1', ('musl', '1')),
(b'libc.musl-x86_64.so.1.2.5', ('musl', '1.2.5')),
+ (b'ld-musl.so.1', ('musl', '1')),
+ (b'ld-musl-x86_64.so.1.2.5', ('musl', '1.2.5')),
(b'', ('', '')),
):
with open(filename, 'wb') as fp:
b'libc.musl-x86_64.so.1.4.1\0libc.musl-x86_64.so.2.1.1\0libc.musl-x86_64.so.2.0.1',
('musl', '2.1.1'),
),
+ (
+ b'ld-musl-x86_64.so.1.4.1\0ld-musl-x86_64.so.2.1.1\0ld-musl-x86_64.so.2.0.1',
+ ('musl', '2.1.1'),
+ ),
(b'no match here, so defaults are used', ('test', '100.1.0')),
):
with open(filename, 'wb') as f:
self.assertTrue(linked)
# The value is cached, so make sure it returns the same value again.
self.assertIs(linked, support.linked_to_musl())
- # The unlike libc, the musl version is a triple.
+ # The musl version is either triple or just a major version number.
if linked:
self.assertIsInstance(linked, tuple)
- self.assertEqual(3, len(linked))
+ self.assertIn(len(linked), (1, 3))
for v in linked:
self.assertIsInstance(v, int)