This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Properly detect working jobserver in gcc driver.
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Martin Liška <mliska at suse dot cz>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Jeff Law <law at redhat dot com>, gcc-patches at gcc dot gnu dot org, Michael Matz <matz at suse dot de>, Richard Biener <richard dot guenther at gmail dot com>
- Date: Fri, 2 Aug 2019 09:44:50 +0200
- Subject: Re: [PATCH] Properly detect working jobserver in gcc driver.
- References: <20190731080809.g2uerujjqvsaut74@kam.mff.cuni.cz> <c773e63b-889a-3f49-2390-aa9996b560c4@suse.cz> <20190731085757.GX15878@tucnak> <20190731091215.f5yjjaevmvhiyma4@kam.mff.cuni.cz> <f7274b96-34fd-7baf-4c3e-84caf60861f9@suse.cz> <fa270dc0-e449-ddef-5712-2dc4dab8b6cb@suse.cz> <20190801131932.GA2726@tucnak> <089f4b9d-a29a-5031-a272-e005cb5ce78c@suse.cz> <20190801144126.GC2726@tucnak> <b974de1b-3618-6b1e-2215-5f42bb341613@suse.cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Aug 02, 2019 at 08:30:47AM +0200, Martin Liška wrote:
> On 8/1/19 4:41 PM, Jakub Jelinek wrote:
> > On Thu, Aug 01, 2019 at 04:34:09PM +0200, Martin Liška wrote:
> >> Ok, after deeper discussion with Honza, I would like to suggest the original
> >> patch that was about proper detection of jobserver.
> >>
> >> Can you please Jakub test the patch in your environment?
> >
> > Isn't this done too late (as in, doesn't the driver at that moment already
> > have some files newly openend, like e.g. the @ option files?
>
> You are right, I've reworked that. Good observation.
I was actually wrong, because while expandargv fopens new file descriptors
when processing the options, it fcloses them too before it returns.
Sorry for that.
Can you strace if other fds are opened and not closed in the spot you had it
before? Advantage of doing it there is that it will not be done for all the
-E/-S/-c compilations when the linker is not spawned.
> >
> >> + = ((sscanf (n, "--jobserver-auth=%d,%d", &rfd, &wfd) == 2)
> >
> > No need to wrap sscanf (...) == 2 into ()s. Also, you've already done
> > a strstr, what is the point in verifying it once again that it starts with
> > --jobserver-auth= string?
> > And in the lto-writer.c code there is no space between sscanf and (.
>
> Yep, I simplified that.
Thanks. Note, your patch from yesterday also passed testing.
Jakub