On Mon, 26 Nov 2018, Jacek Caban wrote:
ntdll exports a subset of crt functions and currently our importlib exposes
them to linked application. This means that -lntdll is specified, an
application will use ntdll.dll for things like strlen(). This is a very
unexpected effect for majority of use cases. Using NtReadFile shouldn't imply
changing used strlen() application.
We had problems with that in the past (see commit
b1de317aab3a3cf79606535edd126a565ddd284e) and I recently observed that with
duplicated atan symbols in Firefox builds.
In Windows SDK, ntdll.lib does not expose those crt functions and I don't
think we should.
That said, I can see a valid use cases for linking to them, for example with
combination with -nodefaultlibs. My proposed patch adds a new dedicated
importlib, libntdllcrt.a, which may be used to explicitly request using
ntdll.dll for crt functions. I'm open to other ideas.
This looks like a very sensible solution to me, LGTM!
// Martin
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public