Skip to content

Building a static binary for armv6 or lower causes a dynamic link to libatomic. #1779

@BlackDex

Description

@BlackDex

Hello there,

I'm running into an issue building a static library using a custom static build OpenSSL v3.
When the CARGO_CFG_TARGET_POINTER_WIDTH is 32, it will always link dynamically to libatomic.

This causes my static musl builds to fail, because it suddenly has a dynamic link to libatomic.
For my builds i add a RUSTFLAGS which contain the path directly to this library, for example RUSTFLAGS='-Clink-arg=/usr/local/musl/arm-unknown-linux-musleabi/lib/libatomic.a -Clink-arg=-s'

I didn't need this for OpenSSL before, but more because of MiMalloc which also links to libatomic under water.

Is there some way that you can add some check or an extra env check to not dynamically link libatomic in some cases?
That would solve my compile issue.

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