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

            Bug ID: 124212
           Summary: jobserver token isn't preserved
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

gcc's jobserver_info in gcc/opts-jobserver.h doesn't record the token received.

In gcc/opts-common.cc:
```
void
jobserver_info::return_token ()
{
  int fd = pipe_path.empty () ? wfd : pipefd;
  char c = 'G';
  int res = write (fd, &c, 1);
  gcc_assert (res == 1);
}
```

Per https://www.gnu.org/software/make/manual/html_node/POSIX-Jobserver.html,
clients should return the exact token they received, not uniformly 'G':

"""
It’s important that when you release the job slot, you write back the same
character you read. Don’t assume that all tokens are the same character;
different characters may have different meanings to GNU make. The order is not
important, since make has no idea in what order jobs will complete anyway. 
"""

Reply via email to