Openembedded Core Discussions
 help / color / mirror / Atom feed
* [dunfell][PATCH] busybox: make hwclock compatible with glibc 2.31
@ 2020-07-21 18:00 Sakib Sajal
  2020-07-21 18:11 ` [OE-core] " Randy MacLeod
  2020-07-21 18:32 ` ✗ patchtest: failure for busybox: make hwclock compatible with glibc 2.31 (rev2) Patchwork
  0 siblings, 2 replies; 7+ messages in thread
From: Sakib Sajal @ 2020-07-21 18:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: Sakib Sajal

settimeofday(2) has been deprecated as of glibc 2.31
which hwclock makes use of. This patch makes hwclock
compatible with glibc v2.31
See patch for more details:
  busybox/0001-hwclock-make-glibc-2.31-compatible.patch

Fixes [YOCTO #13981]

Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
---
 ...1-hwclock-make-glibc-2.31-compatible.patch | 83 +++++++++++++++++++
 meta/recipes-core/busybox/busybox_1.32.0.bb   |  1 +
 2 files changed, 84 insertions(+)
 create mode 100644 meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch

diff --git a/meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch b/meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch
new file mode 100644
index 0000000000..8d1f272120
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch
@@ -0,0 +1,83 @@
+From 5b2fc5746c352eb2b27bfc9fb224580d9852d0fa Mon Sep 17 00:00:00 2001
+From: Sakib Sajal <sakib.sajal@windriver.com>
+Date: Fri, 17 Jul 2020 17:27:21 +0000
+Subject: [PATCH] hwclock: make glibc 2.31 compatible
+
+NEWS for glibc version 2.31
+===========================
+
+Deprecated and removed features, and other changes affecting compatibility:
+
+* The settimeofday function can still be used to set a system-wide
+  time zone when the operating system supports it.  This is because
+  the Linux kernel reused the API, on some architectures, to describe
+  a system-wide time-zone-like offset between the software clock
+  maintained by the kernel, and the "RTC" clock that keeps time when
+  the system is shut down.
+
+  However, to reduce the odds of this offset being set by accident,
+  settimeofday can no longer be used to set the time and the offset
+  simultaneously.  If both of its two arguments are non-null, the call
+  will fail (setting errno to EINVAL).
+
+  Callers attempting to set this offset should also be prepared for
+  the call to fail and set errno to ENOSYS; this already happens on
+  the Hurd and on some Linux architectures.  The Linux kernel
+  maintainers are discussing a more principled replacement for the
+  reused API.  After a replacement becomes available, we will change
+  settimeofday to fail with ENOSYS on all platforms when its 'tzp'
+  argument is not a null pointer.
+
+  settimeofday itself is obsolescent according to POSIX.  Programs
+  that set the system time should use clock_settime and/or the adjtime
+  family of functions instead.  We may cease to make settimeofday
+  available to newly linked binaries after there is a replacement for
+  Linux's time-zone-like offset API.
+
+hwclock had two calls to settimeofday, in functions to_sys_clock and
+set_system_clock_timezone, where both the arguments to settimeofday
+were valid (non-null).
+Therefore, split the call, once for timezone and once for timeval.
+
+Fixes #12756
+
+Upstream-Status: Pending
+
+Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
+---
+ util-linux/hwclock.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c
+index dc97d8f..cf346e8 100644
+--- a/util-linux/hwclock.c
++++ b/util-linux/hwclock.c
+@@ -131,8 +131,10 @@ static void to_sys_clock(const char **pp_rtcname, int utc)
+ 
+ 	tv.tv_sec = read_rtc(pp_rtcname, NULL, utc);
+ 	tv.tv_usec = 0;
+-	if (settimeofday(&tv, &tz))
+-		bb_simple_perror_msg_and_die("settimeofday");
++	if (settimeofday(NULL, &tz))
++		bb_simple_perror_msg_and_die("settimeofday: timezone");
++	if (settimeofday(&tv, NULL))
++		bb_simple_perror_msg_and_die("settimeofday: timeval");
+ }
+ 
+ static void from_sys_clock(const char **pp_rtcname, int utc)
+@@ -283,8 +285,10 @@ static void set_system_clock_timezone(int utc)
+ 	gettimeofday(&tv, NULL);
+ 	if (!utc)
+ 		tv.tv_sec += tz.tz_minuteswest * 60;
+-	if (settimeofday(&tv, &tz))
+-		bb_simple_perror_msg_and_die("settimeofday");
++	if (settimeofday(NULL, &tz))
++		bb_simple_perror_msg_and_die("settimeofday: timezone");
++	if (settimeofday(&tv, NULL))
++		bb_simple_perror_msg_and_die("settimeofday: timeval");
+ }
+ 
+ //usage:#define hwclock_trivial_usage
+-- 
+2.24.1
+
diff --git a/meta/recipes-core/busybox/busybox_1.32.0.bb b/meta/recipes-core/busybox/busybox_1.32.0.bb
index 0dfdfdb549..aeea40fbc1 100644
--- a/meta/recipes-core/busybox/busybox_1.32.0.bb
+++ b/meta/recipes-core/busybox/busybox_1.32.0.bb
@@ -43,6 +43,7 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://0001-testsuite-use-www.example.org-for-wget-test-cases.patch \
            file://0001-du-l-works-fix-to-use-145-instead-of-144.patch \
            file://0001-sysctl-ignore-EIO-of-stable_secret-below-proc-sys-ne.patch \
+           file://0001-hwclock-make-glibc-2.31-compatible.patch \
 "
 SRC_URI_append_libc-musl = " file://musl.cfg "
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [OE-core] [dunfell][PATCH] busybox: make hwclock compatible with glibc 2.31
  2020-07-21 18:00 [dunfell][PATCH] busybox: make hwclock compatible with glibc 2.31 Sakib Sajal
@ 2020-07-21 18:11 ` Randy MacLeod
  2020-07-21 18:54   ` Sakib Sajal
  2020-07-21 18:32 ` ✗ patchtest: failure for busybox: make hwclock compatible with glibc 2.31 (rev2) Patchwork
  1 sibling, 1 reply; 7+ messages in thread
From: Randy MacLeod @ 2020-07-21 18:11 UTC (permalink / raw)
  To: Sakib Sajal; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 5603 bytes --]

Hi Sakib,

Did you check this busybox fix against musl? I forgot to ask you this when
you showed me this patch yesterday.

Randy

On Tue., Jul. 21, 2020, 14:01 Sakib Sajal, <sakib.sajal@windriver.com>
wrote:

> settimeofday(2) has been deprecated as of glibc 2.31
> which hwclock makes use of. This patch makes hwclock
> compatible with glibc v2.31
> See patch for more details:
>   busybox/0001-hwclock-make-glibc-2.31-compatible.patch
>
> Fixes [YOCTO #13981]
>
> Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
> ---
>  ...1-hwclock-make-glibc-2.31-compatible.patch | 83 +++++++++++++++++++
>  meta/recipes-core/busybox/busybox_1.32.0.bb   |  1 +
>  2 files changed, 84 insertions(+)
>  create mode 100644
> meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch
>
> diff --git
> a/meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch
> b/meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch
> new file mode 100644
> index 0000000000..8d1f272120
> --- /dev/null
> +++
> b/meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch
> @@ -0,0 +1,83 @@
> +From 5b2fc5746c352eb2b27bfc9fb224580d9852d0fa Mon Sep 17 00:00:00 2001
> +From: Sakib Sajal <sakib.sajal@windriver.com>
> +Date: Fri, 17 Jul 2020 17:27:21 +0000
> +Subject: [PATCH] hwclock: make glibc 2.31 compatible
> +
> +NEWS for glibc version 2.31
> +===========================
> +
> +Deprecated and removed features, and other changes affecting
> compatibility:
> +
> +* The settimeofday function can still be used to set a system-wide
> +  time zone when the operating system supports it.  This is because
> +  the Linux kernel reused the API, on some architectures, to describe
> +  a system-wide time-zone-like offset between the software clock
> +  maintained by the kernel, and the "RTC" clock that keeps time when
> +  the system is shut down.
> +
> +  However, to reduce the odds of this offset being set by accident,
> +  settimeofday can no longer be used to set the time and the offset
> +  simultaneously.  If both of its two arguments are non-null, the call
> +  will fail (setting errno to EINVAL).
> +
> +  Callers attempting to set this offset should also be prepared for
> +  the call to fail and set errno to ENOSYS; this already happens on
> +  the Hurd and on some Linux architectures.  The Linux kernel
> +  maintainers are discussing a more principled replacement for the
> +  reused API.  After a replacement becomes available, we will change
> +  settimeofday to fail with ENOSYS on all platforms when its 'tzp'
> +  argument is not a null pointer.
> +
> +  settimeofday itself is obsolescent according to POSIX.  Programs
> +  that set the system time should use clock_settime and/or the adjtime
> +  family of functions instead.  We may cease to make settimeofday
> +  available to newly linked binaries after there is a replacement for
> +  Linux's time-zone-like offset API.
> +
> +hwclock had two calls to settimeofday, in functions to_sys_clock and
> +set_system_clock_timezone, where both the arguments to settimeofday
> +were valid (non-null).
> +Therefore, split the call, once for timezone and once for timeval.
> +
> +Fixes #12756
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
> +---
> + util-linux/hwclock.c | 12 ++++++++----
> + 1 file changed, 8 insertions(+), 4 deletions(-)
> +
> +diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c
> +index dc97d8f..cf346e8 100644
> +--- a/util-linux/hwclock.c
> ++++ b/util-linux/hwclock.c
> +@@ -131,8 +131,10 @@ static void to_sys_clock(const char **pp_rtcname,
> int utc)
> +
> +       tv.tv_sec = read_rtc(pp_rtcname, NULL, utc);
> +       tv.tv_usec = 0;
> +-      if (settimeofday(&tv, &tz))
> +-              bb_simple_perror_msg_and_die("settimeofday");
> ++      if (settimeofday(NULL, &tz))
> ++              bb_simple_perror_msg_and_die("settimeofday: timezone");
> ++      if (settimeofday(&tv, NULL))
> ++              bb_simple_perror_msg_and_die("settimeofday: timeval");
> + }
> +
> + static void from_sys_clock(const char **pp_rtcname, int utc)
> +@@ -283,8 +285,10 @@ static void set_system_clock_timezone(int utc)
> +       gettimeofday(&tv, NULL);
> +       if (!utc)
> +               tv.tv_sec += tz.tz_minuteswest * 60;
> +-      if (settimeofday(&tv, &tz))
> +-              bb_simple_perror_msg_and_die("settimeofday");
> ++      if (settimeofday(NULL, &tz))
> ++              bb_simple_perror_msg_and_die("settimeofday: timezone");
> ++      if (settimeofday(&tv, NULL))
> ++              bb_simple_perror_msg_and_die("settimeofday: timeval");
> + }
> +
> + //usage:#define hwclock_trivial_usage
> +--
> +2.24.1
> +
> diff --git a/meta/recipes-core/busybox/busybox_1.32.0.bb
> b/meta/recipes-core/busybox/busybox_1.32.0.bb
> index 0dfdfdb549..aeea40fbc1 100644
> --- a/meta/recipes-core/busybox/busybox_1.32.0.bb
> +++ b/meta/recipes-core/busybox/busybox_1.32.0.bb
> @@ -43,6 +43,7 @@ SRC_URI = "
> https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
>
> file://0001-testsuite-use-www.example.org-for-wget-test-cases.patch \
>             file://0001-du-l-works-fix-to-use-145-instead-of-144.patch \
>
> file://0001-sysctl-ignore-EIO-of-stable_secret-below-proc-sys-ne.patch \
> +           file://0001-hwclock-make-glibc-2.31-compatible.patch \
>  "
>  SRC_URI_append_libc-musl = " file://musl.cfg "
>
> --
> 2.27.0
>
> 
>

[-- Attachment #2: Type: text/html, Size: 7277 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* ✗ patchtest: failure for busybox: make hwclock compatible with glibc 2.31 (rev2)
  2020-07-21 18:00 [dunfell][PATCH] busybox: make hwclock compatible with glibc 2.31 Sakib Sajal
  2020-07-21 18:11 ` [OE-core] " Randy MacLeod
