Commit 70b16fe
committed
fix(random): name bcrypt the way this package already names libraries
`src/win.cpp` records the four Win32 libraries this backend calls into
as linker directives in the object, under `#if defined(_MSC_VER)`, and
`mcpp.toml` says so four lines below the block I was editing. Two
manifest spellings were pushed before reading that, and neither could
have worked: `ldflags` reaches the command line verbatim, and the two
toolchains `env = "msvc"` selects reject each other's word for a
library.
LINK.EXE -lbcrypt → LNK4044: unrecognized option '/lbcrypt'
clang++ bcrypt.lib → error: no such file or directory
`cfg()` cannot separate them: its four keys name the target, and which
compiler drives the link is not a property of the target. The directive
mechanism needs no key, and both toolchains on that side read it.
clang++ --target=x86_64-pc-windows-msvc -c
→ Directive(s): /DEFAULTLIB:bcrypt.lib
clang++ --target=x86_64-w64-windows-gnu
→ _MSC_VER undefined, ignored; the GNU list in the manifest carries it
The pragma is in `src/random.cpp` rather than beside the other four
because a directive travels in the object that carries it, and the
object a linker pulls in for `kal_random_fill` is that one.1 parent ffb96cf commit 70b16fe
2 files changed
Lines changed: 22 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | 54 | | |
89 | 55 | | |
90 | 56 | | |
| |||
101 | 67 | | |
102 | 68 | | |
103 | 69 | | |
104 | | - | |
| 70 | + | |
| 71 | + | |
105 | 72 | | |
106 | 73 | | |
107 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
34 | 54 | | |
35 | 55 | | |
36 | 56 | | |
| |||
0 commit comments