Skip to content

Missing libm linkage causes undefined symbol errors #1297

@BwL1289

Description

@BwL1289

When building asyncpg the compiled extension modules fail to load at runtime with errors like:

undefined symbol: log10	(./lib/python3.12/site-packages/asyncpg/pgproto/pgproto.cpython-312-aarch64-linux-gnu.so)

This happens because the C extensions use math functions from libm but don't explicitly link against it.

[./lib/python3.12/site-packages/asyncpg/pgproto/pgproto.cpython-312-aarch64-linux-gnu.so]:
    linux-vdso.so.1 (0x0000ffff9e066000)
    libc.so.6 => /lib64/libc.so.6 (0x0000ffff9ddce000)
    /lib/ld-linux-aarch64.so.1 (0x0000ffff9e019000)
undefined symbol: log10	(./lib/python3.12/site-packages/asyncpg/pgproto/pgproto.cpython-312-aarch64-linux-gnu.so)

I'm building from an older commit, but this may be still an issue in newer versions.

Environment

  • OS: Amazon Linux 2023 (aarch64)
  • Python: 3.12.7
  • Compiler: Clang 20git
  • asyncpg commit: d0797f1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions