Skip to content

6.4.0+ no longer includes libatomic #615

@vfazio

Description

@vfazio

When building a wheel in manylinux_2_34 on AARCH64, we link against libftdi1 which pulls in libusb1 -> libatomic:

(venv) [root@28f14ac4eebb work]# readelf -d /usr/lib64/libftdi1.so.2 | grep NEEDED
 0x0000000000000001 (NEEDED)             Shared library: [libusb-1.0.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [ld-linux-aarch64.so.1]

(venv) [root@28f14ac4eebb work]# readelf -d /usr/lib64/libusb-1.0.so.0 | grep NEEDED
 0x0000000000000001 (NEEDED)             Shared library: [libudev.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libatomic.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [ld-linux-aarch64.so.1]

lddtree shows this is being captured, so it's not a problem with it being unidentified.

(venv) [root@28f14ac4eebb work]# /opt/_internal/pipx/venvs/auditwheel/bin/auditwheel lddtree /usr/lib64/libftdi1.so.2
INFO:auditwheel.main_lddtree:{
    "interpreter": null,
    "libc": "<Libc.GLIBC: 'glibc'>",
    "path": "/usr/lib64/libftdi1.so.2",
    "realpath": "/usr/lib64/libftdi1.so.2",
    "platform": {
        "_elf_osabi": "ELFOSABI_SYSV",
        "_elf_class": 64,
        "_elf_little_endian": true,
        "_elf_machine": "EM_AARCH64",
        "_base_arch": "<Architecture.aarch64: 'aarch64'>",
        "_ext_arch": null,
        "_error_msg": null
    },
    "needed": [
        "libusb-1.0.so.0",
        "libc.so.6",
        "ld-linux-aarch64.so.1"
    ],
    "rpath": [],
    "runpath": [],
    "libraries": {
        "libusb-1.0.so.0": {
            "soname": "libusb-1.0.so.0",
            "path": "/lib64/libusb-1.0.so.0",
            "realpath": "/lib64/libusb-1.0.so.0.3.0",
            "platform": {
                "_elf_osabi": "ELFOSABI_SYSV",
                "_elf_class": 64,
                "_elf_little_endian": true,
                "_elf_machine": "EM_AARCH64",
                "_base_arch": "<Architecture.aarch64: 'aarch64'>",
                "_ext_arch": null,
                "_error_msg": null
            },
            "needed": [
                "libudev.so.1",
                "libatomic.so.1",
                "libc.so.6",
                "ld-linux-aarch64.so.1"
            ]
        },
        "libudev.so.1": {
            "soname": "libudev.so.1",
            "path": "/lib64/libudev.so.1",
            "realpath": "/lib64/libudev.so.1.7.5",
            "platform": {
                "_elf_osabi": "ELFOSABI_SYSV",
                "_elf_class": 64,
                "_elf_little_endian": true,
                "_elf_machine": "EM_AARCH64",
                "_base_arch": "<Architecture.aarch64: 'aarch64'>",
                "_ext_arch": null,
                "_error_msg": null
            },
            "needed": [
                "libgcc_s.so.1",
                "libc.so.6",
                "ld-linux-aarch64.so.1"
            ]
        },
        "libgcc_s.so.1": {
            "soname": "libgcc_s.so.1",
            "path": "/lib64/libgcc_s.so.1",
            "realpath": "/lib64/libgcc_s-11-20240719.so.1",
            "platform": {
                "_elf_osabi": "ELFOSABI_SYSV",
                "_elf_class": 64,
                "_elf_little_endian": true,
                "_elf_machine": "EM_AARCH64",
                "_base_arch": "<Architecture.aarch64: 'aarch64'>",
                "_ext_arch": null,
                "_error_msg": null
            },
            "needed": [
                "libc.so.6"
            ]
        },
        "libc.so.6": {
            "soname": "libc.so.6",
            "path": "/lib64/libc.so.6",
            "realpath": "/lib64/libc.so.6",
            "platform": {
                "_elf_osabi": "ELFOSABI_LINUX",
                "_elf_class": 64,
                "_elf_little_endian": true,
                "_elf_machine": "EM_AARCH64",
                "_base_arch": "<Architecture.aarch64: 'aarch64'>",
                "_ext_arch": null,
                "_error_msg": null
            },
            "needed": [
                "ld-linux-aarch64.so.1"
            ]
        },
        "ld-linux-aarch64.so.1": {
            "soname": "ld-linux-aarch64.so.1",
            "path": "/lib/ld-linux-aarch64.so.1",
            "realpath": "/lib/ld-linux-aarch64.so.1",
            "platform": {
                "_elf_osabi": "ELFOSABI_SYSV",
                "_elf_class": 64,
                "_elf_little_endian": true,
                "_elf_machine": "EM_AARCH64",
                "_base_arch": "<Architecture.aarch64: 'aarch64'>",
                "_ext_arch": null,
                "_error_msg": null
            },
            "needed": []
        },
        "libatomic.so.1": {
            "soname": "libatomic.so.1",
            "path": "/lib64/libatomic.so.1",
            "realpath": "/lib64/libatomic.so.1.2.0",
            "platform": {
                "_elf_osabi": "ELFOSABI_LINUX",
                "_elf_class": 64,
                "_elf_little_endian": true,
                "_elf_machine": "EM_AARCH64",
                "_base_arch": "<Architecture.aarch64: 'aarch64'>",
                "_ext_arch": null,
                "_error_msg": null
            },
            "needed": [
                "libc.so.6",
                "ld-linux-aarch64.so.1"
            ]
        }
    }
}

This worked in 6.3.0:

DEBUG:auditwheel.policy:Package requires CXXABI_1.3.9, incompatible with policy manylinux_2_17_aarch64 which requires {'CXXABI_1.3.3', 'CXXABI_1.3.1', 'CXXABI_1.3.7', 'CXXABI_1.3.6', 'CXXABI_1.3.4', 'CXXABI_1.3', 'CXXABI_1.3.2', 'CXXABI_TM_1', 'CXXABI_1.3.5'}
DEBUG:auditwheel.tools:zip2dir from /work/dist/xes_bscan-0.10-cp311-cp311-linux_aarch64.whl to /tmp/tmpptm_fau1 takes 0:00:00.071047
DEBUG:auditwheel.repair:Grafting: /lib64/libatomic.so.1.2.0 -> xes_bscan.libs/libatomic-739a533b.so.1.2.0
DEBUG:auditwheel.repair:Grafting: /lib64/libudev.so.1.7.5 -> xes_bscan.libs/libudev-70714659.so.1.7.5
DEBUG:auditwheel.repair:Grafting: /lib64/libusb-1.0.so.0.3.0 -> xes_bscan.libs/libusb-1-c364fbd7.0.so.0.3.0
DEBUG:auditwheel.repair:Grafting: /lib64/libftdi1.so.2.5.0 -> xes_bscan.libs/libftdi1-b0562257.so.2.5.0
DEBUG:auditwheel.repair:rpath entry  could not be resolved to an absolute path -- discarding it.
INFO:auditwheel.wheeltools:Previous filename tags: linux_aarch64
INFO:auditwheel.wheeltools:New filename tags: manylinux_2_34_aarch64
INFO:auditwheel.wheeltools:Previous WHEEL info tags: cp311-cp311-linux_aarch64
INFO:auditwheel.wheeltools:New WHEEL info tags: cp311-cp311-manylinux_2_34_aarch64
DEBUG:auditwheel.tools:dir2zip from /tmp/tmpptm_fau1 to /work/wheelhouse/xes_bscan-0.10-cp311-cp311-manylinux_2_34_aarch64.whl takes 0:00:00.497132
INFO:auditwheel.main_repair:
Fixed-up wheel written to /work/wheelhouse/xes_bscan-0.10-cp311-cp311-manylinux_2_34_aarch64.whl

However 6.4.0+ does not bundle it:

DEBUG:auditwheel.policy:Package requires CXXABI_1.3.9, incompatible with policy manylinux_2_17_aarch64 which requires {'CXXABI_1.3.5', 'CXXABI_1.3.7', 'CXXABI_1.3.3', 'CXXABI_1.3.1', 'CXXABI_1.3', 'CXXABI_TM_1', 'CXXABI_1.3.2', 'CXXABI_1.3.4', 'CXXABI_1.3.6'}
DEBUG:auditwheel.tools:zip2dir from /work/dist/xes_bscan-0.10-cp311-cp311-linux_aarch64.whl to /tmp/tmpe0pf0hyq takes 0:00:00.058861
DEBUG:auditwheel.repair:Grafting: /lib64/libusb-1.0.so.0.3.0 -> xes_bscan.libs/libusb-1-c364fbd7.0.so.0.3.0
DEBUG:auditwheel.repair:Grafting: /lib64/libftdi1.so.2.5.0 -> xes_bscan.libs/libftdi1-b0562257.so.2.5.0
DEBUG:auditwheel.repair:Grafting: /lib64/libudev.so.1.7.5 -> xes_bscan.libs/libudev-70714659.so.1.7.5
DEBUG:auditwheel.repair:rpath entry  could not be resolved to an absolute path -- discarding it.
INFO:auditwheel.wheeltools:Previous filename tags: linux_aarch64
INFO:auditwheel.wheeltools:New filename tags: manylinux_2_34_aarch64
INFO:auditwheel.wheeltools:Previous WHEEL info tags: cp311-cp311-linux_aarch64
INFO:auditwheel.wheeltools:New WHEEL info tags: cp311-cp311-manylinux_2_34_aarch64
DEBUG:auditwheel.tools:dir2zip from /tmp/tmpe0pf0hyq to /work/wheelhouse/xes_bscan-0.10-cp311-cp311-manylinux_2_34_aarch64.whl takes 0:00:00.501184
INFO:auditwheel.main_repair:
Fixed-up wheel written to /work/wheelhouse/xes_bscan-0.10-cp311-cp311-manylinux_2_34_aarch64.whl

#567 added this to the whitelist, so this is presumably what's causing the problem?

There is no guarantee that the host machine will have libatomic. Testing on Debian Bookworm (12+ which is called out as supported by manylinux_2_34 https://github.com/pypa/manylinux?tab=readme-ov-file#manylinux_2_34-almalinux-9-based---alpha) using the distro provided CPython (3.11), there is no libatomic on the host. Since the libatomic dependency is coming from the libraries being bundled from the manylinux build image, it would seem like it should continue to be provided in the wheel and RPATH'd since it may not be available on the host.

Based on this commit:
python/cpython@1f7e421

libatomic is only possibly a requirement for some architectures in CPython 3.13+

I'm going to try switching over to quay.io/pypa/manylinux_2_34_aarch64:2025.03.22-2 and see if things work since i think that has auditwheel 6.3.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions