Patchwork minimal-uclibc: systemd fails with `src/manager.c:257:42: error: 'EPOLL_CLOEXEC' undeclared (first use in this function)`

login
register
mail settings
Submitter Paul Menzel
Date May 10, 2011, 9:14 p.m.
Message ID <1305062085.9982.62.camel@mattotaupa>
Download mbox | patch
Permalink /patch/3675/
State New, archived
Headers show

Comments

Phil Blundell - May 11, 2011, 5:11 p.m.
On Tue, 2011-05-10 at 23:14 +0200, Paul Menzel wrote:
> I am no uClibc expert, but do you know if uClibc will provide
> `EPOLL_CLOEXEC` in the near future? How should systemd fix that?

It's not just EPOLL_CLOEXEC: uClibc seems to be missing epoll_create1()
entirely.  As far as I know there's nothing complex about that, though:
it's just a standard syscall wrapper, so I don't know why it would have
been deliberately left out.  I guess you'd have to ask the uClibc h4x0rs
about that.

There probably is no trivial workaround available to systemd.  If you
wanted a quick hack to make it work then you could call
syscall(SYS_epoll_create1, O_CLOEXEC) manually.  Or you could perhaps
eliminate the usage of EPOLL_CLOEXEC in favour of a separate fcntl()
call, but that may not be safe if systemd is multithreaded.

p.
Bernhard Reutner-Fischer - May 11, 2011, 8:25 p.m.
On Wed, May 11, 2011 at 06:11:51PM +0100, Phil Blundell wrote:
>On Tue, 2011-05-10 at 23:14 +0200, Paul Menzel wrote:
>> I am no uClibc expert, but do you know if uClibc will provide
>> `EPOLL_CLOEXEC` in the near future? How should systemd fix that?
>
>It's not just EPOLL_CLOEXEC: uClibc seems to be missing epoll_create1()
>entirely.  As far as I know there's nothing complex about that, though:
>it's just a standard syscall wrapper, so I don't know why it would have
>been deliberately left out.  I guess you'd have to ask the uClibc h4x0rs
>about that.
>
>There probably is no trivial workaround available to systemd.  If you
>wanted a quick hack to make it work then you could call
>syscall(SYS_epoll_create1, O_CLOEXEC) manually.  Or you could perhaps
>eliminate the usage of EPOLL_CLOEXEC in favour of a separate fcntl()
>call, but that may not be safe if systemd is multithreaded.

It was only omitted until now since nobody asked for it.

You should be set if you can trick someone into updating to
c91c3a2b27f5909e190cde4518383864298e82af or later.

Patch

From a135d73cfc7f4c0eb8da344d5bf0d49668ffdbf9 Mon Sep 17 00:00:00 2001
From: Paul Menzel <paulepanter@users.sourceforge.net>
Date: Tue, 10 May 2011 09:19:02 +0200
Subject: [PATCH] systemd: bump srcrev
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

• better uClibc support [1], but still fails in `src/manager.c`
• ?ngström support merged upstream [2]

Still needs native docbook-xsl which is not available in OE.

[1] http://cgit.freedesktop.org/systemd/commit/?id=ec2002f84928c0b5921a961cb2b8637563f29daa
[2] http://cgit.freedesktop.org/systemd/commit/?id=1bd8b8184ee3bc7fc023d6d6dfb2ca99fb6612f3

Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
---

 .../systemd-v26/0003-Angstrom-support.patch        |  165 --------------------
 recipes/systemd/systemd_git.bb                     |    3 +-
 2 files changed, 1 insertions(+), 167 deletions(-)
 delete mode 100644 recipes/systemd/systemd-v26/0003-Angstrom-support.patch

diff --git a/recipes/systemd/systemd-v26/0003-Angstrom-support.patch b/recipes/systemd/systemd-v26/0003-Angstrom-support.patch

deleted file mode 100644
index c75cee4..0000000

--- a/recipes/systemd/systemd-v26/0003-Angstrom-support.patch

+++ /dev/null

@@ -1,165 +0,0 @@ 

-From 0fa5b59c5f484c80453e9d3201b87e4253f8bec3 Mon Sep 17 00:00:00 2001

-From: Koen Kooi <koen@dominion.thruhere.net>

-Date: Thu, 5 May 2011 17:15:41 +0200

-Subject: [PATCH 3/3] Angstrom support

-

-This commit consists of the initial work to include Angstrom as a ported

-distribution for systemd.

-

-Angstrom tries to follow the debian way as much as possible, but deviates

-where it doesn't make sense for 'embedded'.

-

-Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>

----

- Makefile.am        |    7 +++++++

- configure.ac       |    7 +++++++

- src/locale-setup.c |    2 +-

- src/service.c      |   10 +++++-----

- src/util.c         |   12 ++++++++++++

- 5 files changed, 32 insertions(+), 6 deletions(-)

-

-diff --git a/Makefile.am b/Makefile.am

-index 49d2ee8..f3f7818 100644

---- a/Makefile.am

-+++ b/Makefile.am

-@@ -96,6 +96,12 @@ AM_CPPFLAGS += \

- 	-DKBD_SETFONT=\"/bin/setfont\" \

- 	-DDEFAULT_FONT=\"LatArCyrHeb-16\"

- else

-+if TARGET_ANGSTROM

-+AM_CPPFLAGS += \

-+	-DKBD_LOADKEYS=\"/usr/bin/loadkeys\" \

-+	-DKBD_SETFONT=\"/usr/bin/setfont\" \

-+	-DDEFAULT_FONT=\"LatArCyrHeb-16\"

-+else

- AM_CPPFLAGS += \

- 	-DKBD_LOADKEYS=\"/bin/loadkeys\" \

- 	-DKBD_SETFONT=\"/bin/setfont\" \

-@@ -105,6 +111,7 @@ endif

- endif

- endif

- endif

-+endif

- 

- rootbin_PROGRAMS = \

- 	systemd \

-diff --git a/configure.ac b/configure.ac

-index dcd4b9d..b5b7ac3 100644

---- a/configure.ac

-+++ b/configure.ac

-@@ -295,6 +295,7 @@ if test "z$with_distro" = "z"; then

-                 test -f "/etc/altlinux-release" && with_distro="altlinux"

-                 test -f "/etc/mandriva-release" && with_distro="mandriva"

-                 test -f "/etc/meego-release" && with_distro="meego"

-+                test -f "/etc/angstrom-version" && with_distro="angstrom"

-                 if test "x`lsb_release -is 2>/dev/null`" = "xUbuntu"; then

-                         with_distro="ubuntu"

-                 fi

-@@ -375,6 +376,11 @@ case $with_distro in

-                 AC_DEFINE(TARGET_MEEGO, [], [Target is MeeGo])

-                 M4_DISTRO_FLAG=-DTARGET_MEEGO=1

- 		;;

-+        angstrom)

-+                SYSTEM_SYSVRCND_PATH=/etc

-+                AC_DEFINE(TARGET_ANGSTROM, [], [Target is Ångström])

-+                M4_DISTRO_FLAG=-DTARGET_ANGSTROM=1

-+                ;;

-         other)

-                 ;;

-         *)

-@@ -425,6 +431,7 @@ AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware)

- AM_CONDITIONAL(TARGET_ALTLINUX, test x"$with_distro" = xaltlinux)

- AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)

- AM_CONDITIONAL(TARGET_MEEGO, test x"$with_distro" = xmeego)

-+AM_CONDITIONAL(TARGET_ANGSTROM, test x"$with_distro" = xangstrom)

- 

- AM_CONDITIONAL(HAVE_PLYMOUTH, test -n "$have_plymouth")

- AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")

-diff --git a/src/locale-setup.c b/src/locale-setup.c

-index d9adfa3..33111da 100644

---- a/src/locale-setup.c

-+++ b/src/locale-setup.c

-@@ -136,7 +136,7 @@ int locale_setup(void) {

-                         log_warning("Failed to read /etc/sysconfig/language: %s", strerror(-r));

-         }

- 

--#elif defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)

-+#elif defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_ANGSTROM)

-         if (r <= 0 &&

-             (r = parse_env_file("/etc/default/locale", NEWLINE,

-                                 "LANG",              &variables[VARIABLE_LANG],

-diff --git a/src/service.c b/src/service.c

-index e7a5622..f826754 100644

---- a/src/service.c

-+++ b/src/service.c

-@@ -65,7 +65,7 @@ static const struct {

-         { "boot.d", SPECIAL_SYSINIT_TARGET,   RUNLEVEL_SYSINIT },

- #endif

- 

--#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_FRUGALWARE)

-+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_FRUGALWARE) || defined(TARGET_ANGSTROM)

-         /* Debian style rcS.d */

-         { "rcS.d",  SPECIAL_SYSINIT_TARGET,   RUNLEVEL_SYSINIT },

- #endif

-@@ -246,7 +246,7 @@ static char *sysv_translate_name(const char *name) {

-         if (!(r = new(char, strlen(name) + sizeof(".service"))))

-                 return NULL;

- 

--#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)

-+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_ANGSTROM)

-         if (endswith(name, ".sh"))

-                 /* Drop Debian-style .sh suffix */

-                 strcpy(stpcpy(r, name) - 3, ".service");

-@@ -297,7 +297,7 @@ static int sysv_translate_facility(const char *name, const char *filename, char

-                 "x-display-manager",    SPECIAL_DISPLAY_MANAGER_SERVICE,

-                 "null",                 NULL,

- 

--#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)

-+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_ANGSTROM)

-                 "mail-transport-agent", SPECIAL_MAIL_TRANSFER_AGENT_TARGET,

- #endif

- 

-@@ -887,7 +887,7 @@ static int service_load_sysv_name(Service *s, const char *name) {

- 

-         /* For SysV services we strip the boot.*, rc.* and *.sh

-          * prefixes/suffixes. */

--#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)

-+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_ANGSTROM)

-         if (endswith(name, ".sh.service"))

-                 return -ENOENT;

- #endif

-@@ -914,7 +914,7 @@ static int service_load_sysv_name(Service *s, const char *name) {

- 

-                 r = service_load_sysv_path(s, path);

- 

--#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)

-+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_ANGSTROM)

-                 if (r >= 0 && s->meta.load_state == UNIT_STUB) {

-                         /* Try Debian style *.sh source'able init scripts */

-                         strcat(path, ".sh");

-diff --git a/src/util.c b/src/util.c

-index f0051ee..5af9161 100644

---- a/src/util.c

-+++ b/src/util.c

-@@ -3426,6 +3426,18 @@ void status_welcome(void) {

- 

-        if (!ansi_color)

-                const_color = "1;35"; /* Bright Magenta for MeeGo */

-+#elif defined(TARGET_ANGSTROM)

-+

-+        if (!pretty_name) {

-+                if ((r = read_one_line_file("/etc/angstrom-version", &pretty_name)) < 0) {

-+

-+                        if (r != -ENOENT)

-+                                log_warning("Failed to read /etc/angstrom-version: %s", strerror(-r));

-+                }

-+        }

-+

-+       if (!ansi_color)

-+               const_color = "1;35"; /* Bright Magenta for Angstrom */

- #endif

- 

-         if (!pretty_name && !const_pretty)

--- 

-1.6.6.1

-

diff --git a/recipes/systemd/systemd_git.bb b/recipes/systemd/systemd_git.bb

index 6688eed..9c7af6a 100644

--- a/recipes/systemd/systemd_git.bb

+++ b/recipes/systemd/systemd_git.bb

@@ -15,12 +15,11 @@  PR_append = "+${SRCPV}"

 
 inherit autotools vala update-alternatives
 
-TAG = "7a6000a68241d23c9f6f6bde47b2cfa9c18189da"

+TAG = "ec2002f84928c0b5921a961cb2b8637563f29daa"

 
 SRC_URI = "git://anongit.freedesktop.org/systemd;protocol=git;tag=${TAG} \
            file://execute.patch \
            file://0001-systemd-disable-xml-file-stuff-and-introspection.patch \
-           file://0003-Angstrom-support.patch \

            file://replace_accpet4.patch \
            file://serial-getty@.service \
           "
-- 

1.7.5.1