$ python Python 3.11.4 (main, Jul 2 2023, 13:22:45) [GCC 13.1.1 20230527] on linux Type "help", "copyright", "credits" or "license" for more information. (ins)>>> import pydantic_core Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.11/site-packages/pydantic_core/__init__.py", line 6, in <module> from ._pydantic_core import ( ImportError: /usr/lib/python3.11/site-packages/pydantic_core/_pydantic_core.cpython-311-x86_64-linux-gnu.so: undefined symbol: mi_malloc I noticed this when trying something that needs Pydantic. I downgraded to pydantic-core 0.39.0 which does not have this issue, but ultimately the issue is caused by LTO like a lot of Rust packages.
It's because Rust.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc51935f7aae5f89d1ffecabef322680979952b8 commit dc51935f7aae5f89d1ffecabef322680979952b8 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2023-02-09 00:49:47 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-07-12 06:24:42 +0000 cargo.eclass: filter out lto flags for C/CXX compilers we do it in src_compile to avoid excessive flag stripping in projects using cargo.eclass just to fetch crates. Bug: https://bugs.gentoo.org/903908 Closes: https://bugs.gentoo.org/893658 Closes: https://bugs.gentoo.org/910220 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org> eclass/cargo.eclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
We still need to adjust distutils-r1.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2da31f41428439e273db7f1a8c8c3ff883641ed commit d2da31f41428439e273db7f1a8c8c3ff883641ed Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2023-07-12 12:19:36 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2023-07-17 09:44:19 +0000 distutils-r1.eclass: Disable LTO when using cargo.eclass Strip LTO flags when cargo.eclass is inherited. This means that Rust extensions are being built, and linking them with C/C++ style LTO results in broken shared libraries. Closes: https://bugs.gentoo.org/910220 Signed-off-by: Michał Górny <mgorny@gentoo.org> eclass/distutils-r1.eclass | 7 +++++++ 1 file changed, 7 insertions(+)