On Wed Jan 7 15:05:18 2026 +0000, Yuxuan Shui wrote:
Also, the "pulling symbol in only when needed" behavior is GNU ld specific. With lld-link I also get `duplicate symbol: _initterm_e` when it's also available from msvcrt. Now I start to think "use `_initterm_e` from msvcrt when available" is not possible... Here is a version that seems to work for me: https://gitlab.winehq.org/jacek/wine/-/commits/ctors. `_initterm` and `_initterm_e` need to be in separate object files to avoid duplicate symbol (some crt version implement only one variant; if pulling in the other variant pulls both of them from a static lib, we get a duplicate symbol).
I also made other clean ups and avoided the need for a new static library by tweaking makedep and using `__ASM_GLOBAL_IMPORT`. How does it look for you? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9265#note_126669