[Buildroot] [PATCH v2 1/1] package/syslog-ng: add -fPIC to build flags

Ankur Tyagi Ankur.Tyagi at gallagher.com
Wed Sep 29 09:59:10 UTC 2021


Otherwise build fails with following error:

/tools/aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/8.3.0/../../../../aarch64-linux-gnu/bin/ld: lib/logthrdest/.libs/lib_libsyslog_ng_la-logthrdestdrv.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `log_threaded_dest_driver_start_workers' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/user/work/buildroot/output/build/syslog-ng-3.33.1/lib/logthrdest/logthrdestdrv.c:1151:(.text+0x1980): dangerous relocation: unsupported relocation
collect2: error: ld returned 1 exit status
Makefile:10601: recipe for target 'lib/libsyslog-ng.la' failed
make[4]: *** [lib/libsyslog-ng.la] Error 1

Signed-off-by: Ankur Tyagi <ankur.tyagi at gallagher.com>
---
Changes v1 -> v2:
- Shortened error log
- Always include -fPIC flag instead of conditional inclusion

 package/syslog-ng/syslog-ng.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/syslog-ng/syslog-ng.mk b/package/syslog-ng/syslog-ng.mk
index 765e886b12..6994adbc17 100644
--- a/package/syslog-ng/syslog-ng.mk
+++ b/package/syslog-ng/syslog-ng.mk
@@ -106,6 +106,8 @@ else
 SYSLOG_NG_CONF_OPTS += --disable-afsnmp
 endif

+SYSLOG_NG_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -fPIC"
+
 define SYSLOG_NG_INSTALL_INIT_SYSV
        $(INSTALL) -m 0755 -D package/syslog-ng/S01syslog-ng \
                $(TARGET_DIR)/etc/init.d/S01syslog-ng
--
2.25.1

________________________________
 This email is confidential and may contain information subject to legal privilege. If you are not the intended recipient please advise us of our error by return e-mail then delete this email and any attached files. You may not copy, disclose or use the contents in any way. The views expressed in this email may not be those of Gallagher Group Ltd or subsidiary companies thereof.
________________________________


More information about the buildroot mailing list