> On 19 Sep 2021, at 16:10, Jeff Law via Gcc-patches <gcc-patches@gcc.gnu.org>
> wrote:
>
>
>
> On 8/4/2021 12:21 PM, John Ericson wrote:
>> The helper is for `--print-prog-name` and similar things. Since all
>> executable finding goes through it, we can move the default overrides
>> into that path too. This also ensures that if some is looking for a
>> *non*-program that called `as`, `ld`, etc., weird things don't happen.
>> ---
>> gcc/gcc.c | 59 ++++++++++++++++++++++++++++++++-----------------------
>> 1 file changed, 34 insertions(+), 25 deletions(-)
> Thanks. I added a ChangeLog entry and pushed this to the trunk.
This doesn’t appear to have been tested with —with-{as,ld,dsymutil}= where
bootstrap fails since ‘mode' is undefined in the reorganised code.
I’m testing the patch below and will apply it if all goes OK,
thanks
Iain
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 1a74bf92f7a..506c2acc282 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3083,17 +3083,17 @@ find_a_program (const char *name)
/* Do not search if default matches query. */
#ifdef DEFAULT_ASSEMBLER
- if (! strcmp (name, "as") && access (DEFAULT_ASSEMBLER, mode) == 0)
+ if (! strcmp (name, "as") && access (DEFAULT_ASSEMBLER, X_OK) == 0)
return xstrdup (DEFAULT_ASSEMBLER);
#endif
#ifdef DEFAULT_LINKER
- if (! strcmp (name, "ld") && access (DEFAULT_LINKER, mode) == 0)
+ if (! strcmp (name, "ld") && access (DEFAULT_LINKER, X_OK) == 0)
return xstrdup (DEFAULT_LINKER);
#endif
#ifdef DEFAULT_DSYMUTIL
- if (! strcmp (name, "dsymutil") && access (DEFAULT_DSYMUTIL, mode) == 0)
+ if (! strcmp (name, "dsymutil") && access (DEFAULT_DSYMUTIL, X_OK) == 0)
return xstrdup (DEFAULT_DSYMUTIL);
#endif