From patchwork Sat Mar 31 21:57:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 149894 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id CB366B6EEC for ; Sun, 1 Apr 2012 07:58:41 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 680E38C903; Sat, 31 Mar 2012 21:58:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TeDtWBp+9egs; Sat, 31 Mar 2012 21:58:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 15D3D8CA0F; Sat, 31 Mar 2012 21:58:26 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id D5C9F8F753 for ; Sat, 31 Mar 2012 21:58:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CBF868C716 for ; Sat, 31 Mar 2012 21:58:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gYbWNCwB7MHy for ; Sat, 31 Mar 2012 21:58:13 +0000 (UTC) Received: from busybox.osuosl.org (busybox.osuosl.org [140.211.167.224]) by whitealder.osuosl.org (Postfix) with ESMTP id F30D98C4B2 for ; Sat, 31 Mar 2012 21:58:12 +0000 (UTC) Received: by busybox.osuosl.org (Postfix, from userid 4021) id E994E969C6; Sat, 31 Mar 2012 21:58:12 +0000 (UTC) From: Peter Korsgaard To: buildroot@busybox.net Date: Sat, 31 Mar 2012 23:57:35 +0200 X-Git-Refname: refs/heads/master X-Git-Oldrev: f4a5eed474c561557b0c21a05682ed9585c6c60a X-Git-Newrev: 575d4712e1c4305acdba74e1af9277114ce99883 X-Patchwork-Hint: ignore Message-Id: <20120331215812.E994E969C6@busybox.osuosl.org> Subject: [Buildroot] [git commit] systemd: fix build on uClibc X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net commit: http://git.buildroot.net/buildroot/commit/?id=575d4712e1c4305acdba74e1af9277114ce99883 branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master Patch based on similar patch in openembedded. Signed-off-by: Peter Korsgaard --- package/systemd/systemd-uclibc-fix.patch | 40 ++++++++++++++++++++++++++++++ package/systemd/systemd.mk | 3 ++ 2 files changed, 43 insertions(+), 0 deletions(-) diff --git a/package/systemd/systemd-uclibc-fix.patch b/package/systemd/systemd-uclibc-fix.patch new file mode 100644 index 0000000..24c32ab --- /dev/null +++ b/package/systemd/systemd-uclibc-fix.patch @@ -0,0 +1,40 @@ +[PATCH] fix build with uClibc + +Based on OE patch from Khem Raj: + +http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-core/systemd/systemd/paper-over-mkostemp.patch + +But extended to also cover execvpe (OE carries a patch adding execvpe +support to uClibc). + +Signed-off-by: Peter Korsgaard +--- + src/macro.h | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +Index: systemd-37/src/macro.h +=================================================================== +--- systemd-37.orig/src/macro.h ++++ systemd-37/src/macro.h +@@ -27,6 +27,21 @@ + #include + #include + ++#ifdef __UCLIBC__ ++/* uclibc does not implement mkostemp GNU extension */ ++#define mkostemp(x,y) mkstemp(x) ++/* uclibc does not implement execvpe GNU extension */ ++#ifndef _GNU_SOURCE ++#define _GNU_SOURCE ++#endif ++#include ++static inline int execvpe(const char *file, char *const argv[], ++ char *const envp[]) ++{ ++ environ = (char **)envp; ++ return execvp(file, argv); ++} ++#endif + #define _printf_attr_(a,b) __attribute__ ((format (printf, a, b))) + #define _sentinel_ __attribute__ ((sentinel)) + #define _noreturn_ __attribute__((noreturn)) diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk index fc49f3c..eded472 100644 --- a/package/systemd/systemd.mk +++ b/package/systemd/systemd.mk @@ -41,6 +41,9 @@ else SYSTEMD_CONF_OPT += --disable-acl endif +# mq_getattr needs -lrt +SYSTEMD_MAKE_OPT += LIBS=-lrt + define SYSTEMD_INSTALL_INIT_HOOK ln -fs ../bin/systemd $(TARGET_DIR)/sbin/init ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt