Add Windows 64-bit cross-compilation support via MinGW-w64#76
Open
covertmatthew wants to merge 1 commit into
Open
Add Windows 64-bit cross-compilation support via MinGW-w64#76covertmatthew wants to merge 1 commit into
covertmatthew wants to merge 1 commit into
Conversation
- Add buildx/Dockerfile.mingw64 for cross-compiling with Fedora MinGW toolchain - Update docs/INSTALL.md with Windows 64-bit build instructions - Add win64 build entry to CHANGELOG.md - Add output-win64/ to .gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A note on Windows 64-bit data model compatibility (LLP64 vs LP64)...
Windows 64-bit uses the LLP64 data model where
longis 32-bit, unlike Linux 64-bit (LP64) wherelongis 64-bit. MinGW-w64 correctly follows the Windows convention, which meansCK_ULONG(unsigned long) is 32-bit on Windows. This is expected and matches all Windows PKCS#11 provider DLLs. MinGW'slsearch/lfindfunctions acceptunsigned int *for the element count parameter, while the codebase usessize_t *(POSIX convention). A compatibility wrapper (mingw_compat.h, generated at build time in the Dockerfile) bridges this mismatch by converting betweensize_tandunsigned intfor the element count argument.While this represents a theoretical precision loss (64-bit to 32-bit), it is safe in practice because the values represent the number of PKCS#11 attributes in a template array, typically 10–50 elements, never exceeding a few hundred. Exceeding
UINT_MAX(~4.3 billion) elements would require hundreds of gigabytes of RAM for the array alone, which is not a realistic scenario.