Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame] | 1 | From a4a472c19eaaf03cc0e70797b2d24b540d6424e1 Mon Sep 17 00:00:00 2001 |
| 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Wed, 3 Jun 2020 13:39:18 +0800 |
| 4 | Subject: [PATCH] Makefile.am: fixup issue #17 |
| 5 | |
| 6 | only make $(LIBOBJS) depend on $(LTLIBOBJS) still have race condition, |
| 7 | library like pidfile.o may be changed when compile or link for |
| 8 | libsyslog_la_LIBADD, which will cause problem like below: |
| 9 | |
| 10 | ERROR: dwarfsrcfiles failed with exit code 1 (cmd was ['dwarfsrcfiles', /tmp/work/ppc7400-oe-linux/sysklogd/2.1.2-r0/package/usr/lib/libsyslog.a']): |
| 11 | dwarfsrcfiles: tmp/work/ppc7400-oe-linux/sysklogd/2.1.2-r0/package/usr/lib/libsyslog.a: not a valid ELF file |
| 12 | |
| 13 | arm-oe-linux-gnueabi-libtool: link: arm-oe-linux-gnueabi-gcc -march=armv7ve -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=TOPDIR/tmp-glibc/work/armv7vet2hf-neon-oe-linux-gnueabi/sysklogd/2.1.2-r0/recipe-sysroot -shared -fPIC -DPIC .libs/libsyslog_la-syslog.o ../lib/.libs/pidfile.o ../lib/.libs/strlcpy.o ../lib/.libs/strlcat.o -march=armv7ve -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=TOPDIR/tmp-glibc/work/armv7vet2hf-neon-oe-linux-gnueabi/sysklogd/2.1.2-r0/recipe-sysroot -O2 -g -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-soname -Wl,libsyslog.so.0 -o .libs/libsyslog.so.0.0.0 |
| 14 | arm-oe-linux-gnueabi-libtool: link: (cd ".libs" && rm -f "libsyslog.so.0" && ln -s "libsyslog.so.0.0.0" "libsyslog.so.0") |
| 15 | arm-oe-linux-gnueabi-libtool: link: (cd ".libs" && rm -f "libsyslog.so" && ln -s "libsyslog.so.0.0.0" "libsyslog.so") |
| 16 | arm-oe-linux-gnueabi-libtool: link: arm-oe-linux-gnueabi-gcc-ar cru .libs/libsyslog.a libsyslog_la-syslog.o ../lib/pidfile.o ../lib/strlcpy.o ../lib/strlcat.o |
| 17 | TOPDIR/tmp-glibc/work/armv7vet2hf-neon-oe-linux-gnueabi/sysklogd/2.1.2-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/10.1.0/ar: `u' modifier ignored since `D' is the default (see `U') |
| 18 | TOPDIR/tmp-glibc/work/armv7vet2hf-neon-oe-linux-gnueabi/sysklogd/2.1.2-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/../../libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/10.1.0/ar: ../lib/strlcat.o: No such file or directory |
| 19 | |
| 20 | Upstream-Status: Submitted [https://github.com/troglobit/sysklogd/pull/23/commits/e684939559341cb1c6373dfc6469b59e580d80af] |
| 21 | |
| 22 | Signed-off-by: Changqing Li <changqing.li@windriver.com> |
| 23 | --- |
| 24 | src/Makefile.am | 7 ++++--- |
| 25 | 1 file changed, 4 insertions(+), 3 deletions(-) |
| 26 | |
| 27 | diff --git a/src/Makefile.am b/src/Makefile.am |
| 28 | index f8a6820..f45c773 100644 |
| 29 | --- a/src/Makefile.am |
| 30 | +++ b/src/Makefile.am |
| 31 | @@ -66,6 +66,7 @@ libsyslog_la_LIBADD = $(LTLIBOBJS) |
| 32 | # ld: syslogd-syslogd.o: in function `main': syslogd.c:417: undefined |
| 33 | # reference to `__pidfile' |
| 34 | # |
| 35 | -# Work around the problem by building one .o from lib at a time, this |
| 36 | -# can be achieved by making LIBOBJS depend on LTLIBOBJS. |
| 37 | -$(LIBOBJS): $(LTLIBOBJS) |
| 38 | +# Work around the problem by make LIBOBJS depend on libsyslog.la, |
| 39 | +# so that LIBOBJS/syslogd/logger will start compile after libsyslog.la |
| 40 | +# is completed |
| 41 | +$(LIBOBJS): $(lib_LTLIBRARIES) |
| 42 | -- |
| 43 | 2.17.1 |