systemd: allow to build with uClibc toolchains
authorWaldemar Brodkorb <wbx@openadk.org>
Mon, 12 Feb 2018 21:06:33 +0000 (22:06 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 14 Feb 2018 20:31:17 +0000 (21:31 +0100)
We need to disable any systemd parts using either IDN, NSS or gshadow.
IDN is only disabled in C library function call to getnameinfo(),
it does not effect libidn/libidn2 usage in systemd.

Tested with qemu-system-arm.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/systemd/Config.in
package/systemd/systemd.mk
system/Config.in

index 661f40dee48f343b365affac3a8fb2b01f0965c6..81eee96c570bfe0eb251fb79ad0c14b147f5155a 100644 (file)
@@ -190,6 +190,7 @@ config BR2_PACKAGE_SYSTEMD_MACHINED
 
 config BR2_PACKAGE_SYSTEMD_MYHOSTNAME
        bool "enable myhostname NSS plugin"
+       depends on !BR2_TOOLCHAIN_USES_UCLIBC # needs nss.h
        default y
        help
          nss-myhostname is a plug-in module for the GNU Name Service
@@ -245,6 +246,7 @@ config BR2_PACKAGE_SYSTEMD_RANDOMSEED
 
 config BR2_PACKAGE_SYSTEMD_RESOLVED
        bool "enable resolve daemon"
+       depends on !BR2_TOOLCHAIN_USES_UCLIBC # needs nss.h
        default y
        help
          systemd-resolved is a system service that provides network
@@ -278,6 +280,7 @@ config BR2_PACKAGE_SYSTEMD_SMACK_SUPPORT
 
 config BR2_PACKAGE_SYSTEMD_SYSUSERS
        bool "enable sysusers support"
+       depends on !BR2_TOOLCHAIN_USES_UCLIBC # needs gshadow.h
        help
          systemd-sysusers creates system users and groups, based on
          the file format and location specified in sysusers.d(5).
index 1c31ebb34c750ef95ae467dc782abae44e3596b6..a6c4b338e943db054beab65d4abc6cbeb9b9b5e8 100644 (file)
@@ -48,6 +48,17 @@ SYSTEMD_CONF_OPTS += \
        -Dmount-path=/usr/bin/mount \
        -Dumount-path=/usr/bin/umount
 
+# disable unsupported features for non-glibc toolchains
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
+SYSTEMD_CONF_OPTS += \
+       -Didn=true \
+       -Dnss-systemd=true
+else
+SYSTEMD_CONF_OPTS += \
+       -Didn=false \
+       -Dnss-systemd=false
+endif
+
 ifeq ($(BR2_PACKAGE_ACL),y)
 SYSTEMD_DEPENDENCIES += acl
 SYSTEMD_CONF_OPTS += -Dacl=true
index d48cf8d8c4ede59d54e66d6f4bd11296ac1f7773..7b36516cc7b36d6c4e288d441981369c8d62c1ae 100644 (file)
@@ -127,7 +127,7 @@ config BR2_INIT_SYSV
 config BR2_INIT_SYSTEMD
        bool "systemd"
        depends on BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS
-       depends on BR2_TOOLCHAIN_USES_GLIBC
+       depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_UCLIBC
        depends on BR2_USE_WCHAR
        depends on BR2_TOOLCHAIN_HAS_THREADS
        depends on BR2_TOOLCHAIN_HAS_SSP
@@ -137,8 +137,8 @@ config BR2_INIT_SYSTEMD
        select BR2_ROOTFS_MERGED_USR
        select BR2_PACKAGE_SYSTEMD
 
-comment "systemd needs a glibc toolchain, headers >= 3.10"
-       depends on !(BR2_TOOLCHAIN_USES_GLIBC \
+comment "systemd needs a glibc or uClibc toolchain, headers >= 3.10"
+       depends on !(BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_UCLIBC \
                && BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10)
 
 config BR2_INIT_NONE