Skip to content

windows-sys generated WinAPI bindings break ARM platforms #112265

Closed

Description

@bdbai

In #110152 the WinAPI definitions have been replaced by windows-bindgen generated bindings. However, the win32metadata project does not generate metadata for ARM32-specific items, hence the generated bindings lack a few types like CONTEXT and WSADATA on this platform. It effectively breaks thumbv7a-*-windows-* for Rust.

@ChrisDenton

Activity

  1. ChrisDenton commented on Jun 4, 2023

    @ChrisDenton
    Member

    Unfortunately, 32-bit ARM is not being supported by Microsoft going forward. What we could do is insert our own definitions in the prelude, copied from before the changes.

  2. bdbai commented on Jun 4, 2023

    @bdbai
    ContributorAuthor

    Besides the issue with ARM, all UWP targets actually have problems with linkage as well. Previously the APIs forbidden on UWP are gated behind fine-grained conditional compilation flags, but it is no longer the case with generated ones. I got this when building the UWP app that links again a Rust staticlib.
    image

  3. ChrisDenton commented on Jun 4, 2023

    @ChrisDenton
    Member

    Iirc, the Nt functions were never gated. But we loaded them lazily (and panicked if they didn't load). This did allow UWP targets to compile. No idea if they actually ran. I'm not sure who's responsible for these targets.

  4. bdbai commented on Jun 4, 2023

    @bdbai
    ContributorAuthor

    Iirc, the Nt functions were never gated. But we loaded them lazily (and panicked if they didn't load). This did allow UWP targets to compile. No idea if they actually ran. I'm not sure who's responsible for these targets.

    I think you are correct. I can reproduce the link errors with toolchain nightly-2023-05-06. Let me file another issue after I pinpoint the underlying problem.

  5. ChrisDenton commented on Jun 4, 2023

    @ChrisDenton
    Member

    Oh wait, as staticlib? You currently need to make sure to link all the libraries it depends on. You can get them using --print native-static-libs.

  6. bdbai commented on Jun 4, 2023

    @bdbai
    ContributorAuthor

    Oh wait, as staticlib? You currently need to make sure to link all the libraries it depends on. You can get them using --print native-static-libs.

    This will fail Windows App Cert Kit tests.

    image

  7. added
    O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state
    O-windows-msvcToolchain: MSVC, Operating system: Windows
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    regression-untriagedUntriaged performance or correctness regression.
    on Jun 4, 2023
  8. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Jun 4, 2023
  9. ChrisDenton commented on Jun 4, 2023

    @ChrisDenton
    Member

    In that case I'm surprised that lazy loading worked.

  10. apiraino commented on Jun 6, 2023

    @apiraino
    Contributor

    WG-prioritization assigning priority (Zulip discussion).

    @rustbot label -I-prioritize +P-low

  11. added
    P-lowLow priority
    and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Jun 6, 2023
  12. added 2 commits that reference this issue on Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateO-windows-msvcToolchain: MSVC, Operating system: WindowsP-lowLow priorityT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)regression-untriagedUntriaged performance or correctness regression.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions