From patchwork Mon Nov 23 21:12:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Seiderer X-Patchwork-Id: 1405144 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmx.net Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=hbMtYITg; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cg0HS0DL8z9sRR for ; Tue, 24 Nov 2020 08:13:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8F65B85308; Mon, 23 Nov 2020 21:13:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id no17xKZx9Nql; Mon, 23 Nov 2020 21:13:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9869D85313; Mon, 23 Nov 2020 21:13:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id CF4801BF28D for ; Mon, 23 Nov 2020 21:12:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CC32286770 for ; Mon, 23 Nov 2020 21:12:58 +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 LAjsIGfZlepR for ; Mon, 23 Nov 2020 21:12:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by whitealder.osuosl.org (Postfix) with ESMTPS id 545AD8676C for ; Mon, 23 Nov 2020 21:12:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606165969; bh=OGgoIvV49kQVOm/Tp8WMfd5D3irYmbpJFFNpdVqDNxw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=hbMtYITgqdUgaUyMnZLqxwa2JvnkC/l8Tbh/FsbRp8rzrS9QfnrK7vd1gy/HLsh55 w4biPo+RdTbyHNfMNNvj5z95onlv6cb81G2RLaXRBxmgfbutpm0ZdM/bixBjPXuJ/N 5GMlq0cvKW94yKXS1V+KvbVda8+KbgOSI0eom7hM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.fritz.box ([62.216.208.88]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MtOGa-1kNAf12v42-00uulE; Mon, 23 Nov 2020 22:12:49 +0100 From: Peter Seiderer To: buildroot@busybox.net Date: Mon, 23 Nov 2020 22:12:48 +0100 Message-Id: <20201123211248.23828-1-ps.report@gmx.net> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:Sdkey3fDkIQVyUR/90SMhNca8LEk3Lc0oc/2njwfbVY/C/B7m6I AdvANCMIRWXFJ400EAu1oZ0bJ4RTuw+t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qsOtqukBtkgsdE I5m1oOCsyvATH0uf1Z1AzOWeM7/Ga2AS5mHcN1MjA= Subject: [Buildroot] [PATCH v1] package/thermald: fix time_t related compile failure X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ricardo Martincoski Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add upstream patch [1] to fix (musl) time_t related compile failure. Fixes: - https://bugs.busybox.net/show_bug.cgi?id=13336 src/thd_trip_point.cpp: In member function ‘bool cthd_trip_point::thd_trip_point_check(int, unsigned int, int, bool*)’: src/thd_trip_point.cpp:250:19: error: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘time_t’ {aka ‘long long int’} [-Werror=format=] 250 | thd_log_info("Too early to act zone:%d index %d tm %ld\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 251 | zone_id, cdev->thd_cdev_get_index(), 252 | tm - cdevs[i].last_op_time); | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | time_t {aka long long int} src/thermald.h:82:57: note: in definition of macro ‘thd_log_info’ 82 | #define thd_log_info(...) g_log(NULL, G_LOG_LEVEL_INFO, __VA_ARGS__) | ^~~~~~~~~~~ src/thd_trip_point.cpp:250:59: note: format string is defined here 250 | thd_log_info("Too early to act zone:%d index %d tm %ld\n", | ~~^ | | | long int | %lld Signed-off-by: Peter Seiderer --- ...ix-32-bit-build-error-with-musl-v1.2.patch | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 package/thermald/0001-thd_trip_point-fix-32-bit-build-error-with-musl-v1.2.patch diff --git a/package/thermald/0001-thd_trip_point-fix-32-bit-build-error-with-musl-v1.2.patch b/package/thermald/0001-thd_trip_point-fix-32-bit-build-error-with-musl-v1.2.patch new file mode 100644 index 0000000000..db5bc99a91 --- /dev/null +++ b/package/thermald/0001-thd_trip_point-fix-32-bit-build-error-with-musl-v1.2.patch @@ -0,0 +1,53 @@ +From 074575bf3640485ab6d43ae1efed3eff9cebae13 Mon Sep 17 00:00:00 2001 +From: Naveen Saini +Date: Thu, 5 Mar 2020 13:45:57 +0800 +Subject: [PATCH] thd_trip_point: fix 32-bit build error with musl v1.2.0 + +Error log: + ../git/src/thd_trip_point.cpp: In member function 'bool cthd_trip_point::thd_trip_point_check(int, unsigned int, int, bool*)': +| ../git/src/thd_trip_point.cpp:250:19: error: format '%ld' expects argument of type 'long int', but argument 6 has type 'time_t' {aka 'long long int'} [-Werror=format=] +| 250 | thd_log_info("Too early to act zone:%d index %d tm %ld\n", + +musl 1.2.0 have new feature: +time_t is now 64-bit on all archs (not just 64-bit archs) + +Commit id: +https://git.musl-libc.org/cgit/musl/commit/?id=38143339646a4ccce8afe298c34467767c899f51 + +Release note link for musl 1.2.0: +https://git.musl-libc.org/cgit/musl/diff/ + +use %jd and typecast with intmax_t which is maximum width integer type + +Signed-off-by: Naveen Saini +[Upstream: https://github.com/intel/thermal_daemon/commit/a7136682b9e6ebdb53c3c8b472bcd5039d62dc78.patch] +Signed-off-by: Peter Seiderer +--- + src/thd_trip_point.cpp | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +diff --git a/src/thd_trip_point.cpp b/src/thd_trip_point.cpp +index 46f692d..6358c27 100644 +--- a/src/thd_trip_point.cpp ++++ b/src/thd_trip_point.cpp +@@ -242,15 +242,9 @@ bool cthd_trip_point::thd_trip_point_check(int id, unsigned int read_temp, + time_t tm; + time(&tm); + if ((tm - cdevs[i].last_op_time) < cdevs[i].sampling_priod) { +-#if defined __x86_64__ && defined __ILP32__ +- thd_log_info("Too early to act zone:%d index %d tm %lld\n", ++ thd_log_info("Too early to act zone:%d index %d tm %jd\n", + zone_id, cdev->thd_cdev_get_index(), +- tm - cdevs[i].last_op_time); +-#else +- thd_log_info("Too early to act zone:%d index %d tm %ld\n", +- zone_id, cdev->thd_cdev_get_index(), +- tm - cdevs[i].last_op_time); +-#endif ++ (intmax_t)tm - cdevs[i].last_op_time); + break; + } + cdevs[i].last_op_time = tm; +-- +2.29.2 +