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

--- Comment #34 from Greg Chandler <chandleg at wizardsworks dot org> ---
With this set of debugs in gcc.cc:execute

  /* Run each piped subprocess.  */
fprintf (stdout, "Run each piped subprocess\n");
fprintf (stdout, "progname: %s\ntemp_filename: %s\n", progname, temp_filename);
  pex = pex_init (PEX_USE_PIPES | ((report_times || report_times_to_file)
                                   ? PEX_RECORD_TIMES : 0),
                  progname, temp_filename);
fprintf (stdout, "pex: %s\n", pex);
  if (pex == NULL)
    fatal_error (input_location, "%<pex_init%> failed: %m");

  for (i = 0; i < n_commands; i++)
    {
      const char *errmsg;
      int err;
      const char *string = commands[i].argv[0];

/*####HERE####*/
fprintf (stdout, "commands.prog: %s\nstring: %s\n", commands[i].prog, string);
fflush(stdout);

      errmsg = pex_run (pex,
                        ((i + 1 == n_commands ? PEX_LAST : 0)
                         | (string == commands[i].prog ? PEX_SEARCH : 0)),
                        string, CONST_CAST (char **, commands[i].argv),
                        NULL, NULL, &err);
fprintf (stdout, "errmsg: %s\n", errmsg);
fflush(stdout);
fprintf (stdout, "commands[i].prog: %s\n", commands[i].prog);
fflush(stdout);
fprintf (stdout, "PEX_SEARCH: %o\n", PEX_SEARCH);
fflush(stdout);


I get this:

root@bigbang:/tmp# mount /dev/sdc1 /mnt ; /mnt/gcc 1.c ; umount /mnt
Start of execute function
wrapper_string: (null)
Test of find_a_program: (null)
Run each piped subprocess
progname: gcc
temp_filename: /tmp/ccdkrjmN.s
pex: 
commands.prog: cc1
string: cc1
errmsg: posix_spawnp
commands[i].prog: cc1
PEX_SEARCH: 2

gcc: fatal error: cannot execute1 'cc1': posix_spawnp: No such file or
directory
compilation terminated.




I've had a hunch that from these errors it's been a path to cc1 issue for a
bit, so now that I've ruled out about everything else I gave it a try forcing
cc1 at it's full path:

      errmsg = pex_run (pex,
                        ((i + 1 == n_commands ? PEX_LAST : 0)
                         | (string == commands[i].prog ? PEX_SEARCH : 0)),
                        "/usr/libexec/gcc/alpha-linux-gnu/14.3.0/cc1",
CONST_CAST (char **, commands[i].argv),
//                      string, CONST_CAST (char **, commands[i].argv),
                        NULL, NULL, &err);


Which yielded:
root@bigbang:/tmp# mount /dev/sdc1 /mnt ; /mnt/gcc 1.c ; umount /mnt
Start of execute function
wrapper_string: (null)
Test of find_a_program: (null)
Run each piped subprocess
progname: gcc
temp_filename: /tmp/ccHHhSmT.s
pex: 
commands.prog: cc1
string: cc1
errmsg: (null)
commands[i].prog: cc1
PEX_SEARCH: 2
Start of execute function
wrapper_string: (null)
Test of find_a_program: (null)
Run each piped subprocess
progname: gcc
temp_filename: /tmp/cc7PRo8o.o
pex: 
commands.prog: as
string: as
errmsg: (null)
commands[i].prog: as
PEX_SEARCH: 2
/tmp/ccHHhSmT.s:1:9: error: expected identifier or '(' before '.' token
    1 |         .set noreorder
      |         ^
/tmp/ccHHhSmT.s:39:44: error: stray '@' in program
   39 |         .section        .note.GNU-stack,"",@progbits
      |                                            ^



Which we should expect as the assembler call is being made with the compiler.
So tomorrow I will sit down and figure out why cc1 is being called without any
path or path searching.

Reply via email to