@ 2020-07-21 18:32 ` Patchwork
  1 sibling, 0 replies; 7+ messages in thread
From: Patchwork @ 2020-07-21 18:32 UTC (permalink / raw)
  To: Sakib Sajal; +Cc: openembedded-core

== Series Details ==

Series: busybox: make hwclock compatible with glibc 2.31 (rev2)
Revision: 2
URL   : https://patchwork.openembedded.org/series/25223/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  dunfell (currently at c2ad3af9da)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [OE-core] [dunfell][PATCH] busybox: make hwclock compatible with glibc 2.31
  2020-07-21 18:11 ` [OE-core] " Randy MacLeod
@ 2020-07-21 18:54   ` Sakib Sajal
  2020-07-21 19:01     ` Khem Raj
  0 siblings, 1 reply; 7+ messages in thread
From: Sakib Sajal @ 2020-07-21 18:54 UTC (permalink / raw)
  To: Randy MacLeod; +Cc: openembedded-core


On 2020-07-21 2:11 p.m., Randy MacLeod wrote:
> Hi Sakib,
>
> Did you check this busybox fix against musl? I forgot to ask you this when
> you showed me this patch yesterday.
>
> Randy

Yes, I built core-image-minimal with musl and everything was fine.

Sakib

>
> On Tue., Jul. 21, 2020, 14:01 Sakib Sajal, <sakib.sajal@windriver.com>
> wrote:
>
>> settimeofday(2) has been deprecated as of glibc 2.31
>> which hwclock makes use of. This patch makes hwclock
>> compatible with glibc v2.31
>> See patch for more details:
>>    busybox/0001-hwclock-make-glibc-2.31-compatible.patch
>>
>> Fixes [YOCTO #13981]
>>
>> Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
>> ---
>>   ...1-hwclock-make-glibc-2.31-compatible.patch | 83 +++++++++++++++++++
>>   meta/recipes-core/busybox/busybox_1.32.0.bb   |  1 +
>>   2 files changed, 84 insertions(+)
>>   create mode 100644
>> meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch
>>
>> diff --git
>> a/meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch
>> b/meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch
>> new file mode 100644
>> index 0000000000..8d1f272120
>> --- /dev/null
>> +++
>> b/meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch
>> @@ -0,0 +1,83 @@
>> +From 5b2fc5746c352eb2b27bfc9fb224580d9852d0fa Mon Sep 17 00:00:00 2001
>> +From: Sakib Sajal <sakib.sajal@windriver.com>
>> +Date: Fri, 17 Jul 2020 17:27:21 +0000
>> +Subject: [PATCH] hwclock: make glibc 2.31 compatible
>> +
>> +NEWS for glibc version 2.31
>> +===========================
>> +
>> +Deprecated and removed features, and other changes affecting
>> compatibility:
>> +
>> +* The settimeofday function can still be used to set a system-wide
>> +  time zone when the operating system supports it.  This is because
>> +  the Linux kernel reused the API, on some architectures, to describe
>> +  a system-wide time-zone-like offset between the software clock
>> +  maintained by the kernel, and the "RTC" clock that keeps time when
>> +  the system is shut down.
>> +
>> +  However, to reduce the odds of this offset being set by accident,
>> +  settimeofday can no longer be used to set the time and the offset
>> +  simultaneously.  If both of its two arguments are non-null, the call
>> +  will fail (setting errno to EINVAL).
>> +
>> +  Callers attempting to set this offset should also be prepared for
>> +  the call to fail and set errno to ENOSYS; this already happens on
>> +  the Hurd and on some Linux architectures.  The Linux kernel
>> +  maintainers are discussing a more principled replacement for the
>> +  reused API.  After a replacement becomes available, we will change
>> +  settimeofday to fail with ENOSYS on all platforms when its 'tzp'
>> +  argument is not a null pointer.
>> +
>> +  settimeofday itself is obsolescent according to POSIX.  Programs
>> +  that set the system time should use clock_settime and/or the adjtime
>> +  family of functions instead.  We may cease to make settimeofday
>> +  available to newly linked binaries after there is a replacement for
>> +  Linux's time-zone-like offset API.
>> +
>> +hwclock had two calls to settimeofday, in functions to_sys_clock and
>> +set_system_clock_timezone, where both the arguments to settimeofday
>> +were valid (non-null).
>> +Therefore, split the call, once for timezone and once for timeval.
>> +
>> +Fixes #12756
>> +
>> +Upstream-Status: Pending
>> +
>> +Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
>> +---
>> + util-linux/hwclock.c | 12 ++++++++----
>> + 1 file changed, 8 insertions(+), 4 deletions(-)
>> +
>> +diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c
>> +index dc97d8f..cf346e8 100644
>> +--- a/util-linux/hwclock.c
>> ++++ b/util-linux/hwclock.c
>> +@@ -131,8 +131,10 @@ static void to_sys_clock(const char **pp_rtcname,
>> int utc)
>> +
>> +       tv.tv_sec = read_rtc(pp_rtcname, NULL, utc);
>> +       tv.tv_usec = 0;
>> +-      if (settimeofday(&tv, &tz))
>> +-              bb_simple_perror_msg_and_die("settimeofday");
>> ++      if (settimeofday(NULL, &tz))
>> ++              bb_simple_perror_msg_and_die("settimeofday: timezone");
>> ++      if (settimeofday(&tv, NULL))
>> ++              bb_simple_perror_msg_and_die("settimeofday: timeval");
>> + }
>> +
>> + static void from_sys_clock(const char **pp_rtcname, int utc)
>> +@@ -283,8 +285,10 @@ static void set_system_clock_timezone(int utc)
>> +       gettimeofday(&tv, NULL);
>> +       if (!utc)
>> +               tv.tv_sec += tz.tz_minuteswest * 60;
>> +-      if (settimeofday(&tv, &tz))
>> +-              bb_simple_perror_msg_and_die("settimeofday");
>> ++      if (settimeofday(NULL, &tz))
>> ++              bb_simple_perror_msg_and_die("settimeofday: timezone");
>> ++      if (settimeofday(&tv, NULL))
>> ++              bb_simple_perror_msg_and_die("settimeofday: timeval");
>> + }
>> +
>> + //usage:#define hwclock_trivial_usage
>> +--
>> +2.24.1
>> +
>> diff --git a/meta/recipes-core/busybox/busybox_1.32.0.bb
>> b/meta/recipes-core/busybox/busybox_1.32.0.bb
>> index 0dfdfdb549..aeea40fbc1 100644
>> --- a/meta/recipes-core/busybox/busybox_1.32.0.bb
>> +++ b/meta/recipes-core/busybox/busybox_1.32.0.bb
>> @@ -43,6 +43,7 @@ SRC_URI = "
>> https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
>>
>> file://0001-testsuite-use-www.example.org-for-wget-test-cases.patch \
>>              file://0001-du-l-works-fix-to-use-145-instead-of-144.patch \
>>
>> file://0001-sysctl-ignore-EIO-of-stable_secret-below-proc-sys-ne.patch \
>> +           file://0001-hwclock-make-glibc-2.31-compatible.patch \
>>   "
>>   SRC_URI_append_libc-musl = " file://musl.cfg "
>>
>> --
>> 2.27.0
>>
>> 
>>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [OE-core] [dunfell][PATCH] busybox: make hwclock compatible with glibc 2.31
  2020-07-21 18:54   ` Sakib Sajal
@ 2020-07-21 19:01     ` Khem Raj
  2020-07-21 19:07       ` Khem Raj
  2020-07-21 19:10       ` Sakib Sajal
  0 siblings, 2 replies; 7+ messages in thread
From: Khem Raj @ 2020-07-21 19:01 UTC (permalink / raw)
  To: Sakib Sajal, Randy MacLeod; +Cc: openembedded-core



On 7/21/20 11:54 AM, Sakib Sajal wrote:
> 
> On 2020-07-21 2:11 p.m., Randy MacLeod wrote:
>> Hi Sakib,
>>
>> Did you check this busybox fix against musl? I forgot to ask you this 
>> when
>> you showed me this patch yesterday.
>>
>> Randy
> 
> Yes, I built core-image-minimal with musl and everything was fine.
> 

build alone would not be sufficient, runtime testing would be required 
too. The patch however seems ok to me. Also send it upstream to bb ml as 
well for review

> Sakib
> 
>>
>> On Tue., Jul. 21, 2020, 14:01 Sakib Sajal, <sakib.sajal@windriver.com>
>> wrote:
>>
>>> settimeofday(2) has been deprecated as of glibc 2.31
>>> which hwclock makes use of. This patch makes hwclock
>>> compatible with glibc v2.31
>>> See patch for more details:
>>>    busybox/0001-hwclock-make-glibc-2.31-compatible.patch
>>>
>>> Fixes [YOCTO #13981]
>>>
>>> Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
>>> ---
>>>   ...1-hwclock-make-glibc-2.31-compatible.patch | 83 +++++++++++++++++++
>>>   meta/recipes-core/busybox/busybox_1.32.0.bb   |  1 +
>>>   2 files changed, 84 insertions(+)
>>>   create mode 100644
>>> meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch 
>>>
>>>
>>> diff --git
>>> a/meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch 
>>>
>>> b/meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch 
>>>
>>> new file mode 100644
>>> index 0000000000..8d1f272120
>>> --- /dev/null
>>> +++
>>> b/meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch 
>>>
>>> @@ -0,0 +1,83 @@
>>> +From 5b2fc5746c352eb2b27bfc9fb224580d9852d0fa Mon Sep 17 00:00:00 2001
>>> +From: Sakib Sajal <sakib.sajal@windriver.com>
>>> +Date: Fri, 17 Jul 2020 17:27:21 +0000
>>> +Subject: [PATCH] hwclock: make glibc 2.31 compatible
>>> +
>>> +NEWS for glibc version 2.31
>>> +===========================
>>> +
>>> +Deprecated and removed features, and other changes affecting
>>> compatibility:
>>> +
>>> +* The settimeofday function can still be used to set a system-wide
>>> +  time zone when the operating system supports it.  This is because
>>> +  the Linux kernel reused the API, on some architectures, to describe
>>> +  a system-wide time-zone-like offset between the software clock
>>> +  maintained by the kernel, and the "RTC" clock that keeps time when
>>> +  the system is shut down.
>>> +
>>> +  However, to reduce the odds of this offset being set by accident,
>>> +  settimeofday can no longer be used to set the time and the offset
>>> +  simultaneously.  If both of its two arguments are non-null, the call
>>> +  will fail (setting errno to EINVAL).
>>> +
>>> +  Callers attempting to set this offset should also be prepared for
>>> +  the call to fail and set errno to ENOSYS; this already happens on
>>> +  the Hurd and on some Linux architectures.  The Linux kernel
>>> +  maintainers are discussing a more principled replacement for the
>>> +  reused API.  After a replacement becomes available, we will change
>>> +  settimeofday to fail with ENOSYS on all platforms when its 'tzp'
>>> +  argument is not a null pointer.
>>> +
>>> +  settimeofday itself is obsolescent according to POSIX.  Programs
>>> +  that set the system time should use clock_settime and/or the adjtime
>>> +  family of functions instead.  We may cease to make settimeofday
>>> +  available to newly linked binaries after there is a replacement for
>>> +  Linux's time-zone-like offset API.
>>> +
>>> +hwclock had two calls to settimeofday, in functions to_sys_clock and
>>> +set_system_clock_timezone, where both the arguments to settimeofday
>>> +were valid (non-null).
>>> +Therefore, split the call, once for timezone and once for timeval.
>>> +
>>> +Fixes #12756
>>> +
>>> +Upstream-Status: Pending
>>> +
>>> +Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
>>> +---
>>> + util-linux/hwclock.c | 12 ++++++++----
>>> + 1 file changed, 8 insertions(+), 4 deletions(-)
>>> +
>>> +diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c
>>> +index dc97d8f..cf346e8 100644
>>> +--- a/util-linux/hwclock.c
>>> ++++ b/util-linux/hwclock.c
>>> +@@ -131,8 +131,10 @@ static void to_sys_clock(const char **pp_rtcname,
>>> int utc)
>>> +
>>> +       tv.tv_sec = read_rtc(pp_rtcname, NULL, utc);
>>> +       tv.tv_usec = 0;
>>> +-      if (settimeofday(&tv, &tz))
>>> +-              bb_simple_perror_msg_and_die("settimeofday");
>>> ++      if (settimeofday(NULL, &tz))
>>> ++              bb_simple_perror_msg_and_die("settimeofday: timezone");
>>> ++      if (settimeofday(&tv, NULL))
>>> ++              bb_simple_perror_msg_and_die("settimeofday: timeval");
>>> + }
>>> +
>>> + static void from_sys_clock(const char **pp_rtcname, int utc)
>>> +@@ -283,8 +285,10 @@ static void set_system_clock_timezone(int utc)
>>> +       gettimeofday(&tv, NULL);
>>> +       if (!utc)
>>> +               tv.tv_sec += tz.tz_minuteswest * 60;
>>> +-      if (settimeofday(&tv, &tz))
>>> +-              bb_simple_perror_msg_and_die("settimeofday");
>>> ++      if (settimeofday(NULL, &tz))
>>> ++              bb_simple_perror_msg_and_die("settimeofday: timezone");
>>> ++      if (settimeofday(&tv, NULL))
>>> ++              bb_simple_perror_msg_and_die("settimeofday: timeval");
>>> + }
>>> +
>>> + //usage:#define hwclock_trivial_usage
>>> +--
>>> +2.24.1
>>> +
>>> diff --git a/meta/recipes-core/busybox/busybox_1.32.0.bb
>>> b/meta/recipes-core/busybox/busybox_1.32.0.bb
>>> index 0dfdfdb549..aeea40fbc1 100644
>>> --- a/meta/recipes-core/busybox/busybox_1.32.0.bb
>>> +++ b/meta/recipes-core/busybox/busybox_1.32.0.bb
>>> @@ -43,6 +43,7 @@ SRC_URI = "
>>> https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
>>>
>>> file://0001-testsuite-use-www.example.org-for-wget-test-cases.patch \
>>>              
>>> file://0001-du-l-works-fix-to-use-145-instead-of-144.patch \
>>>
>>> file://0001-sysctl-ignore-EIO-of-stable_secret-below-proc-sys-ne.patch \
>>> +           file://0001-hwclock-make-glibc-2.31-compatible.patch \
>>>   "
>>>   SRC_URI_append_libc-musl = " file://musl.cfg "
>>>
>>> -- 
>>> 2.27.0
>>>
>>>
>>>
> 
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [OE-core] [dunfell][PATCH] busybox: make hwclock compatible with glibc 2.31
  2020-07-21 19:01     ` Khem Raj
@ 2020-07-21 19:07       ` Khem Raj
  2020-07-21 19:10       ` Sakib Sajal
  1 sibling, 0 replies; 7+ messages in thread
From: Khem Raj @ 2020-07-21 19:07 UTC (permalink / raw)
  To: Sakib Sajal, Randy MacLeod; +Cc: openembedded-core



On 7/21/20 12:01 PM, Khem Raj wrote:
> 
> 
> On 7/21/20 11:54 AM, Sakib Sajal wrote:
>>
>> On 2020-07-21 2:11 p.m., Randy MacLeod wrote:
>>> Hi Sakib,
>>>
>>> Did you check this busybox fix against musl? I forgot to ask you this 
>>> when
>>> you showed me this patch yesterday.
>>>
>>> Randy
>>
>> Yes, I built core-image-minimal with musl and everything was fine.
>>
> 
> build alone would not be sufficient, runtime testing would be required 
> too. The patch however seems ok to me. Also send it upstream to bb ml as 
> well for review

oh there already is another patch proposed here [1]

[1] http://lists.busybox.net/pipermail/busybox/2020-July/088133.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [OE-core] [dunfell][PATCH] busybox: make hwclock compatible with glibc 2.31
  2020-07-21 19:01     ` Khem Raj
  2020-07-21 19:07       ` Khem Raj
@ 2020-07-21 19:10       ` Sakib Sajal
  1 sibling, 0 replies; 7+ messages in thread
