All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 32/73] sysklogd: untangle header inclusion maze
Date: Sun, 17 Jan 2016 03:36:05 -0800	[thread overview]
Message-ID: <50cb143fdb04b78510ac5f567cc79dafbe8130ab.1453029952.git.raj.khem@gmail.com> (raw)
In-Reply-To: <a11d14dd08dcef1c508ae13079284cfb96629c50.1453029952.git.raj.khem@gmail.com>
In-Reply-To: <cover.1453029952.git.raj.khem@gmail.com>

wait is not union per posix it is int
remove assumption about glibc is linux

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../sysklogd/files/0001-Fix-build-with-musl.patch  | 132 +++++++++++++++++++++
 meta/recipes-extended/sysklogd/sysklogd.inc        |   1 +
 2 files changed, 133 insertions(+)
 create mode 100644 meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch

diff --git a/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch b/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch
new file mode 100644
index 0000000..9567946
--- /dev/null
+++ b/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch
@@ -0,0 +1,132 @@
+From f0af5bcfd753691652eac35efbcb208c933253f1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 05:11:53 +0000
+Subject: [PATCH] Fix build with musl
+
+Explicitly include fcntl.h since with glibc is comes in as indirect
+include but not with musl
+
+linux/time.h inclusion is not required on musl so using !__GLIBC__ is
+not right for musl here
+
+wait type is glibc specific
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ klogd.c    | 10 +---------
+ ksym_mod.c |  5 +----
+ pidfile.c  |  1 +
+ syslog.c   |  3 ++-
+ syslogd.c  |  4 +---
+ 5 files changed, 6 insertions(+), 17 deletions(-)
+
+diff --git a/klogd.c b/klogd.c
+index 6cc80ed..9219671 100644
+--- a/klogd.c
++++ b/klogd.c
+@@ -260,11 +260,8 @@
+ #include <unistd.h>
+ #include <signal.h>
+ #include <errno.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <sys/stat.h>
+-#if !defined(__GLIBC__)
+-#include <linux/time.h>
+-#endif /* __GLIBC__ */
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <stdlib.h>
+@@ -277,13 +274,8 @@
+ 
+ #define __LIBRARY__
+ #include <linux/unistd.h>
+-#if !defined(__GLIBC__)
+-# define __NR_ksyslog __NR_syslog
+-_syscall3(int,ksyslog,int, type, char *, buf, int, len);
+-#else
+ #include <sys/klog.h>
+ #define ksyslog klogctl
+-#endif
+ 
+ #define LOG_BUFFER_SIZE 4096
+ #define LOG_LINE_LENGTH 1000
+diff --git a/ksym_mod.c b/ksym_mod.c
+index 68cd6b6..6e26da1 100644
+--- a/ksym_mod.c
++++ b/ksym_mod.c
+@@ -113,12 +113,9 @@
+ #include <unistd.h>
+ #include <signal.h>
+ #include <errno.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <sys/stat.h>
+ #include "module.h"
+-#if !defined(__GLIBC__)
+-#include <linux/time.h>
+-#endif /* __GLIBC__ */
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <linux/version.h>
+diff --git a/pidfile.c b/pidfile.c
+index e0959a0..6daa2e0 100644
+--- a/pidfile.c
++++ b/pidfile.c
+@@ -31,6 +31,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <signal.h>
++#include <fcntl.h>
+ 
+ /* read_pid
+  *
+diff --git a/syslog.c b/syslog.c
+index bdb3ff2..ef7b34e 100644
+--- a/syslog.c
++++ b/syslog.c
+@@ -55,7 +55,7 @@ static char sccsid[] = "@(#)syslog.c	5.28 (Berkeley) 6/27/90";
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/file.h>
+-#include <sys/signal.h>
++//#include <sys/signal.h>
+ #include <sys/syslog.h>
+ #if 0
+ #include "syslog.h"
+@@ -72,6 +72,7 @@ static char sccsid[] = "@(#)syslog.c	5.28 (Berkeley) 6/27/90";
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <stdio.h>
++#include <fcntl.h>
+ 
+ #define	_PATH_LOGNAME	"/dev/log"
+ 
+diff --git a/syslogd.c b/syslogd.c
+index ea73ea5..1ca0595 100644
+--- a/syslogd.c
++++ b/syslogd.c
+@@ -818,9 +818,7 @@ void doexit(int sig);
+ void init();
+ void cfline(char *line, register struct filed *f);
+ int decode(char *name, struct code *codetab);
+-#if defined(__GLIBC__)
+ #define dprintf mydprintf
+-#endif /* __GLIBC__ */
+ static void dprintf(char *, ...);
+ static void allocate_log(void);
+ void sighup_handler();
+@@ -2094,7 +2092,7 @@ void reapchild()
+ 	(void) signal(SIGCHLD, reapchild);	/* reset signal handler -ASP */
+ 	wait ((int *)0);
+ #else
+-	union wait status;
++	int status;
+ 
+ 	while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0)
+ 		;
+-- 
+2.5.1
+
diff --git a/meta/recipes-extended/sysklogd/sysklogd.inc b/meta/recipes-extended/sysklogd/sysklogd.inc
index 85b3cdc..f789c54 100644
--- a/meta/recipes-extended/sysklogd/sysklogd.inc
+++ b/meta/recipes-extended/sysklogd/sysklogd.inc
@@ -15,6 +15,7 @@ inherit update-rc.d update-alternatives
 
 SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar.gz \
            file://no-strip-install.patch \
+           file://0001-Fix-build-with-musl.patch \
            file://sysklogd \
            file://syslog.conf \
            "
-- 
2.7.0



  parent reply	other threads:[~2016-01-17 11:37 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-17 11:36 [PATCH 00/73] musl fixes part 3 & 4 combined Khem Raj
2016-01-17 11:35 ` [PATCH 01/73] powertop: Include right headers for timval struct Khem Raj
2016-01-17 11:35 ` [PATCH 02/73] blktrace: Include <sys/types.h for dev_t Khem Raj
2016-01-17 11:35 ` [PATCH 03/73] ppp: Fix build with musl Khem Raj
2016-01-17 11:35 ` [PATCH 04/73] tcp-wrappers: " Khem Raj
2016-01-17 11:35 ` [PATCH 05/73] fts: Add recipe Khem Raj
2016-01-17 11:35 ` [PATCH 06/73] connman: include config.h for HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR Khem Raj
2016-01-17 11:35 ` [PATCH 07/73] libcgroup: Add dependency on fts when building on musl Khem Raj
2016-01-17 11:35 ` [PATCH 08/73] linux-libc-headers: Port patches for linux-headers for musl Khem Raj
2016-01-17 11:35 ` [PATCH 09/73] xserver-xorg: Fix build with musl Khem Raj
2016-01-17 11:35 ` [PATCH 10/73] gdk-pixbuf: Fix latent build issue exposed by musl Khem Raj
2016-01-17 11:35 ` [PATCH 11/73] argp-standalone: Add recipe Khem Raj
2016-01-17 11:35 ` [PATCH 12/73] gnutls: Link with libargp on musl and depend on argp-standalone Khem Raj
2016-01-17 11:35 ` [PATCH 13/73] util-linux: Fix ptest builds on musl Khem Raj
2016-01-17 11:35 ` [PATCH 14/73] elfutils: Fix build with uclibc/musl Khem Raj
2016-01-22 12:26   ` Burton, Ross
2016-01-22 17:01     ` Khem Raj
2016-01-17 11:35 ` [PATCH 15/73] systemd: Update and fix build with uclibc Khem Raj
2016-01-22 12:34   ` Burton, Ross
2016-01-22 16:29     ` Khem Raj
2016-01-17 11:35 ` [PATCH 16/73] packagegroup-self-hosted.bb: Move glibc-gconv-ibm850 to glibc only case Khem Raj
2016-01-17 11:35 ` [PATCH 17/73] guile: Fix build with uclibc Khem Raj
2016-01-17 11:35 ` [PATCH 18/73] gnutls: Link with libuargp on uclibc Khem Raj
2016-01-17 11:35 ` [PATCH 19/73] mtools: Fix build with uclibc Khem Raj
2016-01-18  7:17   ` Roman Khimov
2016-01-18 21:51     ` Khem Raj
2016-01-19  6:17       ` Roman Khimov
2016-01-19 15:00         ` Khem Raj
2016-01-17 11:35 ` [PATCH 20/73] parted: " Khem Raj
2016-01-17 11:35 ` [PATCH 21/73] net-tools: Link with libintl on uclibc Khem Raj
2016-01-17 11:35 ` [PATCH 22/73] libdrm: Upgrade 2.4.65 -> 2.4.66 Khem Raj
2016-01-18 15:40   ` Burton, Ross
2016-01-18 21:29     ` Khem Raj
2016-01-17 11:35 ` [PATCH 23/73] directfb: Fix build with musl Khem Raj
2016-01-17 11:35 ` [PATCH 24/73] gzip: " Khem Raj
2016-01-17 11:35 ` [PATCH 25/73] watchdog: " Khem Raj
2016-01-17 11:35 ` [PATCH 26/73] xinetd: " Khem Raj
2016-01-17 11:36 ` [PATCH 27/73] dpkg: Add musleabi to known architectures Khem Raj
2016-01-17 11:36 ` [PATCH 28/73] puzzles: Zero'ise structs before use Khem Raj
2016-01-17 11:36 ` [PATCH 29/73] apt: Add support for building for musl targets Khem Raj
2016-01-17 11:36 ` [PATCH 30/73] libunwind: backtrace APIs are glibc specific Khem Raj
2016-01-17 11:36 ` [PATCH 31/73] babeltrace: Add missing header for MAXNAMLEN define Khem Raj
2016-01-17 11:36 ` Khem Raj [this message]
2016-01-17 11:36 ` [PATCH 33/73] console-tools: Include sys/types.h for u_char and u_short defs Khem Raj
2016-01-17 11:36 ` [PATCH 34/73] webkitgtk: Fix build with clang/musl Khem Raj
2016-01-17 11:36 ` [PATCH 35/73] rt-tests: Fix build with non-gcc compilers Khem Raj
2016-01-17 11:36 ` [PATCH 36/73] tar: Fix build for musl based targets Khem Raj
2016-01-17 11:36 ` [PATCH 37/73] pax: Fix build with musl Khem Raj
2016-01-17 11:36 ` [PATCH 38/73] iputils: Use member based initialization for mrghdr struct Khem Raj
2016-01-17 11:36 ` [PATCH 39/73] libuser: Fix build when secure getenv is not there Khem Raj
2016-01-17 11:36 ` [PATCH 40/73] iproute2: Fix build with musl Khem Raj
2016-01-17 11:36 ` [PATCH 41/73] irda-utils: Fix header inclusions Khem Raj
2016-01-17 11:36 ` [PATCH 42/73] nspr: Drop older glibc code Khem Raj
2016-01-17 11:36 ` [PATCH 43/73] chkconfig: Avoid using caddr_t Khem Raj
2016-01-17 11:36 ` [PATCH 44/73] tcf-agent: Implement canonicalize_file_name() for musl as well Khem Raj
2016-01-17 11:36 ` [PATCH 45/73] bsd-headers, musl: Add recipe for bsd missing features Khem Raj
2016-01-17 11:36 ` [PATCH 46/73] nfs-utils: Disable tcp-wrappers for musl Khem Raj
2016-01-17 11:36 ` [PATCH 47/73] portmap: Point to tirpc headers and libraries on musl Khem Raj
2016-01-17 11:36 ` [PATCH 48/73] oprofile: fix build with musl Khem Raj
2016-01-17 11:36 ` [PATCH 49/73] systemd: Skip parsing on musl based targets Khem Raj
2016-01-17 11:36 ` [PATCH 50/73] libsolv: Update to 0.6.17+ Khem Raj
2016-01-17 11:36 ` [PATCH 51/73] db: Use cross libtool Khem Raj
2016-01-22 12:41   ` Burton, Ross
2016-01-22 17:08     ` Khem Raj
2016-01-17 11:36 ` [PATCH 52/73] kexec-tools: Define _GNU_SOURCE for getting loff_t definition Khem Raj
2016-01-17 11:36 ` [PATCH 53/73] pcmciautils: Fix parallel build and include sys/types.h Khem Raj
2016-01-17 11:36 ` [PATCH 54/73] btrfs-tools: Disable backtrace on musl Khem Raj
2016-01-22 12:39   ` Burton, Ross
2016-01-22 16:29     ` Khem Raj
2016-01-17 11:36 ` [PATCH 55/73] apmd: Fix build with musl Khem Raj
2016-01-17 11:36 ` [PATCH 56/73] nss: Undefine HAVE_SYS_CDEFS_H Khem Raj
2016-01-17 11:36 ` [PATCH 57/73] dosfstools: Correct cross-compile CFLAGS and fix build with musl Khem Raj
2016-01-17 11:36 ` [PATCH 58/73] fts: Fix linker hash-style option Khem Raj
2016-01-17 11:36 ` [PATCH 59/73] musl: Create ld.so as a relative symlink Khem Raj
2016-01-17 11:36 ` [PATCH 60/73] bsd-headers: Package cdefs.h Khem Raj
2016-01-17 11:36 ` [PATCH 61/73] guile: Fix build with musl Khem Raj
2016-01-17 11:36 ` [PATCH 62/73] unfs3: Depend on libtirpc when building on musl Khem Raj
2016-01-17 11:36 ` [PATCH 63/73] uclibc: Update to 1.0.11 Khem Raj
2016-01-17 11:36 ` [PATCH 64/73] acpid: Fix build on musl Khem Raj
2016-01-22 12:43   ` Burton, Ross
2016-01-22 16:28     ` Khem Raj
2016-01-17 11:36 ` [PATCH 65/73] grub: Backport fix for largefile detection/use Khem Raj
2016-01-22 12:32   ` Burton, Ross
2016-01-22 16:58     ` Khem Raj
2016-01-17 11:36 ` [PATCH 66/73] console-tools: Fix header inclusion when not using glibc Khem Raj
2016-01-17 11:36 ` [PATCH 67/73] gpgme: Define __error_t_defined on musl Khem Raj
2016-01-17 11:36 ` [PATCH 68/73] mdadm: Fix build with musl Khem Raj
2016-01-17 11:36 ` [PATCH 69/73] eglinfo: Fix build on raspberrypi Khem Raj
2016-01-17 11:36 ` [PATCH 70/73] puzzles: Silence warning on arm with clang Khem Raj
2016-01-17 11:36 ` [PATCH 71/73] binutils: Fix gold linking errors due to unresolved R_ARM_MOVW_ABS_NC Khem Raj
2016-01-17 11:36 ` [PATCH 72/73] syslinux: Set LD to avoid using build host ld Khem Raj
2016-01-17 11:36 ` [PATCH 73/73] glib-2.0: Fix locale location on musl Khem Raj
2016-01-18 21:39 ` [PATCH 00/73] musl fixes part 3 & 4 combined Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50cb143fdb04b78510ac5f567cc79dafbe8130ab.1453029952.git.raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.