Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Does not build out of the box on x86_64-pc-windows-gnu (dlltool.exe: program not found) #723

@ColinFinck

Description

@ColinFinck

Attempting to build latest getrandom on a pristine Windows installation with the x86_64-pc-windows-gnu toolchain results in an error calling dlltool 'dlltool.exe': program not found failure. This is a known Rust bug of the -gnu targets when using raw-dylib (see rust-lang/rust#103939): The -gnu targets add a call to dlltool but don't ship dlltool.

Using the new -gnullvm target is no alternative either, because it currently lacks even more components: rust-lang/rust#146634.
I cannot use the -msvc targets, because I need a freely redistributable toolchain. I also cannot install the missing dlltool.exe. To sum it up: getrandom needs to work for me on a pristine unmodified x86_64-pc-windows-gnu toolchain.

This was no problem until the merge of #627.

I see several options how to solve this problem:

  1. Reverting Use "raw-dylib" for non-win7 Windows Targets #627 and using windows-targets again.
  2. Retrieving the address of ProcessPrng at runtime using LoadLibraryW and GetProcAddress (can be put in a OnceLock to not do that on every call).
  3. Adding a feature to use RtlGenRandom instead.

As a quick fix, I'll go with option 3 for now. What do you think could be a long-term solution?

CC @josephlr @newpavlov

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions