Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-08-01 Thread Jakub Jelinek
On Wed, Jul 31, 2019 at 05:00:37PM +0200, Martin Liška wrote: > On 7/31/19 12:01 PM, Martin Liška wrote: > > Anyway, the auto-detection of jobserver seems very ugly to me :/ > > I tend to remove the support and start working on a proper implementation > > that can be used not only by make build sys

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-31 Thread Martin Liška
On 7/31/19 12:01 PM, Martin Liška wrote: > Anyway, the auto-detection of jobserver seems very ugly to me :/ > I tend to remove the support and start working on a proper implementation > that can be used not only by make build system. Can you Jakub test the attached patch please? Do it reach a ulim

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-31 Thread Jan Hubicka
> diff --git a/gcc/gcc.c b/gcc/gcc.c > index a4323eb146e..e43f46246ad 100644 > --- a/gcc/gcc.c > +++ b/gcc/gcc.c > @@ -8268,6 +8268,44 @@ driver::maybe_run_linker (const char *argv0) const > { >int tmp = execution_count; > > + /* Detect jobserver and drop it if it's not working.

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-31 Thread Martin Liška
On 7/31/19 11:12 AM, Jan Hubicka wrote: >> and see that in some cases jobserver is 0 and in other cases jobserver is 1. >> Examples of both: >> 0 kw -j2 --jobserver-auth=3,6 -- >> total 0 >> lrwx--. 1 jakub jakub 64 Jul 31 10:41 0 -> /dev/pts/4 >> l-wx--. 1 jakub jakub 64 Jul 31 10:41 1 ->

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-31 Thread Jan Hubicka
> On Wed, Jul 31, 2019 at 11:12:15AM +0200, Jan Hubicka wrote: > > > so, if one is lucky enough and at least one of the two file descriptors in > > > MAKEFLAGS --jobserver-auth= is closed, it will work fine, but if they are > > > open, even when they have nothing to do with make, it will fail miser

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-31 Thread Jakub Jelinek
On Wed, Jul 31, 2019 at 11:12:15AM +0200, Jan Hubicka wrote: > > so, if one is lucky enough and at least one of the two file descriptors in > > MAKEFLAGS --jobserver-auth= is closed, it will work fine, but if they are > > open, even when they have nothing to do with make, it will fail miserably. >

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-31 Thread Jan Hubicka
> and see that in some cases jobserver is 0 and in other cases jobserver is 1. > Examples of both: > 0 kw -j2 --jobserver-auth=3,6 -- > total 0 > lrwx--. 1 jakub jakub 64 Jul 31 10:41 0 -> /dev/pts/4 > l-wx--. 1 jakub jakub 64 Jul 31 10:41 1 -> pipe:[75026106] > lr-x--. 1 jakub jakub 6

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-31 Thread Jakub Jelinek
On Wed, Jul 31, 2019 at 10:21:16AM +0200, Martin Liška wrote: > On 7/31/19 10:08 AM, Jan Hubicka wrote: > > Hi, > > > >> We do not detect jobserver because of Dejagnu is not using it. > >> And yes, we default to -flto= in LTO tests now. That's > >> what is causing issues right now. > > > > Why th

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-31 Thread Martin Liška
On 7/31/19 10:08 AM, Jan Hubicka wrote: > Hi, > >> We do not detect jobserver because of Dejagnu is not using it. >> And yes, we default to -flto= in LTO tests now. That's >> what is causing issues right now. > > Why the error messages are > make[4]: *** write jobserver: Bad file descriptor. St

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-31 Thread Jan Hubicka
Hi, > We do not detect jobserver because of Dejagnu is not using it. > And yes, we default to -flto= in LTO tests now. That's > what is causing issues right now. Why the error messages are make[4]: *** write jobserver: Bad file descriptor. Stop. make[4]: *** Waiting for unfinished jobs make

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-31 Thread Jakub Jelinek
On Wed, Jul 31, 2019 at 09:50:47AM +0200, Martin Liška wrote: > > Why doesn't the jobserver work in the tests? Is that because of missing + > > somewhere in the Makefiles or is something unsetting MFLAGS or MAKEFLAGS > > env vars? > > Is Dejagnu using make internally to invoke individual tests?

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-31 Thread Martin Liška
On 7/31/19 9:34 AM, Jakub Jelinek wrote: > On Wed, Jul 31, 2019 at 09:20:40AM +0200, Martin Liška wrote: >> One possible solution will be to adjust lto.exp: >> >>set LTO_OPTIONS [list \ >>{-O0 -flto -flto-partition=none -fuse-linker-plugin} \ >>{-O2 -flto -flto-parti

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-31 Thread Martin Liška
On 7/31/19 9:40 AM, Jan Hubicka wrote: >> Neither will work very well, we have thousands of -flto tests outside of >> lto.exp, e.g. dg-torture.exp (or libgomp and others) cycle through various >> options including -flto etc. >> >> Some env var would be useful I guess, though shouldn't it have GCC i

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-31 Thread Jan Hubicka
> Neither will work very well, we have thousands of -flto tests outside of > lto.exp, e.g. dg-torture.exp (or libgomp and others) cycle through various > options including -flto etc. > > Some env var would be useful I guess, though shouldn't it have GCC in the > name? I mean, if we run into these

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-31 Thread Jakub Jelinek
On Wed, Jul 31, 2019 at 09:20:40AM +0200, Martin Liška wrote: > One possible solution will be to adjust lto.exp: > > set LTO_OPTIONS [list \ > {-O0 -flto -flto-partition=none -fuse-linker-plugin} \ > {-O2 -flto -flto-partition=none -fuse-linker-plugin > -fno-fat-lt

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-31 Thread Martin Liška
On 7/31/19 1:32 AM, Jakub Jelinek wrote: > This broke a lot of tests. Whoops. > The logs show > spawn -ignore SIGHUP /home/jakub/src/gcc/obj31/gcc/xgcc > -B/home/jakub/src/gcc/obj31/gcc/ c_lto_pr83954_0.o c_lto_pr83954_1.o > -fno-diagnostics-show- > caret -fno-diagnostics-show-line-numbers -fdi

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-30 Thread Jakub Jelinek
On Mon, Jul 29, 2019 at 03:35:08PM +0200, Martin Liška wrote: > I'm sending v2 of the patch that can newly auto-detect make > jobserver and use it. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Thanks, > Martin > >From df747a46241dcdb8ad0

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-30 Thread Martin Liška
On 7/29/19 3:35 PM, Martin Liška wrote: > Hi. > > I'm sending v2 of the patch that can newly auto-detect make > jobserver and use it. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Thanks, > Martin > Ok, I've discussed the latest version

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-29 Thread Martin Liška
Hi. I'm sending v2 of the patch that can newly auto-detect make jobserver and use it. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin >From df747a46241dcdb8ad055071f9e0605c9f469268 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue

Re: [PATCH] Deduce automatically number of cores for -flto option.

2019-07-24 Thread Jeff Law
On 7/23/19 4:15 AM, Martin Liška wrote: > On 7/23/19 11:20 AM, Jan Hubicka wrote: >> Hi, >> great you found time to make this. It should become the default for >> -flto IMO. > > Works for me. Then I'm suggesting to not come up with -flto=auto and > only document that -flto passed during linking wi

[PATCH] Deduce automatically number of cores for -flto option.

2019-07-23 Thread Martin Liška
role) Good idea, however, I don't have any experience with make and I'm leaving that to you as a follow up improvement. Martin >From 72489809a50a52f37748fe9ca4e7382ef2faa00c Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 23 Jul 2019 10:14:31 +0200 Subject: [PATCH] Deduce autom