Re: Make LTO Patch for Job Server Thread Detection Agnostic
On 2/27/20 9:44 AM, Jonathan Wakely wrote: Martin, the comment in your patch says "-std=c11" which should be c++11. Sure, thanks for pointing to it. I'm going to install the obvious patch for it. Martin >From 3c633731ade4cdad56f5729eaedb76cb2f727c39 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 2 Mar 2020 11:03:11 +0100 Subject: [PATCH] Fix typo in C++ standard version. gcc/ChangeLog: 2020-03-02 Martin Liska * lto-wrapper.c: Fix typo in comment about C++ standard version. --- gcc/lto-wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c index 6e3f294257e..b8a35c85714 100644 --- a/gcc/lto-wrapper.c +++ b/gcc/lto-wrapper.c @@ -1234,7 +1234,7 @@ init_num_threads (void) #endif } -/* FIXME: once using -std=c11, we can use std::thread::hardware_concurrency. */ +/* FIXME: once using -std=c++11, we can use std::thread::hardware_concurrency. */ /* Return true when a jobserver is running and can accept a job. */ -- 2.25.1
Re: Make LTO Patch for Job Server Thread Detection Agnostic
On Fri, 2020-02-28 at 17:37 +0100, Martin Jambor wrote: > > Recently Honza, me and others discussed LTO's interaction with > > build systems, and that perhaps the module mapper could be > > generalized for other purposes. (Yes, still need to resurrect my > > Make PoC) > > see also the "Create a general jobserver client/server library" > library suggested GSoC project at > https://gcc.gnu.org/wiki/SummerOfCode. If you get someone to work on that please touch base with bug-m...@gnu.org (or talk to me directly, at psm...@gnu.org) as it would be great if the implementation could be used in GNU make itself, as well. One caveat: GNU make still requires C90. Cheers!
Re: Make LTO Patch for Job Server Thread Detection Agnostic
Hi, On Fri, Feb 28 2020, Nathan Sidwell wrote: > On 2/27/20 12:04 PM, Paul Smith wrote: >> On Thu, 2020-02-27 at 16:58 +, Jonathan Wakely wrote: That's a problem then as were assuming a user's build system for this to work. I mean for now its fine but in the future wouldn't it de a good ideal to not assume this? >>> >>> It works fine for everybody. There's just an optimisation for people >>> with a GNU make jobserver available. I don't see a problem. >>> >>> If somebody wants to add an optimisation for their preferred build >>> system they can propose a patch. >> >> And/or they can suggest to other build systems that they also add support >> for this service. >> >> I'm not aware of any service like this which is supported by all build >> tools, so it's not like we're choosing this over something else that's more >> widely available. Actually as far as I know other build tools don't >> provide anything like it, portable or not. > > Recently Honza, me and others discussed LTO's interaction with build > systems, and that perhaps the module mapper could be generalized for > other purposes. (Yes, still need to resurrect my Make PoC) see also the "Create a general jobserver client/server library" library suggested GSoC project at https://gcc.gnu.org/wiki/SummerOfCode. Martin
Re: Make LTO Patch for Job Server Thread Detection Agnostic
On 2/27/20 12:04 PM, Paul Smith wrote: On Thu, 2020-02-27 at 16:58 +, Jonathan Wakely wrote: That's a problem then as were assuming a user's build system for this to work. I mean for now its fine but in the future wouldn't it de a good ideal to not assume this? It works fine for everybody. There's just an optimisation for people with a GNU make jobserver available. I don't see a problem. If somebody wants to add an optimisation for their preferred build system they can propose a patch. And/or they can suggest to other build systems that they also add support for this service. I'm not aware of any service like this which is supported by all build tools, so it's not like we're choosing this over something else that's more widely available. Actually as far as I know other build tools don't provide anything like it, portable or not. Recently Honza, me and others discussed LTO's interaction with build systems, and that perhaps the module mapper could be generalized for other purposes. (Yes, still need to resurrect my Make PoC) nathan -- Nathan Sidwell
Re: Make LTO Patch for Job Server Thread Detection Agnostic
On Thu, 2020-02-27 at 16:58 +, Jonathan Wakely wrote: > > That's a problem then as were assuming a user's build system for this > > to work. I mean for now its fine but in the future wouldn't it de a > > good ideal to not assume this? > > It works fine for everybody. There's just an optimisation for people > with a GNU make jobserver available. I don't see a problem. > > If somebody wants to add an optimisation for their preferred build > system they can propose a patch. And/or they can suggest to other build systems that they also add support for this service. I'm not aware of any service like this which is supported by all build tools, so it's not like we're choosing this over something else that's more widely available. Actually as far as I know other build tools don't provide anything like it, portable or not.
Re: Make LTO Patch for Job Server Thread Detection Agnostic
On Thu, 27 Feb 2020 at 16:18, Nicholas Krause wrote: > > > > On 2/27/20 3:44 AM, Jonathan Wakely wrote: > > On Thu, 27 Feb 2020 at 06:50, Nicholas Krause wrote: > >> Greetings Martin, > >> > >> This patch: > >> https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/lto-wrapper.c;h=353187c60434f43a445e708dcfbf53c857f8cdc1;hp=946897726d03716f7c93f955c438ee4f8190044c;hb=f12fbeb535f192f742025cc4f9b69a48136730f1;hpb=80c7cb9d2c8090f8d165ee2ca5f8d401090c1d06 > >> > >> May have a small problem with the lines: > >> + const char *makeflags = getenv ("MAKEFLAGS"); > >> + if (makeflags == NULL) > >> +return false; I'm not sure if ninja or other build systems use that > >> for detection or have it as a variable you can use. This may be an issue > >> with ninja, cmake and other build systems that may not have it. Maybe > >> I'm wrong but it may be good to check that, Nick > > The patch is to use Make's jobserver, it's not expected to work with > > arbitrary build systems. > > > > Martin, the comment in your patch says "-std=c11" which should be c++11. > > Jonathan, > > That's a problem then as were assuming a user's build system for this to > work. I mean > for now its fine but in the future wouldn't it de a good ideal to not > assume this? It works fine for everybody. There's just an optimisation for people with a GNU make jobserver available. I don't see a problem. If somebody wants to add an optimisation for their preferred build system they can propose a patch.
Re: Make LTO Patch for Job Server Thread Detection Agnostic
On 2/27/20 3:44 AM, Jonathan Wakely wrote: On Thu, 27 Feb 2020 at 06:50, Nicholas Krause wrote: Greetings Martin, This patch: https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/lto-wrapper.c;h=353187c60434f43a445e708dcfbf53c857f8cdc1;hp=946897726d03716f7c93f955c438ee4f8190044c;hb=f12fbeb535f192f742025cc4f9b69a48136730f1;hpb=80c7cb9d2c8090f8d165ee2ca5f8d401090c1d06 May have a small problem with the lines: + const char *makeflags = getenv ("MAKEFLAGS"); + if (makeflags == NULL) +return false; I'm not sure if ninja or other build systems use that for detection or have it as a variable you can use. This may be an issue with ninja, cmake and other build systems that may not have it. Maybe I'm wrong but it may be good to check that, Nick The patch is to use Make's jobserver, it's not expected to work with arbitrary build systems. Martin, the comment in your patch says "-std=c11" which should be c++11. Jonathan, That's a problem then as were assuming a user's build system for this to work. I mean for now its fine but in the future wouldn't it de a good ideal to not assume this? Nick
Re: Make LTO Patch for Job Server Thread Detection Agnostic
On Thu, 27 Feb 2020 at 06:50, Nicholas Krause wrote: > > Greetings Martin, > > This patch: > https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/lto-wrapper.c;h=353187c60434f43a445e708dcfbf53c857f8cdc1;hp=946897726d03716f7c93f955c438ee4f8190044c;hb=f12fbeb535f192f742025cc4f9b69a48136730f1;hpb=80c7cb9d2c8090f8d165ee2ca5f8d401090c1d06 > > May have a small problem with the lines: > + const char *makeflags = getenv ("MAKEFLAGS"); > + if (makeflags == NULL) > +return false; I'm not sure if ninja or other build systems use that > for detection or have it as a variable you can use. This may be an issue > with ninja, cmake and other build systems that may not have it. Maybe > I'm wrong but it may be good to check that, Nick The patch is to use Make's jobserver, it's not expected to work with arbitrary build systems. Martin, the comment in your patch says "-std=c11" which should be c++11.
Make LTO Patch for Job Server Thread Detection Agnostic
Greetings Martin, This patch: https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/lto-wrapper.c;h=353187c60434f43a445e708dcfbf53c857f8cdc1;hp=946897726d03716f7c93f955c438ee4f8190044c;hb=f12fbeb535f192f742025cc4f9b69a48136730f1;hpb=80c7cb9d2c8090f8d165ee2ca5f8d401090c1d06 May have a small problem with the lines: + const char *makeflags = getenv ("MAKEFLAGS"); + if (makeflags == NULL) +return false; I'm not sure if ninja or other build systems use that for detection or have it as a variable you can use. This may be an issue with ninja, cmake and other build systems that may not have it. Maybe I'm wrong but it may be good to check that, Nick