fix one rarely reproduced parallel build problem

fix for this issue:
https://github.com/troglobit/sysklogd/issues/17

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Changqing Li <changqing.li@windriver.com>
This commit is contained in:
Changqing Li 2020-03-20 16:42:40 +08:00
parent b216a6a0bf
commit b88e21d177

View File

@ -56,3 +56,13 @@ libsyslog_la_SOURCES = syslog.c syslog.h compat.h
libsyslog_la_CPPFLAGS = $(AM_CPPFLAGS) -D_XOPEN_SOURCE=600
libsyslog_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0
libsyslog_la_LIBADD = $(LTLIBOBJS)
# Both libsyslog_la and syslogd/logger requires objects like lib/pidfile.o, for
# libsyslog_la, the objects should be compiled with -fPIC, but for
# syslogd/logger, it doesn't need -fPIC, so there is a race issue when the two
# different lib/pidfile.o are compiled at the same time, which would cause errors like:
# ld: syslogd-syslogd.o: in function `main':
# syslogd.c:417: undefined reference to `__pidfile'
#
# Make LIBOBJS depend on LTLIBOBJS to fix the problem.
$(LIBOBJS): $(LTLIBOBJS)