linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: Noam Camus <noamc@ezchip.com>
Cc: "linux-kbuild@vger.kernel.org" <linux-kbuild@vger.kernel.org>
Subject: Re: Makefile race between jobs
Date: Sun, 09 Dec 2012 17:14:43 +0100	[thread overview]
Message-ID: <50C4B8F3.6030704@suse.cz> (raw)
In-Reply-To: <264C179F799EF24AB26D5319053335E80CC3049A10@ezexch.ezchip.com>

On 16.11.2012 14:40, Noam Camus wrote:
> Hello Michael,
> 
> Here is my patch for dealing with race between 2 jobs of primary Makefile:
> 
> From 697f6ffa0d67b676fc2d75f65541c6e12108829d Mon Sep 17 00:00:00 2001
> From: Noam Camus <noamc@ezchip.com>
> Date: Fri, 16 Nov 2012 15:12:48 +0200
> Subject: [PATCH] Makefile: solve race between make jobs.
> 
> Fix occasionally compilation failures when source tree is distcleaned.
> The compilation is failing over file scripts/mod/empty.c
> 
> The error is because empty.o depends on some headers from:
> 	 arch/<arch>/include/generated/asm/
> 
> I see that there is a race between two targets in main Makefile (j=2):
> 	1) asm-generic
> 	2) scripts_basic
> 
> asm-generic:
> 	generates all wrappers in atch/<arch>/include/generated/asm/
> 
> scripts_basic:
> 	calls scripts/Makefile.build
> 	--> performs target __build
> 		--> depends on targets defined at variable $(always)
> 			--> compile scripts/mod/empty.c

Can you explain this dependency? scripts/basic/fixdep.c is supposed to
not depend on _anything_, because the script is subsequently used for
any compilation. And scripts/mod/empty.c is only built when visiting
scripts/mod:

$ arch
x86_64
$ mkdir /dev/shm/_build
$ make O=/dev/shm/_build defconfig
  HOSTCC  scripts/basic/fixdep
...
# At this point, scripts_basic has already been done, but just for sure
$ make O=/dev/shm/_build scripts_basic
  GEN     /dev/shm/_build/Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
# Yet
$ ls /dev/shm/_build/scripts/mod
ls: cannot access /dev/shm/_build/scripts/mod: No such file or directory

If you are seeing something different, please tell which architecture
and which configuration.

Michal

  parent reply	other threads:[~2012-12-09 16:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-16 13:40 Makefile race between jobs Noam Camus
2012-11-17  4:36 ` Noam Camus
2012-11-29 10:59   ` Noam Camus
2012-12-09 16:14 ` Michal Marek [this message]
     [not found]   ` <264C179F799EF24AB26D5319053335E80CC31B9D41@ezexch.ezchip.com>
2012-12-10  9:45     ` Michal Marek
2012-12-10 10:06       ` Noam Camus
2012-12-10 10:11       ` Vineet Gupta
2012-12-10 10:30         ` Michal Marek
2012-12-10 10:36           ` Vineet Gupta
2012-12-10 10:59             ` Arnd Bergmann
2012-12-10 11:23               ` Vineet Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50C4B8F3.6030704@suse.cz \
    --to=mmarek@suse.cz \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=noamc@ezchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).