Skip to content

Render explicit entry-point arguments in the selected linker dialect #572

Closed

Description

@LunaStev

Evidence

The Windows GNU amd64 CI log for PR #569 head 834368d33f2595dfb8db1ef48dc2cd9e6850dade shows an explicit MSVC dry-run link command containing both:

lld-link.exe ... /ENTRY:entry ... /NODEFAULTLIB -Wl,-e,entry

Observed plan

src/cli.rs unconditionally appends format!("-Wl,-e,{}", entry) to out.llvm.link_args when processing an explicit entry point. This happens without selecting the target/linker dialect, while MSVC plan construction already emits /ENTRY:entry.

This is evidence of an invalid mixed-dialect plan, not yet an observed native link failure: the CI regression stops first at its separate mingw substring assertion.

Scope

Keep the requested entry point semantic until linker selection and render it once in the selected driver's dialect. Audit both parsed CLI options and link-plan construction to avoid double emission. Preserve supported GNU driver and direct ELF linker behavior as well as explicit MSVC output.

Acceptance

  • For x86_64 and AArch64 MSVC targets, an explicit entry produces /ENTRY:<symbol> without GNU -Wl, forwarding arguments.
  • Existing GNU/Linux entry handling remains correct for the selected driver.
  • Tests inspect final argument vectors and exercise both MSVC targets; link a minimal COFF executable with an available MSVC-compatible linker.
  • Keep Windows GNU support during the MSVC rollout.

This is a concrete follow-up to #498 / #292, exposed by #569. Fix the production argument routing separately from the regression's host-path assertion.

Activity

  1. added
    ci
    bug
    build
    cross-platform
    on Sep 10, 2026
  2. added a commit that references this issue on Sep 11, 2026
    ecb1637
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

    bugbuildcicross-platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions