summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2020-01-17 15:09:04 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-19 13:24:38 +0000
commit0aa056945bf44f67976688207920f1da59ae0324 (patch)
treeda03a37d869331c5b3e5754d77b5057941b38cdf
parent8027ee1f210bd500728319c3a509a73ed80261f8 (diff)
downloadpoky-0aa056945bf44f67976688207920f1da59ae0324.tar.gz
sysklogd: fix parallel build problem
Parallel compile maybe failed with error: error: ../lib/strlcat.o: No such file or directory Makefile:619: recipe for target 'syslogd' failed remove previous patch, and backport lastest fix for this problem (From OE-Core rev: 6e5be1d240621c5ce2adf4e629bd6b240cefc0e3) Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/sysklogd/files/0001-Drop-libcompat-to-simplify-build-deps-and-really-fix.patch127
-rw-r--r--meta/recipes-extended/sysklogd/files/0001-Fix-nasty-parallel-build-problem-reported-by-Gentoo-.patch47
-rw-r--r--meta/recipes-extended/sysklogd/sysklogd.inc2
3 files changed, 128 insertions, 48 deletions
diff --git a/meta/recipes-extended/sysklogd/files/0001-Drop-libcompat-to-simplify-build-deps-and-really-fix.patch b/meta/recipes-extended/sysklogd/files/0001-Drop-libcompat-to-simplify-build-deps-and-really-fix.patch
new file mode 100644
index 0000000000..9ba7ecc2b0
--- /dev/null
+++ b/meta/recipes-extended/sysklogd/files/0001-Drop-libcompat-to-simplify-build-deps-and-really-fix.patch
@@ -0,0 +1,127 @@
1From 84d70e63fc105e3713943ed8c0bdd4e31a698226 Mon Sep 17
200:00:00 2001 From: Joachim Nilsson <troglobit@gmail.com> Date: Thu, 16 Jan
32020 22:16:51 +0100 Subject: [PATCH] Drop libcompat to simplify build deps
4and really fix
5
6The original idea with libcompat was to keep as few objects as
7possible for linking with libsyslog. That in turn to prevent
8a user of libsyslog from suddenly also getting strong binding
9to symbols like strlcpy() from libsyslog, rather than their C
10library of choice.
11
12However, this caused strlcpy.c to be built as both .o and .lo
13files, which in turn caused really bizarre build problems due
14to bad DAG dependency.
15
16This patch drops libcompat and instead marks all replacement APIs
17as weak symbols, which a C library can override.
18
19Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
20
21Upstream-Status: Backport
22[https://github.com/troglobit/sysklogd/commit/84d70e63fc105e3713943ed8c0bdd4e31a698226]
23
24Signed-off-by: Changqing Li <changqing.li@windriver.com>
25---
26 lib/pidfile.c | 8 +++++++-
27 lib/utimensat.c | 10 ++++++++--
28 src/Makefile.am | 7 +------
29 3 files changed, 16 insertions(+), 9 deletions(-)
30
31diff --git a/lib/pidfile.c b/lib/pidfile.c
32index 81f2315..25b1c04 100644
33--- a/lib/pidfile.c
34+++ b/lib/pidfile.c
35@@ -31,6 +31,9 @@
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39+#include <config.h>
40+#ifndef HAVE_PIDFILE
41+
42 #define _GNU_SOURCE /* Needed with GLIBC to get asprintf() */
43 #include <sys/stat.h> /* utimensat() */
44 #include <sys/time.h> /* utimensat() on *BSD */
45@@ -54,7 +57,7 @@ const char *__pidfile_path = RUNSTATEDIR;
46 const char *__pidfile_name = NULL;
47
48 int
49-pidfile(const char *basename)
50+__pidfile(const char *basename)
51 {
52 int save_errno;
53 int atexit_already;
54@@ -127,6 +130,9 @@ pidfile(const char *basename)
55 return (0);
56 }
57
58+weak_alias(__pidfile, pidfile);
59+#endif /* HAVE_PIDFILE */
60+
61 static void
62 pidfile_cleanup(void)
63 {
64diff --git a/lib/utimensat.c b/lib/utimensat.c
65index edf7e10..b68ce0e 100644
66--- a/lib/utimensat.c
67+++ b/lib/utimensat.c
68@@ -15,7 +15,8 @@
69 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
70 */
71
72-#include "config.h"
73+#include <config.h>
74+#ifndef HAVE_UTIMENSAT
75
76 #include <errno.h>
77 #ifdef HAVE_FCNTL_H
78@@ -23,7 +24,8 @@
79 #endif
80 #include <sys/time.h> /* lutimes(), utimes(), utimensat() */
81
82-int utimensat(int dirfd, const char *pathname, const struct timespec ts[2], int flags)
83+int
84+__utimensat(int dirfd, const char *pathname, const struct timespec ts[2], int flags)
85 {
86 int ret = -1;
87 struct timeval tv[2];
88@@ -45,3 +47,7 @@ int utimensat(int dirfd, const char *pathname, const struct timespec ts[2], int
89
90 return ret;
91 }
92+
93+weak_alias(__utimensat, utimensat);
94+
95+#endif /* HAVE_UTIMENSAT */
96diff --git a/src/Makefile.am b/src/Makefile.am
97index 6e2a51c..1db88d3 100644
98--- a/src/Makefile.am
99+++ b/src/Makefile.am
100@@ -19,7 +19,6 @@
101 bin_PROGRAMS =
102 sbin_PROGRAMS = syslogd
103 lib_LTLIBRARIES = libsyslog.la
104-noinst_LTLIBRARIES = libcompat.la
105
106 if ENABLE_KLOGD
107 sbin_PROGRAMS += klogd
108@@ -48,10 +47,6 @@ logger_CPPFLAGS = $(AM_CPPFLAGS) -D_XOPEN_SOURCE=600
109 logger_LDADD = $(LIBS) $(LIBOBJS)
110 logger_LDADD += libsyslog.la
111
112-# Convenience library for libsyslog instead of linking with $(LTLIBOBJS),
113-# which would pull in pidfile() and other (strong) symbols as well.
114-libcompat_la_SOURCES = ../lib/strlcpy.c ../lib/strlcat.c
115-
116 pkgconfigdir = $(libdir)/pkgconfig
117 pkgincludedir = $(includedir)/syslog
118 pkgconfig_DATA = libsyslog.pc
119@@ -59,4 +54,4 @@ pkginclude_HEADERS = syslog.h
120 libsyslog_la_SOURCES = syslog.c syslog.h compat.h
121 libsyslog_la_CPPFLAGS = $(AM_CPPFLAGS) -D_XOPEN_SOURCE=600
122 libsyslog_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0
123-libsyslog_la_LIBADD = libcompat.la
124+libsyslog_la_LIBADD = $(LTLIBOJBS)
125--
1262.7.4
127
diff --git a/meta/recipes-extended/sysklogd/files/0001-Fix-nasty-parallel-build-problem-reported-by-Gentoo-.patch b/meta/recipes-extended/sysklogd/files/0001-Fix-nasty-parallel-build-problem-reported-by-Gentoo-.patch
deleted file mode 100644
index bf43fc6081..0000000000
--- a/meta/recipes-extended/sysklogd/files/0001-Fix-nasty-parallel-build-problem-reported-by-Gentoo-.patch
+++ /dev/null
@@ -1,47 +0,0 @@
1From 50c66de8a9b64d6fa71329ea7d4fe981f3b4ef23 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 26 Dec 2019 10:03:35 +0800
4Subject: [PATCH] Fix nasty parallel build problem reported by Gentoo and
5 Westermo
6
7Independently of each other both the Gentoo project and Westermo found
8an issue with massively parallel builds on monster-core-machines. At
9Westermo there are 40 core Xeon monsters that stumble when building
10sysklogd.
11
12The Gentoo bug report is here:
13
14 https://bugs.gentoo.org/701894
15
16The problem stems from strlcat.c and strlcpy.c being used for both
17the libcompat convenience library built for libsyslog and als for
18syslogd when the system does not have either of the APIs in libc,
19i.e. most Linux systems with GLIBC or musl libc.
20
21I can either rewrite the Makefile.am files to handle dependencies
22better, or we just disable parallel build like this patch. There's
23too few source files to gain anything from parallel build anyway.
24
25Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
26
27Upstream-Status: Backport [https://github.com/troglobit/sysklogd/commit/9cf1f97cef04fed81c2407f7207795d7592ccb96]
28
29Signed-off-by: Changqing Li <changqing.li@windriver.com>
30---
31 Makefile.am | 3 +++
32 1 file changed, 3 insertions(+)
33
34diff --git a/Makefile.am b/Makefile.am
35index c4cc80f..d7a7dd5 100644
36--- a/Makefile.am
37+++ b/Makefile.am
38@@ -46,3 +46,6 @@ release: distcheck
39 # Workaround for systemd unit file duing distcheck
40 DISTCHECK_CONFIGURE_FLAGS = --with-systemd=$$dc_install_base/$(systemd) --with-klogd
41
42+# Disable parallel build in top Makefile, we might otherwise get a very
43+# # bizarre build problem with strlcpy.o in libcompat and for syslogd.
44+.NOTPARALLEL:
45--
462.7.4
47
diff --git a/meta/recipes-extended/sysklogd/sysklogd.inc b/meta/recipes-extended/sysklogd/sysklogd.inc
index 774d23bfd2..8618c9ffec 100644
--- a/meta/recipes-extended/sysklogd/sysklogd.inc
+++ b/meta/recipes-extended/sysklogd/sysklogd.inc
@@ -16,7 +16,7 @@ inherit update-rc.d update-alternatives systemd autotools
16SRC_URI = "git://github.com/troglobit/sysklogd.git;nobranch=1 \ 16SRC_URI = "git://github.com/troglobit/sysklogd.git;nobranch=1 \
17 file://0001-Remove-__BEGIN_DECLS-__END_DECLS.patch \ 17 file://0001-Remove-__BEGIN_DECLS-__END_DECLS.patch \
18 file://0002-include-sys-types.h-for-off_t.patch \ 18 file://0002-include-sys-types.h-for-off_t.patch \
19 file://0001-Fix-nasty-parallel-build-problem-reported-by-Gentoo-.patch \ 19 file://0001-Drop-libcompat-to-simplify-build-deps-and-really-fix.patch \
20 file://sysklogd \ 20 file://sysklogd \
21 " 21 "
22S = "${WORKDIR}/git" 22S = "${WORKDIR}/git"