Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sun, 7 Apr 2024 22:18:43 -0400
From: Rich Felker <dalias@...c.org>
To: Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Cc: busybox@...ybox.net, musl@...ts.openwall.com,
	Waldemar Brodkorb <wbx@...nadk.org>
Subject: Re: Busybox hwclock failing to build with musl RISC-V 32-bit:
 SYS_settimeofday undefined

On Sun, Apr 07, 2024 at 07:18:48PM +0200, Thomas Petazzoni wrote:
> Hello,
> 
> The recently released musl 1.2.5 includes 32-bit RISC-V support. Turns
> out that building Busybox 1.36.1 with this new musl version, on 32-bit
> RISC-V, fails with:
> 
> util-linux/hwclock.c: In function 'set_kernel_tz':
> util-linux/hwclock.c:142:27: error: 'SYS_settimeofday' undeclared (first use in this function); did you mean 'xsettimeofday'?
>   142 |         int ret = syscall(SYS_settimeofday, NULL, tz);
>       |                           ^~~~~~~~~~~~~~~~
>       |                           xsettimeofday
> util-linux/hwclock.c:142:27: note: each undeclared identifier is reported only once for each function it appears in
> 
> Busybox already includes some slightly convoluted sorcery to deal with
> musl:
> 
> static void set_kernel_tz(const struct timezone *tz)
> {
> #if LIBC_IS_MUSL
> 	/* musl libc does not pass tz argument to syscall
> 	 * because "it's deprecated by POSIX, therefore it's fine
> 	 * if we gratuitously break stuff" :(
> 	 */
> #if !defined(SYS_settimeofday) && defined(SYS_settimeofday_time32)
> # define SYS_settimeofday SYS_settimeofday_time32
> #endif
> 	int ret = syscall(SYS_settimeofday, NULL, tz);
> #else
> 	int ret = settimeofday(NULL, tz);
> #endif
> 	if (ret)
> 		bb_simple_perror_msg_and_die("settimeofday");
> }
> 
> I am not sure whether this is a Busybox problem or a musl problem,
> which is why I'm cross-posting on both mailing lists.
> 
> Thanks a lot in advance for your feedback,

You sent this exact email before on March 3, and I answered it then:

https://www.openwall.com/lists/musl/2024/03/03/3
https://www.openwall.com/lists/musl/2024/03/05/4

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.