Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | From dcaa75391ff267c38e776d48c579cdb734b91af3 Mon Sep 17 00:00:00 2001 |
| 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Mon, 23 Mar 2020 15:52:32 +0800 |
| 4 | Subject: [PATCH] fix one rarely reproduced parallel build problem |
| 5 | |
| 6 | fix for this issue: |
| 7 | https://github.com/troglobit/sysklogd/issues/17 |
| 8 | |
| 9 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> |
| 10 | Signed-off-by: Changqing Li <changqing.li@windriver.com> |
| 11 | |
| 12 | Upstream-Status: Backport |
| 13 | [https://github.com/troglobit/sysklogd/commit/b88e21d1770a262f0e5d0f6b84f0abd4a5de55b7] |
| 14 | |
| 15 | Signed-off-by: Changqing Li <changqing.li@windriver.com> |
| 16 | --- |
| 17 | src/Makefile.am | 10 ++++++++++ |
| 18 | 1 file changed, 10 insertions(+) |
| 19 | |
| 20 | diff --git a/src/Makefile.am b/src/Makefile.am |
| 21 | index 993dbfd..06b706d 100644 |
| 22 | --- a/src/Makefile.am |
| 23 | +++ b/src/Makefile.am |
| 24 | @@ -56,3 +56,13 @@ libsyslog_la_SOURCES = syslog.c syslog.h compat.h |
| 25 | libsyslog_la_CPPFLAGS = $(AM_CPPFLAGS) -D_XOPEN_SOURCE=600 |
| 26 | libsyslog_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0 |
| 27 | libsyslog_la_LIBADD = $(LTLIBOBJS) |
| 28 | + |
| 29 | +# Both libsyslog_la and syslogd/logger requires objects like lib/pidfile.o, for |
| 30 | +# libsyslog_la, the objects should be compiled with -fPIC, but for |
| 31 | +# syslogd/logger, it doesn't need -fPIC, so there is a race issue when the two |
| 32 | +# different lib/pidfile.o are compiled at the same time, which would cause errors like: |
| 33 | +# ld: syslogd-syslogd.o: in function `main': |
| 34 | +# syslogd.c:417: undefined reference to `__pidfile' |
| 35 | +# |
| 36 | +# Make LIBOBJS depend on LTLIBOBJS to fix the problem. |
| 37 | +$(LIBOBJS): $(LTLIBOBJS) |
| 38 | -- |
| 39 | 2.7.4 |
| 40 | |