From: Wolfgang Denk Date: Thu, 14 Feb 2008 01:18:48 +0100 Subject: [U-Boot-Users] [PATCH] Use `ln -sf` rather than `rm -f && ln -s` In-Reply-To: Your message of "Tue, 29 Jan 2008 00:11:25 +0100." <20080128231125.GA27063@sig21.net> Message-ID: <20080214001848.6740224050@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message <20080128231125.GA27063@sig21.net> you wrote: > On Mon, Jan 28, 2008 at 06:38:58AM -0500, Mike Frysinger wrote: > > The -f option to `ln` should give the same behavior as the -f option to the > > `rm` command. It is better to do this in one shot so as to avoid race > > conditions when building in parallel. I build on a quad G5 and without this > > change, it isn't uncommon for the build to fail when using -j8 due to this > > small window where the files don't actually exist. > > Since there is a clear dependency of environment.o on environment.c > there is no way for make to run the rm/ln and $(CC) commands > in parallel, so there should be no race condition. > For illustrative purposes: you should be able to put a sleep > between the rm and the ln -s, and it should still build. > > It seems the real problem is one level above, the commands > were run twice in parallel, once for "depend" and once > for the SUBDIRS "all". Please test the patch below. > > The > > $(obj)u-boot: depend $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT) > > line tells make it can run commands to update each dependency > in parallel, unless there are further dependencies which restrict this. Applied, thanks. > > Thanks, > Johannes > > --- > Add dependencies to avoid race conditions with parallel make. > > Signed-off-by: Johannes Stezenbach Note that these 3 lines belong *above* the "---" line. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de There are three ways to get something done: do it yourself, hire someone, or forbid your kids to do it.