]> git.ipfire.org Git - thirdparty/gcc.git/commit
Re: [PATCH] gcc-ar: Handle response files properly [PR77576]
authorCostas Argyris <costas.argyris@gmail.com>
Mon, 31 Jul 2023 16:56:20 +0000 (10:56 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Mon, 31 Jul 2023 16:57:50 +0000 (10:57 -0600)
commitc6523ae786e36dccd64589682140e9221628bb5b
tree80f6e8078bfa4e5e402e879b665ff54bc83daf0a
parentb769811e7c1b3dff2fa0ec2c37b52859d7bceed4
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.
gcc/gcc-ar.cc