mirror of
https://github.com/utmapp/dxmt.git
synced 2026-12-01 07:53:21 -10:00
The native (non-Wine) build previously produced a dylib per module (d3d11.dylib, dxgi.dylib, d3d10core.dylib, winemetal.dylib). Build each module as a static library instead and link them all into one libdxmt-native.dylib, so an embedder dlopen()s a single file whose exported entry points are the modules' own — no runtime forwarding. Cross (Wine) builds are unchanged: each module still builds its own DLL with its .def exports, guarded by dxmt_crossbuild. Three things only a single image has to settle: - link_whole, because nothing inside the image references the D3D entry points and the linker would otherwise drop the objects that define them. - One Logger instance. Each module normally defines its own, one log file per DLL; in a single image that is several definitions of one symbol, so the modules drop theirs under DXMT_NATIVE and dxmt-native defines the only one (dxmt.log). Wine keeps the per-DLL names. - Two pre-existing duplicate definitions that separate DLLs hid: DXBCParserNative, a byte-identical second copy of DXBCParser natively, now aliases the one archive; and GetMonitorFormatBpp, whose own FIXME noted the duplication, becomes file-local in d3d11 (leaving Wine codegen untouched). The image exports only the public entry points (the D3D/DXGI/D3D10 .def symbols), via one -exported_symbols_list per module concatenated into the single list ld64 accepts; everything else, including all of statically-linked LLVM, stays hidden. The d3d12 names live in a separate list appended only when that module is built in, because ld64 rejects a list naming a symbol it cannot find. Ships dxmt-native.pc; airconv gains the brew LLVM 15 link fix for /opt/homebrew. Co-Authored-By: Claude Fable 5 <[email protected]>