From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Mon, 28 Jan 2008 19:27:10 -0500 Subject: [U-Boot-Users] [PATCH] Use `ln -sf` rather than `rm -f && ln -s` In-Reply-To: <20080128231125.GA27063@sig21.net> References: <1201520254-25593-1-git-send-email-vapier@gentoo.org> <200801280638.59012.vapier@gentoo.org> <20080128231125.GA27063@sig21.net> Message-ID: <200801281927.11045.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Monday 28 January 2008, Johannes Stezenbach 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. right, i know the issue isnt between the link and the compile, it was that the rm/ln was run multiple times. but i never dug deeper into the issue to find the true cause of the problem. > 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. thanks for poking deeper > -$(OBJS): $(obj)include/autoconf.mk > +$(OBJS): depend $(obj)include/autoconf.mk > $(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@)) > > -$(LIBS): $(obj)include/autoconf.mk > +$(LIBS): depend $(obj)include/autoconf.mk > $(MAKE) -C $(dir $(subst $(obj),,$@)) > > -$(SUBDIRS): $(obj)include/autoconf.mk > +$(SUBDIRS): depend $(obj)include/autoconf.mk > $(MAKE) -C $@ all perhaps depend should get its own line ? u-boot $(OBJS) $(LIBS) $(SUBDIRS): depend or not, doesnt matter to me ... as long as it works :) -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 827 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20080128/1687ce1f/attachment.pgp