From: Sakib Sajal @ 2020-07-21 19:10 UTC (permalink / raw)
  To: Khem Raj, Randy MacLeod; +Cc: openembedded-core


On 2020-07-21 3:01 p.m., Khem Raj wrote:
>
>
> On 7/21/20 11:54 AM, Sakib Sajal wrote:
>>
>> On 2020-07-21 2:11 p.m., Randy MacLeod wrote:
>>> Hi Sakib,
>>>
>>> Did you check this busybox fix against musl? I forgot to ask you 
>>> this when
>>> you showed me this patch yesterday.
>>>
>>> Randy
>>
>> Yes, I built core-image-minimal with musl and everything was fine.
>>
>
> build alone would not be sufficient, runtime testing would be required 
> too. The patch however seems ok to me. Also send it upstream to bb ml 
> as well for review
>
Sorry, I was not clear enough, I built and booted the image and ran 
busybox ptest (glibc and musl), as well as interacted with the hwclock 
through the various combinations of options allowed through busybox 
resulting in no errors/failures.

I am currently awaiting approval to be subscribed to the busybox mailing 
list. I will send it upstream as soon as I get approved.

>> Sakib
>>
>>>
>>> On Tue., Jul. 21, 2020, 14:01 Sakib Sajal, <sakib.sajal@windriver.com>
>>> wrote:
>>>
>>>> settimeofday(2) has been deprecated as of glibc 2.31
>>>> which hwclock makes use of. This patch makes hwclock
>>>> compatible with glibc v2.31
>>>> See patch for more details:
>>>>    busybox/0001-hwclock-make-glibc-2.31-compatible.patch
>>>>
>>>> Fixes [YOCTO #13981]
>>>>
>>>> Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
>>>> ---
>>>>   ...1-hwclock-make-glibc-2.31-compatible.patch | 83 
>>>> +++++++++++++++++++
>>>>   meta/recipes-core/busybox/busybox_1.32.0.bb   |  1 +
>>>>   2 files changed, 84 insertions(+)
>>>>   create mode 100644
>>>> meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch 
>>>>
>>>>
>>>> diff --git
>>>> a/meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch 
>>>>
>>>> b/meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch 
>>>>
>>>> new file mode 100644
>>>> index 0000000000..8d1f272120
>>>> --- /dev/null
>>>> +++
>>>> b/meta/recipes-core/busybox/busybox/0001-hwclock-make-glibc-2.31-compatible.patch 
>>>>
>>>> @@ -0,0 +1,83 @@
>>>> +From 5b2fc5746c352eb2b27bfc9fb224580d9852d0fa Mon Sep 17 00:00:00 
>>>> 2001
>>>> +From: Sakib Sajal <sakib.sajal@windriver.com>
>>>> +Date: Fri, 17 Jul 2020 17:27:21 +0000
>>>> +Subject: [PATCH] hwclock: make glibc 2.31 compatible
>>>> +
>>>> +NEWS for glibc version 2.31
>>>> +===========================
>>>> +
>>>> +Deprecated and removed features, and other changes affecting
>>>> compatibility:
>>>> +
>>>> +* The settimeofday function can still be used to set a system-wide
>>>> +  time zone when the operating system supports it.  This is because
>>>> +  the Linux kernel reused the API, on some architectures, to describe
>>>> +  a system-wide time-zone-like offset between the software clock
>>>> +  maintained by the kernel, and the "RTC" clock that keeps time when
>>>> +  the system is shut down.
>>>> +
>>>> +  However, to reduce the odds of this offset being set by accident,
>>>> +  settimeofday can no longer be used to set the time and the offset
>>>> +  simultaneously.  If both of its two arguments are non-null, the 
>>>> call
>>>> +  will fail (setting errno to EINVAL).
>>>> +
>>>> +  Callers attempting to set this offset should also be prepared for
>>>> +  the call to fail and set errno to ENOSYS; this already happens on
>>>> +  the Hurd and on some Linux architectures.  The Linux kernel
>>>> +  maintainers are discussing a more principled replacement for the
>>>> +  reused API.  After a replacement becomes available, we will change
>>>> +  settimeofday to fail with ENOSYS on all platforms when its 'tzp'
>>>> +  argument is not a null pointer.
>>>> +
>>>> +  settimeofday itself is obsolescent according to POSIX. Programs
>>>> +  that set the system time should use clock_settime and/or the 
>>>> adjtime
>>>> +  family of functions instead.  We may cease to make settimeofday
>>>> +  available to newly linked binaries after there is a replacement for
>>>> +  Linux's time-zone-like offset API.
>>>> +
>>>> +hwclock had two calls to settimeofday, in functions to_sys_clock and
>>>> +set_system_clock_timezone, where both the arguments to settimeofday
>>>> +were valid (non-null).
>>>> +Therefore, split the call, once for timezone and once for timeval.
>>>> +
>>>> +Fixes #12756
>>>> +
>>>> +Upstream-Status: Pending
>>>> +
>>>> +Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
>>>> +---
>>>> + util-linux/hwclock.c | 12 ++++++++----
>>>> + 1 file changed, 8 insertions(+), 4 deletions(-)
>>>> +
>>>> +diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c
>>>> +index dc97d8f..cf346e8 100644
>>>> +--- a/util-linux/hwclock.c
>>>> ++++ b/util-linux/hwclock.c
>>>> +@@ -131,8 +131,10 @@ static void to_sys_clock(const char 
>>>> **pp_rtcname,
>>>> int utc)
>>>> +
>>>> +       tv.tv_sec = read_rtc(pp_rtcname, NULL, utc);
>>>> +       tv.tv_usec = 0;
>>>> +-      if (settimeofday(&tv, &tz))
>>>> +- bb_simple_perror_msg_and_die("settimeofday");
>>>> ++      if (settimeofday(NULL, &tz))
>>>> ++              bb_simple_perror_msg_and_die("settimeofday: 
>>>> timezone");
>>>> ++      if (settimeofday(&tv, NULL))
>>>> ++              bb_simple_perror_msg_and_die("settimeofday: timeval");
>>>> + }
>>>> +
>>>> + static void from_sys_clock(const char **pp_rtcname, int utc)
>>>> +@@ -283,8 +285,10 @@ static void set_system_clock_timezone(int utc)
>>>> +       gettimeofday(&tv, NULL);
>>>> +       if (!utc)
>>>> +               tv.tv_sec += tz.tz_minuteswest * 60;
>>>> +-      if (settimeofday(&tv, &tz))
>>>> +- bb_simple_perror_msg_and_die("settimeofday");
>>>> ++      if (settimeofday(NULL, &tz))
>>>> ++              bb_simple_perror_msg_and_die("settimeofday: 
>>>> timezone");
>>>> ++      if (settimeofday(&tv, NULL))
>>>> ++              bb_simple_perror_msg_and_die("settimeofday: timeval");
>>>> + }
>>>> +
>>>> + //usage:#define hwclock_trivial_usage
>>>> +--
>>>> +2.24.1
>>>> +
>>>> diff --git a/meta/recipes-core/busybox/busybox_1.32.0.bb
>>>> b/meta/recipes-core/busybox/busybox_1.32.0.bb
>>>> index 0dfdfdb549..aeea40fbc1 100644
>>>> --- a/meta/recipes-core/busybox/busybox_1.32.0.bb
>>>> +++ b/meta/recipes-core/busybox/busybox_1.32.0.bb
>>>> @@ -43,6 +43,7 @@ SRC_URI = "
>>>> https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
>>>>
>>>> file://0001-testsuite-use-www.example.org-for-wget-test-cases.patch \
>>>> file://0001-du-l-works-fix-to-use-145-instead-of-144.patch \
>>>>
>>>> file://0001-sysctl-ignore-EIO-of-stable_secret-below-proc-sys-ne.patch 
>>>> \
>>>> + file://0001-hwclock-make-glibc-2.31-compatible.patch \
>>>>   "
>>>>   SRC_URI_append_libc-musl = " file://musl.cfg "
>>>>
>>>> -- 
>>>> 2.27.0
>>>>
>>>>
>>>>
>>
>> 
>>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-21 19:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-21 18:00 [dunfell][PATCH] busybox: make hwclock compatible with glibc 2.31 Sakib Sajal
2020-07-21 18:11 ` [OE-core] " Randy MacLeod
2020-07-21 18:54   ` Sakib Sajal
2020-07-21 19:01     ` Khem Raj
2020-07-21 19:07       ` Khem Raj
2020-07-21 19:10       ` Sakib Sajal
2020-07-21 18:32 ` ✗ patchtest: failure for busybox: make hwclock compatible with glibc 2.31 (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox