KEMBAR78
Fix WCHAR definition on non-Windows for nativeaot by elinor-fung · Pull Request #87465 · dotnet/runtime · GitHub
Skip to content

Conversation

@elinor-fung
Copy link
Member

In combination with #87430, this fixes enabling of runtime events on non-Windows. We were using wchar_t on non-Windows and expecting it to be 2 bytes (when it is 4) - as a result, the string length / conversion functions were not working properly and providers were not properly enabled.

The GC events that don't go through ETW::GCLog are now fired/collected on non-Windows. There is still work needed to pull in the ETW::GCLog implementation on non-Windows.

Contributes to #87445

cc @LakshanF

This fixes enabling of runtime events on non-Windows. The GC events that don't go
through ETW::GCLog are now fired/collected on non-Windows.

There is still work needed to pull in the ETW::GCLog implementation on non-Windows
@ghost
Copy link

ghost commented Jun 13, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

In combination with #87430, this fixes enabling of runtime events on non-Windows. We were using wchar_t on non-Windows and expecting it to be 2 bytes (when it is 4) - as a result, the string length / conversion functions were not working properly and providers were not properly enabled.

The GC events that don't go through ETW::GCLog are now fired/collected on non-Windows. There is still work needed to pull in the ETW::GCLog implementation on non-Windows.

Contributes to #87445

cc @LakshanF

Author: elinor-fung
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@agocke
Copy link
Member

agocke commented Jun 13, 2023

Out of curiosity: I thought WCHAR on Windows is UTF-16. Is it UTF-32 on Linux? I assume these definitions come from our PAL layer.

@elinor-fung
Copy link
Member Author

Out of curiosity: I thought WCHAR on Windows is UTF-16. Is it UTF-32 on Linux? I assume these definitions come from our PAL layer.

WCHAR on Windows is UTF-16 (typedef-ed to wchar_t) - as far as I know, it is a Windows-ism.

wchar_t is implementation-defined. For MSVC, it is 2-byte characters in UTF-16. For others like clang and gcc, it is 4-byte characters. Our PAL layers define WCHAR to mean 2-byte character on all platforms.

@elinor-fung elinor-fung deleted the nativeaot-runtimeevent-unix-partial branch June 13, 2023 17:16
@elinor-fung
Copy link
Member Author

Ugh, missed updating disableddotnetruntime.cpp. PR didn't catch it because it needed to have #87430.

@elinor-fung
Copy link
Member Author

@ghost ghost locked as resolved and limited conversation to collaborators Jul 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants