-
Notifications
You must be signed in to change notification settings - Fork 231
Description
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:
- Reverting Use "raw-dylib" for non-win7 Windows Targets #627 and using
windows-targets
again. - Retrieving the address of
ProcessPrng
at runtime usingLoadLibraryW
andGetProcAddress
(can be put in aOnceLock
to not do that on every call). - 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?