* [Buildroot] [PATCH 1/1] package/ulogd: fix musl build
@ 2019-03-15 7:34 Fabrice Fontaine
2019-03-15 20:46 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Fontaine @ 2019-03-15 7:34 UTC (permalink / raw)
To: buildroot
Fixes:
- http://autobuild.buildroot.org/results/26fefd491a8a313c12d62c5f522ddfd48decf6c9
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
.../0001-ulogd-fix-build-with-musl-libc.patch | 32 ++++++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 package/ulogd/0001-ulogd-fix-build-with-musl-libc.patch
diff --git a/package/ulogd/0001-ulogd-fix-build-with-musl-libc.patch b/package/ulogd/0001-ulogd-fix-build-with-musl-libc.patch
new file mode 100644
index 0000000000..af6e13648c
--- /dev/null
+++ b/package/ulogd/0001-ulogd-fix-build-with-musl-libc.patch
@@ -0,0 +1,32 @@
+From 675e762091380590f78ff07a94a25caa459b786b Mon Sep 17 00:00:00 2001
+From: Cameron Norman <camerontnorman@gmail.com>
+Date: Sat, 27 Oct 2018 13:05:45 -0700
+Subject: ulogd: fix build with musl libc
+
+The attached patch fixes building ulogd2 with musl libc. It is being
+used on Void Linux right now.
+
+Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1278
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Retrrieved from:
+https://git.netfilter.org/ulogd2/commit/?id=675e762091380590f78ff07a94a25caa459b786b]
+---
+ src/ulogd.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/ulogd.c b/src/ulogd.c
+index b8bc57c..9cd64e8 100644
+--- a/src/ulogd.c
++++ b/src/ulogd.c
+@@ -65,6 +65,7 @@
+ #include <sys/time.h>
+ #include <sys/stat.h>
+ #include <sched.h>
++#include <limits.h>
+ #include <ulogd/conffile.h>
+ #include <ulogd/ulogd.h>
+ #ifdef DEBUG
+--
+cgit v1.2.1
+
--
2.14.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 1/1] package/ulogd: fix musl build
@ 2016-01-24 12:54 Bernd Kuhls
0 siblings, 0 replies; 3+ messages in thread
From: Bernd Kuhls @ 2016-01-24 12:54 UTC (permalink / raw)
To: buildroot
The autobuilders did not catch the error yet because they failed
earlier with other packages, but I am continuing the build based
on the defconfig from:
http://autobuild.buildroot.net/results/6cc/6cc0f8c067e07deea688b9b97284601a596b898c/
Adding -D_GNU_SOURCE to CFLAGS was inspired by
https://gitlab.labs.nic.cz/turris/turris-os-packages/commit/cd3f916b4c6b1929621c568a81db82f2936da1d4
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
package/ulogd/0001-musl-compat.patch | 65 ++++++++++++++++++++++++++++++++++++
package/ulogd/ulogd.mk | 2 ++
2 files changed, 67 insertions(+)
create mode 100644 package/ulogd/0001-musl-compat.patch
diff --git a/package/ulogd/0001-musl-compat.patch b/package/ulogd/0001-musl-compat.patch
new file mode 100644
index 0000000..a656812
--- /dev/null
+++ b/package/ulogd/0001-musl-compat.patch
@@ -0,0 +1,65 @@
+Fix musl build
+
+Downloaded from
+https://github.com/openwrt/packages/blob/master/net/ulogd/patches/100-musl-compat.patch
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+
+
+--- a/src/ulogd.c
++++ b/src/ulogd.c
+@@ -83,7 +83,7 @@ static char *ulogd_logfile = NULL;
+ static const char *ulogd_configfile = ULOGD_CONFIGFILE;
+ static const char *ulogd_pidfile = NULL;
+ static int ulogd_pidfile_fd = -1;
+-static FILE syslog_dummy;
++static int ulogd_use_syslog = 0;
+
+ static int info_mode = 0;
+
+@@ -427,7 +427,7 @@ void __ulogd_log(int level, char *file,
+ if (level < loglevel_ce.u.value)
+ return;
+
+- if (logfile == &syslog_dummy) {
++ if (ulogd_use_syslog) {
+ /* FIXME: this omits the 'file' string */
+ va_start(ap, format);
+ vsyslog(ulogd2syslog_level(level), format, ap);
+@@ -950,7 +950,7 @@ static int logfile_open(const char *name
+ logfile = stdout;
+ } else if (!strcmp(name, "syslog")) {
+ openlog("ulogd", LOG_PID, LOG_DAEMON);
+- logfile = &syslog_dummy;
++ ulogd_use_syslog = 1;
+ } else {
+ logfile = fopen(ulogd_logfile, "a");
+ if (!logfile) {
+@@ -1240,7 +1240,7 @@ static void sigterm_handler(int signal)
+ unload_plugins();
+ #endif
+
+- if (logfile != NULL && logfile != stdout && logfile != &syslog_dummy) {
++ if (logfile != NULL && logfile != stdout) {
+ fclose(logfile);
+ logfile = NULL;
+ }
+@@ -1262,7 +1262,7 @@ static void signal_handler(int signal)
+ switch (signal) {
+ case SIGHUP:
+ /* reopen logfile */
+- if (logfile != stdout && logfile != &syslog_dummy) {
++ if (logfile != NULL && logfile != stdout) {
+ fclose(logfile);
+ logfile = fopen(ulogd_logfile, "a");
+ if (!logfile) {
+--- a/filter/raw2packet/ulogd_raw2packet_BASE.c
++++ b/filter/raw2packet/ulogd_raw2packet_BASE.c
+@@ -42,6 +42,7 @@
+ #include <ulogd/ulogd.h>
+ #include <ulogd/ipfix_protocol.h>
+ #include <netinet/if_ether.h>
++#include <linux/types.h>
+ #include <string.h>
+
+ enum input_keys {
diff --git a/package/ulogd/ulogd.mk b/package/ulogd/ulogd.mk
index 7730198..6e7a430 100644
--- a/package/ulogd/ulogd.mk
+++ b/package/ulogd/ulogd.mk
@@ -14,6 +14,8 @@ ULOGD_DEPENDENCIES = host-pkgconf \
ULOGD_LICENSE = GPLv2
ULOGD_LICENSE_FILES = COPYING
+ULOGD_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE"
+
# DB backends need threads
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
ifeq ($(BR2_PACKAGE_MYSQL),y)
--
2.7.0.rc3
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-15 20:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-15 7:34 [Buildroot] [PATCH 1/1] package/ulogd: fix musl build Fabrice Fontaine
2019-03-15 20:46 ` Thomas Petazzoni
-- strict thread matches above, loose matches on Subject: below --
2016-01-24 12:54 Bernd Kuhls
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox