Re: Makefile race between jobs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux