• Winelib global objects constructors fail when invoking standard libs

    From mirko.ortensi@gmail.com@21:1/5 to All on Fri Apr 15 09:26:33 2016

    quite new to wine, and I would like to request help because of something that seemengly should work.
    I am testing on versions Stable-1.8.1 and Devel-1.9.4

    I managed to recompile and link my win32 application on ARM7 but at execution time, it crashes because of a segmentation fault where memset (or the bare printf("HELLO")) is invoked in the global object constructor.

    The global object is built in the stack, then it seems that at launch time my object constructor is called before C Standard Library is ready.
    Now, as a workaround I may just declare a pointer to global object and instantiate it in the main (not tried but it should work)...though...this is something I'd like to avoid to keep the code as original as possible. Removing the global objects,
    everything works like a charm.

    As far as I understand, global object constructors are called after Wine infrastructure is ready to go, though I have doubts now regarding C Standard Library.
    (Please check 8.3.3. Starting a Winelib process https://www.winehq.org/docs/winedev-guide/x3172)

    Am I missing something?

    Thanks in advance!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)