I am trying to write a Windows DLL in Rust which will be later relocated to an environment without access to the operating system.
So I wrote 3 rlibs (all no_std):
- A -sys crate providing the generated bindings to the C functions I will have access to from the DLL after it is relocated
- A -env crate providing a memcpy/memmove/memset and a memcmp function using the -sys-bindings as well as an global allocator
- A -lib crate providing a saver wrapper around the -sys crate, importing the -env crate and providing generic library functionality by exporting symbols of libcore and liballoc
These Libraries do compile, but if I am trying to build a cdylib-crate (no_std of course) using the -lib crate I get a linker error regarding 4 not resolved symbols:
- "_DllMainCrtStartup" - is this one not automatically defined with no_std? The error disappears if I define it manually in the DLL, although it will never be used
- "__umodti3" in "ZN4core3fmt3num53$LT$impl$u20$core..fmt..Display$u20$for$u20$i128$GT$3fmt17hae8aafde5f70b339E"
- "__udivti3" in "ZN4core3fmt3num53$LT$impl$u20$core..fmt..Display$u20$for$u20$i128$GT$3fmt17hae8aafde5f70b339E"
- and "__CxxFrameHandler3" multiple times from all over the place
I am not sure where these symbols are referenced and why I hope someone can help me with that...