|
9 | 9 | // takes a null handle, which is exactly what is wanted here. |
10 | 10 | // |
11 | 11 | // ⚠️ AND NOT `ProcessPrng`, WHICH WAS TRIED FIRST AND FAILS ON A WINDOWS HOST. |
12 | | -// That name lives in `bcryptprimitives.dll` and no import library in either |
13 | | -// toolchain exports it: mingw ships `libbcrypt.a` and not the primitives, and |
14 | | -// this package generates its own import libraries only when cross-compiling |
15 | | -// (`build.mcpp` returns immediately on a Windows host, where a real SDK is |
16 | | -// present). Measured — the cross build linked and the native one did not: |
17 | 12 | // |
18 | 13 | // lld-link: error: undefined symbol: __declspec(dllimport) ProcessPrng |
19 | 14 | // |
| 15 | +// The cross build linked and the native one did not, and the asymmetry is in |
| 16 | +// where the import library comes from. Cross-compiling, this package generates |
| 17 | +// its own from `port/*.def` — a list of names, so a name it lists is a name it |
| 18 | +// has. On a Windows host `build.mcpp` returns immediately and the VENDOR's |
| 19 | +// import libraries are used, because they are present and complete; and the |
| 20 | +// Windows SDK ships `bcrypt.lib` but no import library for |
| 21 | +// `bcryptprimitives.dll`. `ProcessPrng` is documented and has no `.lib`. |
| 22 | +// |
20 | 23 | // ⭐ A backend that links on one host and not another is not a backend. The |
21 | | -// name below is in `libbcrypt.a` on both. |
| 24 | +// name below is exported by `bcrypt.dll` and listed by `bcrypt.lib`, so it |
| 25 | +// resolves through the vendor's libraries and through this package's generated |
| 26 | +// one alike. |
| 27 | +// |
| 28 | +// ⚠️ THE FIRST DIAGNOSIS OF THIS WAS WRONG AND IS RECORDED SO IT IS NOT REPEATED: |
| 29 | +// it read `/usr/x86_64-w64-mingw32/lib` and concluded from mingw's contents. |
| 30 | +// mingw is not part of this ecosystem — it is the very thing `build.mcpp` |
| 31 | +// exists to stop depending on, as the note at the top of that file says. What |
| 32 | +// this backend links against is either the vendor's SDK or this package's own |
| 33 | +// generated libraries, and never a third party's. |
22 | 34 | #include "win.h" |
23 | 35 | #include <openkal/random.h> |
24 | 36 |
|
|
0 commit comments