From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 546682BAC4 for ; Sun, 3 Mar 2024 15:36:25 +0100 (CET) Received: (qmail 7681 invoked by uid 550); 3 Mar 2024 14:32:36 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 7643 invoked from network); 3 Mar 2024 14:32:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709476573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RXCAVlorRILnQ9MBMYghM9LTBIY/5mUcy2sqCiiDv44=; b=pcWFloS4PFmCKGjZQJ/IDRK0kSLoOLwCLdPaXWZf7twVPbwZJmdzVWTXrDKoAp6doCCNj4 DQrjtGBuvNZA2iiadwmQIWZ9Oz/hOW2nORQHSAgKYyR0x98keXIhV6Sg5QyVonRGHIYc8r irP4KW2Fj1hoZGFKkTceDRSpfdcY0q5z1BmAfRiREhg3mWQh9h9cTCtStpLpDmwKNhtV3T od/V8RvBJ2HbJaRt8aObTxzhtcA1PpuP98oby1HOanIdthvWAF4y/q/f4BrEvC6JWrO15G 0GW3XJ3I9a/u2MIbyF5463e34B6PCNWwn0346g6mICnSuxI6Qv1oEuUFJiNz2w== Date: Sun, 3 Mar 2024 15:36:11 +0100 From: Thomas Petazzoni To: busybox@busybox.net, musl@lists.openwall.com Cc: Waldemar Brodkorb Message-ID: <20240303153611.604aa33b@windsurf> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-Sasl: thomas.petazzoni@bootlin.com Subject: [musl] Busybox hwclock failing to build with musl RISC-V 32-bit: SYS_settimeofday undefined 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, Thomas -- Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com