Similar to 9be8c5255bb2c02467373bf373b6eefcfb0337ac. Otherwise ucrtbase initialization code crashes with +relay enabled when compiled with clang as a PE build.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/ntdll/ntdll.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 9f7bfae76d..4b3d3d09b8 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1450,7 +1450,7 @@ @ cdecl __iscsym(long) @ cdecl __iscsymf(long) @ cdecl __toascii(long) -@ cdecl -arch=i386 -ret64 _alldiv(int64 int64) +@ cdecl -norelay -arch=i386 -ret64 _alldiv(int64 int64) @ cdecl -arch=i386 -norelay _alldvrm(int64 int64) @ cdecl -arch=i386 -ret64 _allmul(int64 int64) @ cdecl -arch=i386 -norelay _alloca_probe() @@ -1458,7 +1458,7 @@ @ stdcall -arch=i386 -ret64 _allshl(int64 long) @ stdcall -arch=i386 -ret64 _allshr(int64 long) @ cdecl -ret64 _atoi64(str) -@ cdecl -arch=i386 -ret64 _aulldiv(int64 int64) +@ cdecl -norelay -arch=i386 -ret64 _aulldiv(int64 int64) @ cdecl -arch=i386 -norelay _aulldvrm(int64 int64) @ cdecl -arch=i386 -ret64 _aullrem(int64 int64) @ stdcall -arch=i386 -ret64 _aullshr(int64 long)
Hi Dmitry,
This seems to be incorrect. _alldiv() returns a LONGLONG.
Thanks, Zhiyi
On 1/27/21 9:51 PM, Dmitry Timoshkov wrote:
Similar to 9be8c5255bb2c02467373bf373b6eefcfb0337ac. Otherwise ucrtbase initialization code crashes with +relay enabled when compiled with clang as a PE build.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru
dlls/ntdll/ntdll.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 9f7bfae76d..4b3d3d09b8 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1450,7 +1450,7 @@ @ cdecl __iscsym(long) @ cdecl __iscsymf(long) @ cdecl __toascii(long) -@ cdecl -arch=i386 -ret64 _alldiv(int64 int64) +@ cdecl -norelay -arch=i386 -ret64 _alldiv(int64 int64) @ cdecl -arch=i386 -norelay _alldvrm(int64 int64) @ cdecl -arch=i386 -ret64 _allmul(int64 int64) @ cdecl -arch=i386 -norelay _alloca_probe() @@ -1458,7 +1458,7 @@ @ stdcall -arch=i386 -ret64 _allshl(int64 long) @ stdcall -arch=i386 -ret64 _allshr(int64 long) @ cdecl -ret64 _atoi64(str) -@ cdecl -arch=i386 -ret64 _aulldiv(int64 int64) +@ cdecl -norelay -arch=i386 -ret64 _aulldiv(int64 int64) @ cdecl -arch=i386 -norelay _aulldvrm(int64 int64) @ cdecl -arch=i386 -ret64 _aullrem(int64 int64) @ stdcall -arch=i386 -ret64 _aullshr(int64 long)
Zhiyi Zhang zzhang@codeweavers.com wrote:
This seems to be incorrect. _alldiv() returns a LONGLONG.
I guess by incorrect you mean the expalantion in 9be8c5255bb2c02467373bf373b6eefcfb0337ac about implicit struct being passed in the first parameter. However, the patch fixes the crash with relay debugging enabled while the reason may be different.
On 27.01.2021 17:19, Dmitry Timoshkov wrote:
Zhiyi Zhang zzhang@codeweavers.com wrote:
This seems to be incorrect. _alldiv() returns a LONGLONG.
I guess by incorrect you mean the expalantion in 9be8c5255bb2c02467373bf373b6eefcfb0337ac about implicit struct being passed in the first parameter. However, the patch fixes the crash with relay debugging enabled while the reason may be different.
I think that the reason this help is that we 'lie' in spec about the calling convention to get a proper importlib. It's a stdcall function that's imported without stdcall decorations. We don't have a way to express that in spec file (and given that those are the only exceptions I know, it's probably not worth extending spec syntax). See [1] for a list of such functions. I think that the fix is right, but we need that for other functions as well. (Another solution would be to provide static versions of them).
Thanks,
Jacek
[1] https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/ntdll/large_int.c#l52...
Jacek Caban jacek@codeweavers.com wrote:
On 27.01.2021 17:19, Dmitry Timoshkov wrote:
Zhiyi Zhang zzhang@codeweavers.com wrote:
This seems to be incorrect. _alldiv() returns a LONGLONG.
I guess by incorrect you mean the expalantion in 9be8c5255bb2c02467373bf373b6eefcfb0337ac about implicit struct being passed in the first parameter. However, the patch fixes the crash with relay debugging enabled while the reason may be different.
I think that the reason this help is that we 'lie' in spec about the calling convention to get a proper importlib. It's a stdcall function that's imported without stdcall decorations. We don't have a way to express that in spec file (and given that those are the only exceptions I know, it's probably not worth extending spec syntax). See [1] for a list of such functions. I think that the fix is right, but we need that for other functions as well. (Another solution would be to provide static versions of them).
Thanks,
Jacek
[1] https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/ntdll/large_int.c#l52...
Yes, I saw the list at [1], but decided to send the patch only for a few functions from it because I couldn't test the fix for all of them.