From patchwork Fri Oct 27 20:18:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 117378 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1175077qgn; Fri, 27 Oct 2017 13:18:18 -0700 (PDT) X-Google-Smtp-Source: ABhQp+S9RZOBWvQ7poXjbWpdMkbjJ7iXdRLvGlIds5zvl+kX5m2irBNHMnenrZ6q7JD0B7PPL2VK X-Received: by 10.99.96.15 with SMTP id u15mr1253747pgb.424.1509135498578; Fri, 27 Oct 2017 13:18:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509135498; cv=none; d=google.com; s=arc-20160816; b=b+LbcBNOhJGYja612aewqYoG7KSzAREw2DegQZJPRqikdvZJomPoJnSkd3yPrw4lw3 4zeIcTG93Xu39G7d5EN+wJNtFHnhXGA3liVDzsmM8MKS75RwWMt0Tm/bNmfT+en/tRQW zklhj569YQ9MMqONWHXuaO7S8uvFpbQ/DlZDBF6zNMddQTO4fn7uDqFlXFDTi++i14NH lw40IvknIkWvrNSw+eE3DSKmj8qLYdKrZxGgvzmGjD26AfeLxoeAji3olPx4MqIBM33f 4rBU5Xkt2p4v01BFPPRt9lEwqeJ8yXncbnUaEhimdGeMoAp5r2EsEEWH/TbBMQGpFK02 ZTIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=VzA6HFN7HsWDF/BihkHHMkf4ZRuLtUDeKV3vgqTmROQ=; b=lA7hYMHp5ozG7ffK3rEAl7Jh/qaBdAPXLriezsAr2jny3l4r/+z377Vc5G4itKRO/0 sgDVpOQaKQzkZ+exk+8vC//+PkWMpmPSO8++W2DzEaWUR55HlOWPSes19oHN5ZClE22N aTFrEoRmc5hPFqBvQ6xtSfgSU3pujWUOWVGq3QDiuEJ+yB1FzZepLiA1Bypg1/9ICSbR n+xDbl4Wvqrmq6a1l0l+l0x8aUahJgnQb/M7BP8Dqg55ZipaDEWSTp9phRb7V0eU5m2Y x680XtM9SdSCU7nGOK4M8w3wiF9OAYHRgWpLy6j5dwu0eq1CJMfaXnkZea56NM6Bp8R+ xnmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=ofodGWch; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id 64si3473906plb.652.2017.10.27.13.18.17; Fri, 27 Oct 2017 13:18:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=ofodGWch; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id D624C782E8; Fri, 27 Oct 2017 20:18:10 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by mail.openembedded.org (Postfix) with ESMTP id 39B697197E for ; Fri, 27 Oct 2017 20:18:08 +0000 (UTC) Received: by mail-pf0-f193.google.com with SMTP id n89so5678249pfk.11 for ; Fri, 27 Oct 2017 13:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ccmb/ORfw+qMemKHqs+98nNFTDjnsJjM1uFj6OXqGXU=; b=ofodGWch/wT83pmilF8NUeX40VeDpAsNiy24IhLmc5/K9gwSynQt3eR890V6Pqo6fP S8YppigrMcdPVKIZnoDyMSFq08TzJ+USgW1Owy2qUAUhzq1QmsxBJ0GhYYdPkFTyBkTR jI3VD+L3/HY/iLDu2b0WqvLQ0krpy7ppEyQhsYTSR+MXkYtj9J5QqFG77u/uCoEOpHwv HN4uXjIFyDrcYXsw4K3wAEq4sCzOFOpyZ1RKjlIeM7DFs81Y8szcBHHiBWpshoLDVA/q f8NqBDUHI8VLtIgOeL0atgQyOlDPnc6dlKlNPIGRK8pOPytytaZ3ERpV+p2+TLE+2ee4 GTOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ccmb/ORfw+qMemKHqs+98nNFTDjnsJjM1uFj6OXqGXU=; b=Q8UhsCfTHWrgJ6F6Op8UUxCUL5XHZ3RLKLJcQpfumuLlv/Ke/WIqnrq9vdXI+6+jUo UhMDQGGs2+bKLO8zmJzRQypjR79ya02EtTWmpRqGLoCac0tsnZtOS89eE+EuAR63EFMp CcpIue+bVr0t3LdDEeqzDEnyB2zqKifmbMGB9c9oy8njforTHGLsGrZSc2F1opnZd53B 7KWtwSITIEjlTmZKYe83kiibQ19fKwvNkMstJnpIycqx1a3EohEI98GiyXU0VEln6vn7 r7YnFy0xSDTPpgY1Y32FYXXgm4owk569xyVVmRLxfXBh8jic4/y+yxpIgUFFSNZHx0QV PkVg== X-Gm-Message-State: AMCzsaX1bJlHH/eBijb0cd5pIV/IUnIpfdNEl+++wUXcoH+/TIB54bVR jlIDC0+Q3DCDhwM3ktBS7c5IUA== X-Received: by 10.99.97.139 with SMTP id v133mr1178535pgb.300.1509135490154; Fri, 27 Oct 2017 13:18:10 -0700 (PDT) Received: from localhost.localdomain ([2601:646:8882:b8c::d2ab]) by smtp.gmail.com with ESMTPSA id a78sm15942834pfl.122.2017.10.27.13.18.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Oct 2017 13:18:09 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Fri, 27 Oct 2017 13:18:00 -0700 Message-Id: <20171027201800.21721-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171027201800.21721-1-raj.khem@gmail.com> References: <20171027201800.21721-1-raj.khem@gmail.com> Subject: [OE-core] [PATCH 2/2] systemd: Fix build with musl/mips64 X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Signed-off-by: Khem Raj --- .../0001-Use-uintmax_t-for-handling-rlim_t.patch | 89 ++++++++++++++++++++++ meta/recipes-core/systemd/systemd_234.bb | 1 + 2 files changed, 90 insertions(+) create mode 100644 meta/recipes-core/systemd/systemd/0001-Use-uintmax_t-for-handling-rlim_t.patch -- 2.14.3 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-core/systemd/systemd/0001-Use-uintmax_t-for-handling-rlim_t.patch b/meta/recipes-core/systemd/systemd/0001-Use-uintmax_t-for-handling-rlim_t.patch new file mode 100644 index 0000000000..779dc78fd3 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-Use-uintmax_t-for-handling-rlim_t.patch @@ -0,0 +1,89 @@ +From b2d4171c6e521cf1e70331fb769234d63a4a6d44 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 27 Oct 2017 13:00:41 -0700 +Subject: [PATCH] Use uintmax_t for handling rlim_t + +PRIu{32,64} is not right format to represent rlim_t type +therefore use %ju and typecast the rlim_t variables to +uintmax_t. + +Fixes portablility errors like + +execute.c:3446:36: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'rlim_t {aka long long unsigned int}' [-Werror=format=] +| fprintf(f, "%s%s: " RLIM_FMT "\n", +| ^~~~~~~~ +| prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max); +| ~~~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Khem Raj +--- +Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/7199] + + src/basic/format-util.h | 8 -------- + src/basic/rlimit-util.c | 8 ++++---- + src/core/execute.c | 8 ++++---- + 3 files changed, 8 insertions(+), 16 deletions(-) + +diff --git a/src/basic/format-util.h b/src/basic/format-util.h +index ae42a8f89..144249cd6 100644 +--- a/src/basic/format-util.h ++++ b/src/basic/format-util.h +@@ -60,14 +60,6 @@ + # define PRI_TIMEX "li" + #endif + +-#if SIZEOF_RLIM_T == 8 +-# define RLIM_FMT "%" PRIu64 +-#elif SIZEOF_RLIM_T == 4 +-# define RLIM_FMT "%" PRIu32 +-#else +-# error Unknown rlim_t size +-#endif +- + #if SIZEOF_DEV_T == 8 + # define DEV_FMT "%" PRIu64 + #elif SIZEOF_DEV_T == 4 +diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c +index ca834df62..41fcebb74 100644 +--- a/src/basic/rlimit-util.c ++++ b/src/basic/rlimit-util.c +@@ -284,13 +284,13 @@ int rlimit_format(const struct rlimit *rl, char **ret) { + if (rl->rlim_cur >= RLIM_INFINITY && rl->rlim_max >= RLIM_INFINITY) + s = strdup("infinity"); + else if (rl->rlim_cur >= RLIM_INFINITY) +- (void) asprintf(&s, "infinity:" RLIM_FMT, rl->rlim_max); ++ (void) asprintf(&s, "infinity:%ju", (uintmax_t)rl->rlim_max); + else if (rl->rlim_max >= RLIM_INFINITY) +- (void) asprintf(&s, RLIM_FMT ":infinity", rl->rlim_cur); ++ (void) asprintf(&s, "%ju:infinity", (uintmax_t)rl->rlim_cur); + else if (rl->rlim_cur == rl->rlim_max) +- (void) asprintf(&s, RLIM_FMT, rl->rlim_cur); ++ (void) asprintf(&s, "%ju", (uintmax_t)rl->rlim_cur); + else +- (void) asprintf(&s, RLIM_FMT ":" RLIM_FMT, rl->rlim_cur, rl->rlim_max); ++ (void) asprintf(&s, "%ju:%ju", (uintmax_t)rl->rlim_cur, (uintmax_t)rl->rlim_max); + + if (!s) + return -ENOMEM; +diff --git a/src/core/execute.c b/src/core/execute.c +index d72e5bf08..d38946002 100644 +--- a/src/core/execute.c ++++ b/src/core/execute.c +@@ -3443,10 +3443,10 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) { + + for (i = 0; i < RLIM_NLIMITS; i++) + if (c->rlimit[i]) { +- fprintf(f, "%s%s: " RLIM_FMT "\n", +- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max); +- fprintf(f, "%s%sSoft: " RLIM_FMT "\n", +- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_cur); ++ fprintf(f, "%s%s: %ju\n", ++ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_max); ++ fprintf(f, "%s%sSoft: %ju\n", ++ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_cur); + } + + if (c->ioprio_set) { +-- +2.14.3 + diff --git a/meta/recipes-core/systemd/systemd_234.bb b/meta/recipes-core/systemd/systemd_234.bb index 3867986765..e2e42d61b6 100644 --- a/meta/recipes-core/systemd/systemd_234.bb +++ b/meta/recipes-core/systemd/systemd_234.bb @@ -40,6 +40,7 @@ SRC_URI += " \ file://0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \ file://0013-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch \ file://0001-Define-_PATH_WTMPX-and-_PATH_UTMPX-if-not-defined.patch \ + file://0001-Use-uintmax_t-for-handling-rlim_t.patch \ " SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"