https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111527

--- Comment #27 from Sunil Dora <sunil.dora1988 at gmail dot com> ---
Working on a new patch that takes a different approach from V3
(https://gcc.gnu.org/pipermail/gcc-patches/2026-January/706191.html).

V3 added a new getenv_extended() in libiberty to read the @file
contents back as a string. The problem was make_at_file() puts files
in the output directory, which caused 130+ lines of churn in
outputs.exp.

New approach avoids that by using make_temp_file() instead, so the
spill file goes to /tmp. On the writer side (gcc.cc), if
COLLECT_GCC_OPTIONS would exceed the kernel limit, we write the
options to a temp file using writeargv() and set the env var to
@<path>. On the reader side, read_collect_gcc_options() in
collect-utils.cc and lto-plugin.c expands it back using expandargv().
No new libiberty API needed and outputs.exp needs no changes.

Tested on x86_64-pc-linux-gnu:
- outputs.exp: 2659 passes, no regressions
- pr111527.exp (new test): 2 passes

Will send to gcc-patches shortly.
  • [Bug driver/111527] COLLECT_G... sunil.dora1988 at gmail dot com via Gcc-bugs

Reply via email to