Stream: git-wasmtime

Topic: wasmtime / PR #1739 winx: do not link directly to ntdll.dll


view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 17:17):

whitequark edited PR #1739 from dont-link-to-ntdll to master:

The documentation for RtlNtStatusToDosError explicitly tells to call it via GetProcAddress. The documentation for NtQueryInformationFile does not, but similar considerations apply because there is normally no import library for ntdll.

The main reason to use GetProcAddress though is because MinGW does include an import library for ntdll, this import library contains a definition of setjmp, and because of the way rustc orders linker arguments, this definition of setjmp conflicts with and gets picked over the one in msvcrt. Using setjmp from ntdll is undesirable as it is an undocumented API and it is missing from wine, making it harder to develop wasmtime using a cross-compiler.

Fixes #1738.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 17:19):

whitequark edited PR #1739 from dont-link-to-ntdll to master:

The documentation for RtlNtStatusToDosError explicitly tells to call it via GetProcAddress. The documentation for NtQueryInformationFile does not, but similar considerations apply because there is normally no import library for ntdll.

The main reason to use GetProcAddress though is because MinGW does include an import library for ntdll, this import library contains a definition of setjmp, and because of the way rustc orders linker arguments, this definition of setjmp conflicts with and gets picked over the one in msvcrt. Using setjmp from ntdll is undesirable as it is an undocumented API and it is missing from wine, making it harder to develop wasmtime using a cross-compiler.

Fixes #1738.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 17:19):

whitequark updated PR #1739 from dont-link-to-ntdll to master:

The documentation for RtlNtStatusToDosError explicitly tells to call it via GetProcAddress. The documentation for NtQueryInformationFile does not, but similar considerations apply because there is normally no import library for ntdll.

The main reason to use GetProcAddress though is because MinGW does include an import library for ntdll, this import library contains a definition of setjmp, and because of the way rustc orders linker arguments, this definition of setjmp conflicts with and gets picked over the one in msvcrt. Using setjmp from ntdll is undesirable as it is an undocumented API and it is missing from wine, making it harder to develop wasmtime using a cross-compiler.

Fixes #1738.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:10):

whitequark updated PR #1739 from dont-link-to-ntdll to master:

The documentation for RtlNtStatusToDosError explicitly tells to call it via GetProcAddress. The documentation for NtQueryInformationFile does not, but similar considerations apply because there is normally no import library for ntdll.

The main reason to use GetProcAddress though is because MinGW does include an import library for ntdll, this import library contains a definition of setjmp, and because of the way rustc orders linker arguments, this definition of setjmp conflicts with and gets picked over the one in msvcrt. Using setjmp from ntdll is undesirable as it is an undocumented API and it is missing from wine, making it harder to develop wasmtime using a cross-compiler.

Fixes #1738.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:11):

whitequark updated PR #1739 from dont-link-to-ntdll to master:

The documentation for RtlNtStatusToDosError explicitly tells to call it via GetProcAddress. The documentation for NtQueryInformationFile does not, but similar considerations apply because there is normally no import library for ntdll.

The main reason to use GetProcAddress though is because MinGW does include an import library for ntdll, this import library contains a definition of setjmp, and because of the way rustc orders linker arguments, this definition of setjmp conflicts with and gets picked over the one in msvcrt. Using setjmp from ntdll is undesirable as it is an undocumented API and it is missing from wine, making it harder to develop wasmtime using a cross-compiler.

Fixes #1738.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:23):

kubkon requested peterhuene for a review on PR #1739.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:30):

alexcrichton submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:30):

alexcrichton created PR Review Comment:

Could you add an assert here that address isn't null as well?

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:32):

whitequark submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:32):

whitequark created PR Review Comment:

Done

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:32):

whitequark updated PR #1739 from dont-link-to-ntdll to master:

The documentation for RtlNtStatusToDosError explicitly tells to call it via GetProcAddress. The documentation for NtQueryInformationFile does not, but similar considerations apply because there is normally no import library for ntdll.

The main reason to use GetProcAddress though is because MinGW does include an import library for ntdll, this import library contains a definition of setjmp, and because of the way rustc orders linker arguments, this definition of setjmp conflicts with and gets picked over the one in msvcrt. Using setjmp from ntdll is undesirable as it is an undocumented API and it is missing from wine, making it harder to develop wasmtime using a cross-compiler.

Fixes #1738.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:48):

alexcrichton submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:56):

alexcrichton merged PR #1739.


Last updated: Nov 22 2024 at 16:03 UTC