Skip to content

Discrepancy between documentation and implementation for WSL #218

@GoGoOtaku

Description

@GoGoOtaku

In the README section about WSL it is explicitly stated that headers in the /include/wsl folder are explicitly not following LLP64 (Windows) but LP64 (Unix-likes, eg. Linux, BSD, etc) standard when it comes explicitly LONG and ULONG.

On 64-bit Windows, a long is 4 bytes, but on Linux it is typically 8 bytes. The D3D12 ABI for WSL uses long and therefore these should be 8 bytes.

Yet in /include/wsl/stubs/basetsd.h it explicitly hard codes LONG and ULONG to LLP64.

// Note: using fixed-width here to match Windows widths
// Specifically this is different for 'long' vs 'LONG'

typedef uint32_t UINT32, UINT, ULONG, DWORD, BOOL, WINBOOL;
typedef int32_t INT32, INT, LONG;

This is tangential related to #156 as currently DirectXShaderCompiler links to the four year old commit 980971e which predates the existence of basetsd.h.
The current version of DirectXShaderCompiler compiles just fine against a Linux libc but compiling against a newer version of DirectX-Headers causes errors due to incompatible redefinitions between this repositories header /include/wsl/stubs/basetsd.h and their header /include/dxc/Support/D3DReflection.h. With their version adhering to what this repositories README.md states (which by the way predates the additions of basetsd.h).

This isn't me saying "Please fix /include/wsl/stubs/basetsd.h" but rather me asking if basetsd.h is wrong or if a workaround for LP64 based systems should be written.

PS: I am aware of:

WSL support is not intended for general purpose application development.
However since DirectXShaderCompiler is also a Microsoft repository and explicitly mentions compilation under WSL/Linux I am asking for clarifications. There are other incompatibilities between these two headers that probably should be changed in the DXC repository. (Probably either reducing code duplication or fully porting /include/wsl/stubs functionality)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions