diff options
| author | Naveen Saini <naveen.kumar.saini@intel.com> | 2020-03-06 10:44:08 +0800 |
|---|---|---|
| committer | Anuj Mittal <anuj.mittal@intel.com> | 2020-03-06 10:45:15 +0800 |
| commit | cc60e742db35368698280c897178f3b9342394ac (patch) | |
| tree | 914adcf40b32f49ebadc5a3316be1faee93edaeb | |
| parent | bba67420e6ae08e12d486247542a33de25d9ccff (diff) | |
| download | meta-intel-cc60e742db35368698280c897178f3b9342394ac.tar.gz | |
thermald: fix 32-bit build error with musl v1.2.0
Recent musl upgrades to v1.2.0 causing below error:
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/
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
| -rw-r--r-- | recipes-bsp/thermald/thermald/0001-thd_trip_point-fix-32-bit-build-error-with-musl-v1.2.patch | 51 | ||||
| -rw-r--r-- | recipes-bsp/thermald/thermald_1.9.1.bb | 1 |
2 files changed, 52 insertions, 0 deletions
diff --git a/recipes-bsp/thermald/thermald/0001-thd_trip_point-fix-32-bit-build-error-with-musl-v1.2.patch b/recipes-bsp/thermald/thermald/0001-thd_trip_point-fix-32-bit-build-error-with-musl-v1.2.patch new file mode 100644 index 00000000..ee3c5e5e --- /dev/null +++ b/recipes-bsp/thermald/thermald/0001-thd_trip_point-fix-32-bit-build-error-with-musl-v1.2.patch | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | From 2145c92fb2ee6d1b03b9ea92e0f910e60b925d70 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | ||
| 3 | Date: Thu, 5 Mar 2020 13:45:57 +0800 | ||
| 4 | Subject: [PATCH] thd_trip_point: fix 32-bit build error with musl v1.2.0 | ||
| 5 | |||
| 6 | Error log: | ||
| 7 | ../git/src/thd_trip_point.cpp: In member function 'bool cthd_trip_point::thd_trip_point_check(int, unsigned int, int, bool*)': | ||
| 8 | | ../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=] | ||
| 9 | | 250 | thd_log_info("Too early to act zone:%d index %d tm %ld\n", | ||
| 10 | |||
| 11 | musl 1.2.0 have new feature: | ||
| 12 | time_t is now 64-bit on all archs (not just 64-bit archs) | ||
| 13 | |||
| 14 | Commit id: | ||
| 15 | https://git.musl-libc.org/cgit/musl/commit/?id=38143339646a4ccce8afe298c34467767c899f51 | ||
| 16 | |||
| 17 | Release note link for musl 1.2.0: | ||
| 18 | https://git.musl-libc.org/cgit/musl/diff/ | ||
| 19 | |||
| 20 | Upstream-Status: Submitted [https://github.com/intel/thermal_daemon/pull/217] | ||
| 21 | |||
| 22 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
| 23 | --- | ||
| 24 | src/thd_trip_point.cpp | 10 ++-------- | ||
| 25 | 1 file changed, 2 insertions(+), 8 deletions(-) | ||
| 26 | |||
| 27 | diff --git a/src/thd_trip_point.cpp b/src/thd_trip_point.cpp | ||
| 28 | index 043be0c..2186ac2 100644 | ||
| 29 | --- a/src/thd_trip_point.cpp | ||
| 30 | +++ b/src/thd_trip_point.cpp | ||
| 31 | @@ -242,15 +242,9 @@ bool cthd_trip_point::thd_trip_point_check(int id, unsigned int read_temp, | ||
| 32 | time_t tm; | ||
| 33 | time(&tm); | ||
| 34 | if ((tm - cdevs[i].last_op_time) < cdevs[i].sampling_priod) { | ||
| 35 | -#if defined __x86_64__ && defined __ILP32__ | ||
| 36 | - thd_log_info("Too early to act zone:%d index %d tm %lld\n", | ||
| 37 | + thd_log_info("Too early to act zone:%d index %d tm %jd\n", | ||
| 38 | zone_id, cdev->thd_cdev_get_index(), | ||
| 39 | - tm - cdevs[i].last_op_time); | ||
| 40 | -#else | ||
| 41 | - thd_log_info("Too early to act zone:%d index %d tm %ld\n", | ||
| 42 | - zone_id, cdev->thd_cdev_get_index(), | ||
| 43 | - tm - cdevs[i].last_op_time); | ||
| 44 | -#endif | ||
| 45 | + (intmax_t)tm - cdevs[i].last_op_time); | ||
| 46 | break; | ||
| 47 | } | ||
| 48 | cdevs[i].last_op_time = tm; | ||
| 49 | -- | ||
| 50 | 2.17.1 | ||
| 51 | |||
diff --git a/recipes-bsp/thermald/thermald_1.9.1.bb b/recipes-bsp/thermald/thermald_1.9.1.bb index e38e3f52..be68aa48 100644 --- a/recipes-bsp/thermald/thermald_1.9.1.bb +++ b/recipes-bsp/thermald/thermald_1.9.1.bb | |||
| @@ -14,6 +14,7 @@ LICENSE = "GPLv2" | |||
| 14 | LIC_FILES_CHKSUM = "file://COPYING;md5=ea8831610e926e2e469075b52bf08848" | 14 | LIC_FILES_CHKSUM = "file://COPYING;md5=ea8831610e926e2e469075b52bf08848" |
| 15 | 15 | ||
| 16 | SRC_URI = "git://github.com/intel/thermal_daemon/ \ | 16 | SRC_URI = "git://github.com/intel/thermal_daemon/ \ |
| 17 | file://0001-thd_trip_point-fix-32-bit-build-error-with-musl-v1.2.patch \ | ||
| 17 | " | 18 | " |
| 18 | SRCREV = "7e23f7cc4611fd7289014c9805749ec75d59bae0" | 19 | SRCREV = "7e23f7cc4611fd7289014c9805749ec75d59bae0" |
| 19 | S = "${WORKDIR}/git" | 20 | S = "${WORKDIR}/git" |
