Skip to content

numtraits libm feature and num-bigint-dig directly depends on C library libm #686

Description

@AlexanderSchuetz97

Hello there,
you are including the numtraits crate with the libm feature enabled.
This causes linking with libm.

I am trying to use this crate in a scenario where linking to libm (or other C code) is not possible (Complex cross compilation).
I assumed since you mention that this is pure rust that it does not rely on C code.

If its possible could you perhaps evaluate removing this dependency on C code and if it seems feasible remove it?

If its not possible or would require too much effort then feel free to close this issue,
but perhaps a small clarification in the readme that this crate does
link libm would have saved me some time.

Activity

  1. tarcieri commented on Apr 24, 2026

    @tarcieri
    Member

    Can you please file an issue against crypto-primes? I didn't realize they made libm a hard dependency or I would've recommended against that:

    https://github.com/entropyxyz/crypto-primes

    Looks like it got added in this PR which could at least trivially be made feature-gated or implemented without libm:

    entropyxyz/crypto-primes#81

  2. AlexanderSchuetz97 commented on Apr 24, 2026

    @AlexanderSchuetz97
    Author

    Hello there,
    I don't think this crates is the culprit.

    The dependency tree is like this:
    rsa->num-bigint-dig-->libm
    aswell as
    rsa->num-bigint-dig--> numtraits -->libm

    I overlooked this num-bigint-dig direct dependency when creating the issue. I will adjust the title, Its not just numtraits.

    The num-bigint-dig crate already has a issue open where its stated that the libm dependency is there to stay. (Please double check I am unsure If I am reading this correctly)
    dignifiedquire/num-bigint#24

    So I dont think this can be resolved without removing num-bigint-dig from this crate.

    So I will not be opening a Issue on crypto-primes because I do not even see this crate in my dependency tree.
    I am currently using rsa 0.9.10.
    This may be different on the 0.10 release but since its a pre release I did not select it for usage.

    Sincerely
    Alexander Schütz

  3. changed the title [-]numtraits libm feature dependency links to C library libm[/-] [+]numtraits libm feature and num-bigint-dig directly depends on C library libm[/+] on Apr 24, 2026
  4. tarcieri commented on Apr 24, 2026

    @tarcieri
    Member

    We can't really do anything about the v0.9 series, but if you don't want this to be an issue in v0.10 where we have migrated from num-bigint-dig to crypto-bigint, I would suggest opening an issue on crypto-primes in advance.

    We will hopefully have rsa v0.10 stable out in a few months.

  5. AlexanderSchuetz97 commented on Apr 24, 2026

    @AlexanderSchuetz97
    Author

    I am fine with this being only solved in the 0.10.X versions.

    I will see if I can find the time to check if a 0.10.X pre release would work on my application in general and then hopefully verify the crypt-primes libm thing aswell as check if theres any other C code dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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