bugmake - Bugs: bug #33873, MAKEFLAGS=-jN gets lost on reexec


bug #33873: MAKEFLAGS=-jN gets lost on reexec

Submitted by:  Petr Machata <pmachata>
Submitted on:  Wed 27 Jul 2011 10:48:56 PM UTC  
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  Paul D. Smith <psmith> Open/Closed:  Closed
Component Version:  4.0 Operating System:  None
Fixed Release:  4.0 Triage Status:  Verified

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Sun 18 Sep 2011 11:45:03 PM UTC, comment #2: 

Fixed in CVS.  Thanks!

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Tue 13 Sep 2011 03:12:35 AM UTC, comment #1: 

This looks like the same issue as:

I can confirm the patch provided here also fixes that issue.

Allan McRae <allan>
Wed 27 Jul 2011 10:48:56 PM UTC, original submission:  

With CVS and attached Makefile, I'm getting no parallelism:

$ touch foo.c; MAKEFLAGS="-j4" ~/src/make.pm/make
touch Makefile
thing1 start r
thing1 end
thing2 start r
thing2 end

I tracked the problem down to the commit from 2009-06-09 17:36. The cause seems to be that when make is about to re-exec, it calls define_makeflags.  But at that time, the value of job_slots is 1 due to call to clean_jobserver around make.c:2046, and thus -j from MAKEFLAGS is tossed.

But even if it weren't, there's a special check in define_makeflags that disregards this value.  I thought that that's to prevent launching multiple sub-makes, but that isn't what happens when I comment the code out.  Perhaps it's only relevant when MAKE_JOBSERVER is not defined?  In my patch, I have it ifdefed out in a straightforward manner, but most probably that's not the right thing to do (although no test cases break...).

Petr Machata <pmachata>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #23706:  makeflags.patch added by pmachata (1KiB - text/x-patch)
file #23707:  Makefile added by pmachata (132B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by allan (Posted a comment)
  • -email is unavailable- added by pmachata (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-09-18 psmith StatusNone => Fixed
        Assigned toNone => psmith
        Open/ClosedOpen => Closed
        Fixed ReleaseNone => 4.0
        Triage StatusNone => Verified
    2011-07-27 pmachata Attached File- => Added makeflags.patch, #23706
        Attached File- => Added Makefile, #23707

    Back to the top

    Powered by Savane 3.6