Description
The msgspec._core extension module fails to load on some systems due to missing linkage against the math library (libm). This causes undefined symbol errors for mathematical functions like nextafter, fmod, and lround.
bash[./lib/python3.12/site-packages/msgspec/_core.cpython-312-aarch64-linux-gnu.so]:
linux-vdso.so.1 (0x0000ffffbab2c000)
libc.so.6 => /lib64/libc.so.6 (0x0000ffffba883000)
/lib/ld-linux-aarch64.so.1 (0x0000ffffbaadf000)
undefined symbol: nextafter (./lib/python3.12/site-packages/msgspec/_core.cpython-312-aarch64-linux-gnu.so)
undefined symbol: fmod (./lib/python3.12/site-packages/msgspec/_core.cpython-312-aarch64-linux-gnu.so)
undefined symbol: lround (./lib/python3.12/site-packages/msgspec/_core.cpython-312-aarch64-linux-gnu.so)
Workaround is to use a sed patch to explicitly link the math library:
sed -i 's/\(os\.path\.join([^)]*"_core\.c")\)\],/\1], libraries=["m"],/' "./setup.py""
Environment
Platform: aarch64-linux-gnu
Python version: 3.12
Architecture: ARM64
Description
The msgspec._core extension module fails to load on some systems due to missing linkage against the math library (libm). This causes undefined symbol errors for mathematical functions like nextafter, fmod, and lround.
bash[./lib/python3.12/site-packages/msgspec/_core.cpython-312-aarch64-linux-gnu.so]: linux-vdso.so.1 (0x0000ffffbab2c000) libc.so.6 => /lib64/libc.so.6 (0x0000ffffba883000) /lib/ld-linux-aarch64.so.1 (0x0000ffffbaadf000) undefined symbol: nextafter (./lib/python3.12/site-packages/msgspec/_core.cpython-312-aarch64-linux-gnu.so) undefined symbol: fmod (./lib/python3.12/site-packages/msgspec/_core.cpython-312-aarch64-linux-gnu.so) undefined symbol: lround (./lib/python3.12/site-packages/msgspec/_core.cpython-312-aarch64-linux-gnu.so)Workaround is to use a sed patch to explicitly link the math library:
Environment
Platform: aarch64-linux-gnu
Python version: 3.12
Architecture: ARM64