From patchwork Mon Jan 6 23:05:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nadav Tasher X-Patchwork-Id: 2030451 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=mpDU7gA4; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=patchwork.ozlabs.org) Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4YRqZ31mXmz1yPH for ; Tue, 7 Jan 2025 10:06:48 +1100 (AEDT) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id C92AB35207F0; Tue, 7 Jan 2025 00:06:37 +0100 (CET) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=mpDU7gA4; dkim-atps=neutral Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by helium.openadk.org (Postfix) with ESMTPS id A224E35207D6 for ; Tue, 7 Jan 2025 00:06:03 +0100 (CET) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4361815b96cso99431475e9.1 for ; Mon, 06 Jan 2025 15:06:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736204763; x=1736809563; darn=uclibc-ng.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=PVWBnU9TW0ALDX4EwYuq8iZx6lUzYpWMRWYqHvT/cKY=; b=mpDU7gA4qR05Gt/K4mEkuhQe8iFZV09M/2H6TAXdTR9xu0GM4RvxC/6EHmYVmsMklF jpPrkAcj75drlT0PFWNfiL9Ojqjdhq5eg7CfEjVZpqUxx01g2Z4rMvGJCIj32rQ26xEN dewb39LqO3uCJMSZnyW011ho6iSLGEt6Hq+udcd8f2gGzYuDXCbNozQXTYsIoKHt4reS FJEFm3w736BxR+yGJQzK/AeSADaU7KiV4PVUUm4tx4+VJOarq25I2qCJmo3Pf7GctQEu 26jLw7WbKKPHROym+C9+Li7A/eqOePtqCuvlUTLOvLajCNM/28OqVhdxCJyjW1gdRlB7 1urw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736204763; x=1736809563; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PVWBnU9TW0ALDX4EwYuq8iZx6lUzYpWMRWYqHvT/cKY=; b=X5JakgDluxjYui6Pw9JhZWGs17OrvX9nOX3LExFSC3iVc/yvoqNPv0aVS3s9cDI4nC iWUmQyCY4TyIQ7CnsmmOhptz2eUp1TBdWKEvWqzawOHESkzR1r6pdhgCtwgEAFAuhN3I m4mzod4/PaZrgKIvoabxy1V87Gh8ta2o+rzCZndpPfW/nxZKCmVnk2J7GeU5h8rDlDpo 9DT5vz5xEquqt5TZuIFzWo3inCNEjM2PFYNPVcW2qofR+XfjX9PMT4kZfMt6SnnQ3/rb HaS+r6YHZ078JjpYAx+l28KJClZlcNXAvIMVJukqwRnVG6i4GgYnj9GEnkTPCgSxGPiX DtFg== X-Gm-Message-State: AOJu0Yyt5oBIpxdDCIc9Ky2Ud15B2/H4Itn34HYSidLNM7PIOSWOezsU MRi+hgGkezrG31+N2ljNwxqQeWtz8fb31codnBye3S9hK4EDPGyoBzxhYA== X-Gm-Gg: ASbGncvADOMsDVkT/BsDE//jEuB47OxDuResNaqqTgsqrLAQblOksLX09Zz9GRq+Txd ycjbKhhaYWayAaG6AVtUHHiIeiraESNooo7KFACOFn/2zjc8U5iksBWNfM6a/bSUaYhWWMpDv23 6Vt+rUKjYIeH9woe8D70Nt5P3zAGqvJsPTdrVasW8C4/VkgUJDFz7syluE5K3JSUaGejBcvyNRK Ycdk7io+xlLZ368IM7lTxvQ0t4PjT3IulBkbpL1GD6PsLcp85DdE0I= X-Google-Smtp-Source: AGHT+IEwv8fHzJJhjx+AtKsEnI96hjjKOplp4FCEbv6rvO3riFncNwz/7NoQByjwbz2nOKKKeM64HA== X-Received: by 2002:a05:600c:3b23:b0:434:feb1:adcf with SMTP id 5b1f17b1804b1-43668b5f3b7mr445281895e9.25.1736204762362; Mon, 06 Jan 2025 15:06:02 -0800 (PST) Received: from nadav-nuc ([87.71.187.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43656b3b287sm612057125e9.29.2025.01.06.15.05.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 15:06:00 -0800 (PST) Date: Tue, 7 Jan 2025 01:05:58 +0200 From: Nadav Tasher To: Waldemar Brodkorb Message-ID: References: <20241219211007.489433-1-tashernadav@gmail.com> <20241222201157.3545978-1-tashernadav@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Message-ID-Hash: Y35EINWINS6PIVFHVMHNWUQVRAQOBTR7 X-Message-ID-Hash: Y35EINWINS6PIVFHVMHNWUQVRAQOBTR7 X-MailFrom: tashernadav@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: devel@uclibc-ng.org X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] Re: [PATCH] features.h: error out when attempting to compile with TIME64 for 32bit targets on Linux versions prior to 5.1.0 List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Waldemar, I have come up with a different approach to solving the original issue. Instead of having this check in the `features.h` header file (which is included by other projects), adding this check in a more internal header file (which is not included by other projects) results in the same outcome, which is a human-readable error regarding kernel version. I have attached two new patches to revert the previous changes and reintroduce them in the `time64_helpers.h` header file. From 0a617666dc18ebe7063ff625907341479863c443 Mon Sep 17 00:00:00 2001 From: Nadav Tasher Date: Tue, 7 Jan 2025 00:51:16 +0200 Subject: [PATCH 2/2] time64_helpers.h: error out when attempting to compile with TIME64 for 32bit targets on Linux versions prior to 5.1.0 Using 64bit time on 32bit targets was only introduced in Linux 5.1.0. On versions prior to that, compiling uClibc-ng produces incorrect headers that cause the `clock_nanosleep` syscall to receive incorrect arguments. This change was previously introduced in `features.h`, but was reverted due to inclusion errors when compiling other projects. Signed-off-by: Nadav Tasher --- include/internal/time64_helpers.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/internal/time64_helpers.h b/include/internal/time64_helpers.h index 2284aacd9..e2ed0f3bb 100644 --- a/include/internal/time64_helpers.h +++ b/include/internal/time64_helpers.h @@ -1,10 +1,15 @@ #ifndef _TIME64_HELPERS_H #define _TIME64_HELPERS_H +#include #include #include #include +#if defined(__UCLIBC_USE_TIME64__) && __TARGET_ARCH_BITS__ == 32 && LINUX_VERSION_CODE < KERNEL_VERSION(5,1,0) +#error 64bit time on 32bit targets is not supported on Linux < 5.1.0 +#endif + struct __ts64_struct { __S64_TYPE tv_sec; __S64_TYPE tv_nsec; -- 2.34.1