[Bug driver/102755] Built gcc cross compiler always tries to use "as" instead of cross assembler

2021-10-17 Thread dr.duncan.p.simpson at gmx dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102755

Duncan Simpson  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #5 from Duncan Simpson  ---
The find_a_program logic does seem to fix most versions of this issue. It might
be insufficient if default tool is "foo" but finding it requires path searching
which access(2) does not do. Attempying to build gcc with that problem dies
with a sane message quickly, so I don't think that is a major problem.

The version I was testing had a version of gcc,c which completely ignored
DEFUALT_ASEEMBLER and the built in specs lead to the assumption that running a
program called "as" with execvp(2) was the correct thing to do. The build did
use the compiler passed using --with-as.

[Bug driver/102755] Built gcc cross compiler always tries to use "as" instead of cross assembler

2021-10-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102755

--- Comment #4 from Andrew Pinski  ---
(In reply to Duncan Simpson from comment #3)
> I *can* build the cross compiler because the override spec files get the
> assembler name right when I use --with-as=. There are
> no problems building the compiler or libraries.

There is no override of the spec file going on.

Again when a program is executed via the specs, it goes through the
find_a_program function and that does the following:

#ifdef DEFAULT_ASSEMBLER
  if (! strcmp (name, "as") && access (DEFAULT_ASSEMBLER, X_OK) == 0)
return xstrdup (DEFAULT_ASSEMBLER);
#endif

Which says if the program name matches exactly "as", and the DEFAULT_ASSEMBLER
is defined and has executable access return DEFAULT_ASSEMBLER.

So your patch should have been a nop really as DEFAULT_ASSEMBLER should have
been used for "as".

Can you show exactly how it was failing before and add -v to the command line
too?

[Bug driver/102755] Built gcc cross compiler always tries to use "as" instead of cross assembler

2021-10-15 Thread dr.duncan.p.simpson at gmx dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102755

--- Comment #3 from Duncan Simpson  ---
On 15/10/2021 00:32, pinskia at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102755
>
> Andrew Pinski  changed:
>
> What|Removed |Added
> 
> Keywords||build
>
> --- Comment #2 from Andrew Pinski  ---
> What exact configure line did you do?
> Also what exact error message is happening and when? While building gcc's
> library or otherwise?

I *can* build the cross compiler because the override spec files get the
assembler name right when I use --with-as=. There are
no problems building the compiler or libraries.

The problem only occurs when I attempt to cross compile something
because as, which is a x86_64 native assembler, dies badly when fed
arm64 options and assembly language. What the proposed fix does is make
--wirh-as also affect the built compiler.

[Bug driver/102755] Built gcc cross compiler always tries to use "as" instead of cross assembler

2021-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102755

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||build

--- Comment #2 from Andrew Pinski  ---
What exact configure line did you do?
Also what exact error message is happening and when? While building gcc's
library or otherwise?

[Bug driver/102755] Built gcc cross compiler always tries to use "as" instead of cross assembler

2021-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102755

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2021-10-14
  Component|c   |driver
 Ever confirmed|0   |1
 Status|UNCONFIRMED |WAITING

--- Comment #1 from Andrew Pinski  ---
This should have been taken care of by this part:
static char*
find_a_program (const char *name)
{
  /* Do not search if default matches query. */

#ifdef DEFAULT_ASSEMBLER
  if (! strcmp (name, "as") && access (DEFAULT_ASSEMBLER, X_OK) == 0)
return xstrdup (DEFAULT_ASSEMBLER);
#endif


So why is it not?