From owner-freebsd-stable Wed Dec 20 0:36:42 2000 From owner-freebsd-stable@FreeBSD.ORG Wed Dec 20 00:36:38 2000 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from jason.argos.org (a13b063.neo.rr.com [204.210.197.63]) by hub.freebsd.org (Postfix) with ESMTP id 050A737B402 for ; Wed, 20 Dec 2000 00:36:38 -0800 (PST) Received: from localhost (mike@localhost) by jason.argos.org (8.10.1/8.10.1) with ESMTP id eBK8URx00823; Wed, 20 Dec 2000 03:30:27 -0500 Date: Wed, 20 Dec 2000 03:30:27 -0500 (EST) From: Mike Nowlin To: Alessandro de Manzano Cc: Alfred Perlstein , stable@FreeBSD.ORG Subject: Re: make -j In-Reply-To: <20001219122433.A1961@libero.sunshine.ale> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Could someone, please, explain to me why the "-j" stuff could be dangerous ? > It's not much clear to me why doing more then one "cc" (example) at time could break the final object code. > (no flame, it's a very honest question! :-) ) As far as I understand it: -jX causes Make to queue up X-1 jobs at a time, while preparing job X while it's waiting for ((X-1)..0) to finish. Imagine a makefile that does something like: 1) start off with "junk.h" that only has "#define SOMEVAL 1" in it 2) job 1 of the makefile runs a perl script that rewrites junk.h 3) job 2 of the makefile is a C prog that includes junk.h and uses SOMEVAL ...now run "make -j3" Assuming that job 2 takes a while to run, and job 3 is really fast, the output of job 2 will be invalid, since job 1 hasn't completed yet, although the output of job 2 is >technically< valid (proper object code was created, although with the wrong "stuff".) Now apply that idea to a bunch of normal .c files. If they're well-behaved and simply compile source into object, life is good. But if they do anything like rewriting other chunks of code, life is not so good. Probably 95% of the packages you'll ever compile aren't prone to this sort of problem, but anything that has a lot of "real" dependencies in it (like the kernel) can fail horribly under these conditions. A lot of programs are coming out these days that pull these sort of tricks to make them compile under multiple different operating systems, and not all of them do it very gracefully..... mike To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message