You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reach the network at run time: its names are the C library's names
⚠️⚠️ THIS SYSTEM'S NETWORK LIBRARY EXPORTS THE BSD NAMES, AND SO DOES THE
C LIBRARY ABOVE THIS IMPLEMENTATION. openkal-musl compiles musl's own
`src/network/*.c', which define `bind', `listen', `accept' and `connect'
and route them through this port. Naming `-lws2_32' on the link line put
both definitions in one program:
ld.exe: libws2_32.a(libws2_32s00165.o): multiple definition of
`connect'; musl/src/network/connect.o: first defined here
Measured on the GNU/PE row of the C library's own continuous integration,
on the first run of this change. It is not an ordering problem: an import
library's member defines the thunk AND the `__imp_' pointer together, so
reaching for either brings both.
⭐ THE NAMES ARE THEREFORE REACHED THROUGH THE SYSTEM'S OWN LOADER
--- `LoadLibraryW' and `GetProcAddress', both of which this package
already links --- into a table resolved once. Nothing of ws2_32 enters
the program's symbol table, so the C library above keeps its `bind' and
this implementation still reaches the system's.
`port/ws2_32.def', the `-lws2_32' flag and the `#pragma comment' all come
out. The table is resolved ENTIRELY OR NOT AT ALL: a table with one null
entry would make the operations that resolved work and the one that did
not call through zero, which is the failure clause 6.1 exists to turn
into a link error and this arrangement cannot.
Measured here after the change: `examples/cross-hello' links and produces
`cross-hello.exe' over this implementation and that C library; 16
objects; exported surface complete and conforming at 88 names; no
undefined symbol outside the permitted set; and NO BSD NAME DEFINED in
this package's own objects, which is the property the collision was about.
0 commit comments