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

--- Comment #10 from Deepthi H <deepadeepthi98 at gmail dot com> ---
As suggested, We've updated the patch to place the arguments in a file instead
of passing it from an env variable.
When the COLLECT_GCC_OPTIONS is <128kb the env variable is used and when the
size >128kb arguments will be moved to a file.

In Collect2: We copy back the contents of the arguments from file into a buffer
and pass it on to the Linker.

See the updated patch :
With_Files_Workaround_for_GCC_driver_LongArgumentList.patch

The output of the example program in descripton section as below: 
=============================================================
$big_100k_var=$(printf "%0*d" 100000 0)
$<<GCC_PATH_With_Fix>>/gcc -c a.c -DA=$big_100k_var -DB=$big_100k_var -v
Using built-in specs.
COLLECT_GCC=/home/sunild/Gcc_Driver_with_FILE/install/home/Gcc_Driver_with_FILE/build/bin/gcc
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/Gcc_Driver_with_FILE/build
--enable-languages=c --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240513 (experimental) (GCC)
/home/Gcc_Driver_with_FILE/install/home/Gcc_Driver_with_FILE/build/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.0.0/cc1
-quiet -v -imultiarch x86_64-linux-gnu -iprefix
/home/Gcc_Driver_with_FILE/install/home/Gcc_Driver_with_FILE/build/bin/../lib/gcc/x86_64-pc-linux-gnu/15.0.0/
-D A=00000000000000000000000000000000000000000000000
....
....
<<trimmed output>>
....
....
0 -D B=000000000000000000000000000...
....
....
<<trimmed output>>
....
....
00000000000 a.c -quiet -dumpbase a.c -dumpbase-ext .c -mtune=generic
-march=x86-64 -version -o /tmp/cc7Ox5mH.s
=============================================================

Please let us know this solution is ok.

Reply via email to