Opened 14 years ago

Closed 14 years ago

#284 closed defect (fixed)

Parallel build sometimes fails because generic/adt/list.o does not exist

Reported by: Jakub Jermář Owned by:
Priority: major Milestone: 0.4.3
Component: helenos-build Version:
Keywords: Cc: vojtech.horky@…, zdenek.bouska@…, jakub@…
Blocker for: Depends on:
See also:

Description

This is what I did:

  1. built default ia32 mainline,822
  2. touched uspace/lib/c/generic/devmap.c so that it had newer modification time
  3. make -j 6

And this is what I got:

tools/config.py HelenOS.config default 
Fetching current revision identifier ... ok
tools/autotool.py
Checking for ln ... ok
Checking for rm ... ok
Checking for mkdir ... ok
Checking for cp ... ok
Checking for find ... ok
Checking for diff ... ok
Checking for make ... ok
Checking for makedepend ... ok
Checking for /usr/local/ia32/bin/i686-pc-linux-gnu-gcc ... ok
Checking for /usr/local/ia32/bin/i686-pc-linux-gnu-as ... ok
Checking for /usr/local/ia32/bin/i686-pc-linux-gnu-ld ... ok
Checking for /usr/local/ia32/bin/i686-pc-linux-gnu-ar ... ok
Checking for /usr/local/ia32/bin/i686-pc-linux-gnu-objcopy ... ok
Checking for /usr/local/ia32/bin/i686-pc-linux-gnu-objdump ... ok
Checking for /usr/local/ia32/bin/i686-pc-linux-gnu-strip ... ok
Checking for mkisofs ... ok
Checking compiler properties ... ok
[ -f common.h.prev ] && diff -q common.h.prev common.h && mv -f common.h.prev common.h
cp -a common.h common.h.prev
make -C kernel PRECHECK=
make[1]: Entering directory `/home/jermar/software/HelenOS.mainline/kernel'
[ -f Makefile.depend ] && cp -a Makefile.depend Makefile.depend.prev
make[1]: Leaving directory `/home/jermar/software/HelenOS.mainline/kernel'
make -C uspace PRECHECK=
make[1]: Entering directory `/home/jermar/software/HelenOS.mainline/uspace'
make -C lib/c all PRECHECK=
make[2]: Entering directory `/home/jermar/software/HelenOS.mainline/uspace/lib/c'
/usr/local/ia32/bin/i686-pc-linux-gnu-gcc  -I../../lib/c/include -O3 -imacros ../../../config.h -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32LE -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc -Wall -Wextra -Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes -Werror-implicit-function-declaration -Wwrite-strings -pipe -g -D__LE__ -Werror -march=pentium  -c generic/devmap.c -o generic/devmap.o
/usr/local/ia32/bin/i686-pc-linux-gnu-ar rc libc.a generic/libc.o generic/ddi.o generic/as.o generic/cap.o generic/clipboard.o generic/devmap.o generic/devman.o generic/device/hw_res.o generic/device/char_dev.o generic/event.o generic/errno.o generic/mem.o generic/str.o generic/str_error.o generic/fibril.o generic/fibril_synch.o generic/pcb.o generic/smc.o generic/thread.o generic/tls.o generic/task.o generic/futex.o generic/io/asprintf.o generic/io/io.o generic/io/printf.o generic/io/klog.o generic/io/snprintf.o generic/io/vprintf.o generic/io/vsnprintf.o generic/io/printf_core.o generic/io/console.o generic/io/screenbuffer.o generic/malloc.o generic/sysinfo.o generic/ipc.o generic/async.o generic/async_sess.o generic/loader.o generic/getopt.o generic/adt/list.o generic/adt/hash_table.o generic/adt/dynamic_fifo.o generic/adt/measured_strings.o generic/adt/char_map.o generic/time.o generic/err.o generic/stdlib.o generic/mman.o generic/udebug.o generic/vfs/vfs.o generic/vfs/canonify.o generic/net/inet.o generic/net/icmp_common.o generic/net/icmp_api.o generic/net/modules.o generic/net/packet.o generic/net/socket_client.o generic/net/socket_parse.o generic/stacktrace.o generic/arg_parse.o generic/sort.o generic/stats.o arch/ia32/src/entry.o arch/ia32/src/thread_entry.o arch/ia32/src/syscall.o arch/ia32/src/fibril.o arch/ia32/src/tls.o arch/ia32/src/setjmp.o arch/ia32/src/stacktrace.o arch/ia32/src/stacktrace_asm.o
/usr/local/ia32/bin/i686-pc-linux-gnu-ar: generic/adt/list.o: No such file or directory
make[2]: *** [libc.a] Error 1
make[2]: Leaving directory `/home/jermar/software/HelenOS.mainline/uspace/lib/c'
make[1]: *** [lib/c.build] Error 2
make[1]: Leaving directory `/home/jermar/software/HelenOS.mainline/uspace'
make: *** [all] Error 2

The above steps don't always lead to this bug, but I can reproduce this in quite a short time.

Change History (5)

comment:1 by Vojtech Horky, 14 years ago

Cc: vojtech.horky@… added

First problem is that Makefile for libc sets object file as a source file (both for list.o and hash_table.o).

However, this only shifts the problem elsewhere. The main problem is that make decides that some object files are intermediate and deserve to be deleted once the build is complete. After fix mentioned above, these files are arch/ia32/src/thread_entry.o, arch/ia32/src/entry.o, arch/ia32/src/syscall.o and arch/ia32/src/stacktrace_asm.o. However, these files are not intermediate and AFAIK are nowhere marked as such.

But, that would not be that bad because it would only mean that these files would be rebuild during next run. The trouble is they are not. I guess that we hit the issue reported as bug 26893 in GNU make.

Experimentally, I found out that adding explicit dependency

$(OUTPUT): $(OBJECTS)

to uspace/Makefile.common removes the intermediate file problem. It looks to me as if make has problems with files when they are referenced in if() sections and are using some pattern matching.

Maybe someone more experienced with make and the magic of Makefiles in HelenOS could confirm and explain this in more detail and decide whether this is not actually another bug in make.

comment:2 by Zdenek Bouska, 14 years ago

Cc: zdenek.bouska@… added

comment:3 by Jakub Jermář, 14 years ago

Cc: jakub@… added

comment:4 by Jakub Jermář, 14 years ago

I wonder how and why the adt objects figure in the source list. Was this some wicked intention or a mistake? They are not different from any other libc code, so this is really a mystery to me.

comment:5 by Jakub Jermář, 14 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.