mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
When building libutil in parallel, it can happen that the archive
file is created twice:
$ cd libutil
$ make -j
...
CC libutil/util_rec_example.o
AR libutil/libutil.a
AR libutil/libutil.a
LINK libutil/util_base_example
This can lead to the following build error:
$ make -j OPT_FLAGS="-pipe"
..//libutil/libutil.a(util_path.o): In function `sys_mount_point':
util_path.c:56: undefined reference to `util_proc_mnt_get_entry'
util_path.c:60: undefined reference to `util_proc_mnt_free_entry'
collect2: error: ld returned 1 exit status
../common.mak:232: recipe for target 'util_path_example' failed
The problem is that the following rule from common.mak is triggered in
the libutil directory:
$(rootdir)/libutil/libutil.a: $(rootdir)/libutil
$(MAKE) -C $(rootdir)/libutil/ libutil.a
.PHONY: $(rootdir)/libutil
To prevent this rule, use the local "libutil.a" as dependency for the
example binaries.
Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>