Skip to content

Gracefully handle super-long linker command lines #41190

Closed
@alexcrichton

Description

@alexcrichton

The compiler should gracefully handle invocations of the linker which would otherwise blow the system limits. I've heard reports of this happening on both Unix and Windows, so this is a cross-platform concern.

My preference of how to implement this would be:

  • Linkers typically support this method via passing arguments as @file where file is a path on the filesystem that contains a bunch of options.
  • Short linker invocations should not use @file syntax for debuggability
  • The compiler automatically switches to @file when the command line gets too big.
  • rustc has some arbitrary limit for bytes it'll pass as arguments to Command, likely well below the platform specific limits

I don't know the precise syntax of these files, unfortunately, but I'm sure google does somewhere!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-help-wantedCall for participation: Help is requested to fix this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions