spack / spack/compiler-wrapper

Unset `SPACK_*` before exec?

Open
#9 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
4
Forks
4
PR merge metrics
No merged PRs in 30d

Description

The compiler wrapper basically translates *envp into *argv for the compiler.

In certain cases we hit "Argument list too long", which happens when env variables and command line arguments exceed a certain size (they go consecutively on the stack).

That suggests that we should clear SPACK_* variables after translation to command line arguments, so that if you can execute the wrapper, you can almost certainly execute the compiler.

Also, it could fix an issue where we're doubly wrapping: first gcc where pass -Wl,* and -L and then ld where pass those flags once more.

What remains to be checked is whether this works with GCC's LTO. GCC generates a makefile that invokes GCC again. I've never inspected that intermediate Makefile; presumably it doesn't hit the compiler wrapper again, and already contains all flags from the parent gcc invocation.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the compiler wrapper's environment-to-argument translation and exec path; the issue does not name specific files or tests. Check the proposed SPACK_* cleanup against GCC LTO's generated makefile and nested gcc/ld wrapping, then verify that argument-list failures and duplicated flags are addressed without breaking LTO.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.