[Bug driver/77576] gcc-ar doesn't work if all options are read from file
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 31 16:58:09 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77576
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jeff Law <law@gcc.gnu.org>:
https://gcc.gnu.org/g:c6523ae786e36dccd64589682140e9221628bb5b
commit r14-2884-gc6523ae786e36dccd64589682140e9221628bb5b
Author: Costas Argyris <costas.argyris@gmail.com>
Date: Mon Jul 31 10:56:20 2023 -0600
Re: [PATCH] gcc-ar: Handle response files properly [PR77576]
Problem: gcc-ar fails when a @file is passed to it:
$ cat rsp
--version
$ gcc-ar @rsp
/usr/bin/ar: invalid option -- '@'
This is because a dash '-' is prepended to the first
argument if it doesn't start with one, resulting in
the wrong call 'ar -@rsp'.
Fix: Expand argv to get rid of any @files and if any
expansions were made, pass everything through a
temporary response file.
$ gcc-ar @rsp
GNU ar (GNU Binutils for Debian) 2.35.2
...
gcc/
PR driver/77576
* gcc-ar.cc (main): Expand argv and use
temporary response file to call ar if any
expansions were made.
More information about the Gcc-bugs
mailing list