Skip to contentSkip to conversation

lib/Makefile: Fix oid_registry build dependency

PATCH In review Tim Gardner 3 participants 3 messages Dec 4, 2012 – Dec 6, 2012 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/Makefile: Fix oid_registry build dependency

It is $(obj)/oid_registry.o that is dependent on $(obj)/oid_registry_data.c. The object file cannot be built until $(obj)/oid_registry_data.c has been generated.

A periodic and hard to reproduce parallel build failure is due to this incorrect lib/Makefile dependency. The compile error is completely disingenuous.

GEN lib/oid_registry_data.c
Compiling 49 OIDs
CC lib/oid_registry.o
gcc: error: lib/oid_registry.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
make[3]: *** [lib/oid_registry.o] Error 4

Cc Andrew Morton <[email protected]>
Cc Akinobu Mita <[email protected]>
Cc Michel Lespinasse <[email protected]>
Cc David Howells <[email protected]>
Cc "David S. Miller" <[email protected]>

---

I've only ever been able to reproduce this build failure on an Ubuntu PPA, and then only infrequently. Restarting the build generally succeeds. I beleive the root of the issue to be an incorrect dependency, though I'm not sure why it doesn't fail more often. Its never failed when run by hand, even on large N-way systems. Commit a77ad6ea0b0bb1f9d1f52ed494bd72a5fdde208e which introduced this change came in with 3.7-rc1, so this patch is not applicable for stable.

 lib/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Makefile +1 -1
index 821a162..a08b791 100644
@@ -163,7 +163,7 @@ $(obj)/crc32table.h: $(obj)/gen_crc32table
 #
 obj-$(CONFIG_OID_REGISTRY) += oid_registry.o
 
-$(obj)/oid_registry.c: $(obj)/oid_registry_data.c
+$(obj)/oid_registry.o: $(obj)/oid_registry_data.c
 
 $(obj)/oid_registry_data.c: $(srctree)/include/linux/oid_registry.h \
 			    $(src)/build_OID_registry
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Tim Gardner

It is $(obj)/oid_registry.o that is dependent on $(obj)/oid_registry_data.c. The object file cannot be built until $(obj)/oid_registry_data.c has been generated.

A periodic and hard to reproduce parallel build failure is due to this incorrect lib/Makefile dependency. The compile error is completely disingenuous.

Good catch. This patch could go via Rusty's module signing tree.

#2 lore raw

[PULL] (Was Re: [PATCH 3.7-rc8] lib/Makefile: Fix oid_registry build dependency)

In reply to Tim Gardner
Quoted 8 lines · Tim Gardner

It is $(obj)/oid_registry.o that is dependent on $(obj)/oid_registry_data.c. The object file cannot be built until $(obj)/oid_registry_data.c has been generated.

A periodic and hard to reproduce parallel build failure is due to this incorrect lib/Makefile dependency. The compile error is completely disingenuous.

Quoted 7 lines

GEN lib/oid_registry_data.c
Compiling 49 OIDs
CC lib/oid_registry.o
gcc: error: lib/oid_registry.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
make[3]: *** [lib/oid_registry.o] Error 4

I can't reproduce it either. It's completely weird; nothing ever removes lib/oid_registry.c, so either gcc is giving the wrong message or it's a weird fs with a very odd race.

But your version is definitely more correct than the previous one, so...

Linus, please pull my 'more-fixes' branch:

git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux.git more-fixes

Thanks,
Rusty.