Skip to content

Linker parsing updates#32

Merged
scheibelp merged 3 commits intospack:mainfrom
johnwparent:linker-parsing-updates
Apr 28, 2026
Merged

Linker parsing updates#32
scheibelp merged 3 commits intospack:mainfrom
johnwparent:linker-parsing-updates

Conversation

@johnwparent
Copy link
Copy Markdown
Collaborator

@johnwparent johnwparent commented Jan 31, 2026

Linker Parsing: Overhaul linker CLI processing

  • Stop disabiguating between obj, lib, and lo files, they're treated the same by the linker and we don't need extra logic for each, and we need to be able to process them in order.
  • Carefully parses the command line and .def file to determine the intended output name and ensures the internal modeling of that name in the compiler wrapper is consistent
  • Adds behavior to allow for extremely long command lines (Paraviews are 75kb) by composing arguments into an RSP file
  • Adds logic to expand the contents of an RSP file so we can inspect the full command line to better reason about naming and eventual length
  • Small bug fixes of QOL improvements

Includes #31

Reduce the degree to which we decompose an incoming command line in the toolchain. The odering and context of CLI arguments is highly fragile and important to the contents and naming of build artifacts, in particular w.r.t. maintaining user expectations and logic regarding name reasoning.

Instead toolchain is now a thin wrapper to pass the toolchain commands through the compiler wrapper itself, preserving inputs and order and injecting Spack libs, includes, etc safely.

We leave command line parsing to specialized tools designed for the linker/compiler/etc.

Signed-off-by: John Parent <john.parent@kitware.com>
* Stop disabiguating between obj, lib, and lo files, they're treated the same by the linker and we don't need extra logic for each, and we need to be able to process them in order.
* Carefully parses the command line and .def file to determine the intended output name and ensures the internal modeling of that name in the compiler wrapper is consistent
* Adds behavior to allow for extremely long command lines (Paraviews are 75kb) by composing arguments into an RSP file
* Adds logic to expand the contents of an RSP file so we can inspect the full command line to better reason about naming and eventual length
* Small bug fixes of QOL improvements

Signed-off-by: John Parent <john.parent@kitware.com>
Signed-off-by: John Parent <john.parent@kitware.com>
@johnwparent johnwparent force-pushed the linker-parsing-updates branch from 162b41d to 13693b5 Compare April 28, 2026 19:02
@scheibelp scheibelp merged commit c420209 into spack:main Apr 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants