From patchwork Wed Aug 5 08:03:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Goergens X-Patchwork-Id: 60585 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 993644BB1C12 for ; Wed, 5 Aug 2026 08:07:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 993644BB1C12 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=p9SBPvZR X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id A55FC4BAE7E0 for ; Wed, 5 Aug 2026 08:03:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A55FC4BAE7E0 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A55FC4BAE7E0 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::432 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785916988; cv=none; b=Z9z8ckt//9n8rsk2AG64s6ksOgq0ZgFlnQW0LtGjI8RyHwIGmAfJN6sOHQqjNGqJCbWa7a2+WYLnlKjEngI1hUWgIpNuS9m8r+2qL8lW89ifpYJ8RKyyuEdvl/A55IPq7hsFF1wYm9GnUW/i1dFOrcMOnWBkLGrXIPthSHn2Byw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785916988; c=relaxed/simple; bh=Wk4/9giI961yN0xxNt2mbChq/K37ohvLw7GaysW5jQE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=UjvWB7rWRaApKsubEkji4klS+Yd741uFrKq06IaxfqNqhi9Pj6YpjZdjdMRbC2r8OQN2PLzpSrMWevf5/KOq+pzCJB9LFzlv3MNEPxkUMuVbgGkSKtEq8asgvb+LN9aaFL71nrvB6W0Ynp2h8crmQYVdWhzvMgSeahSdM0xD9ec= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=p9SBPvZR DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A55FC4BAE7E0 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-8485ef63b68so1035170b3a.1 for ; Wed, 05 Aug 2026 01:03:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785916988; x=1786521788; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=WczdzhEVzUUMtv9CDke5AH3Vc/iCP26zMw9lOF0uhM8=; b=p9SBPvZRihc6tHLWXqL8xpAwQZqrwfIFC2g/O9nvC51miz455+393Xr51Qh9rmwKYW qLHfoWpGoxYbFHRGsqj9t0/GwqpVZPRhRgiDrttCwev8FPftf+UA3P5zcl0fw2Nr0lCl KHkZe20a0DlcyF8F2VMziMDuZ2gVUZ6mrqAaEyOk5DlfUngG3lFLHrjJndxkZ38280LU FsyHIpsWzftUEnJeJrKNjvunE9u8gtAqEFzeQr2c3dA1Co79lKKY++FCqjpACg0+ayRl 0Qi4bHJrSPx6M0seZMghu9sfwYKQPpQHw653cDMYsq9m9XZQuORqYMBVSUCTuu1uLkVx wFSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785916988; x=1786521788; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=WczdzhEVzUUMtv9CDke5AH3Vc/iCP26zMw9lOF0uhM8=; b=Pv+kNcfV4y7SlTw04yhvBwkYKg+Vjnt5ZmozpamN7EcoCrjecQncZKtH5KsU5C0iEl K+szFYmM5o/egYez+tLn6f3WTsIccqThcx/2xe/6VslkjVTK1mLZv4TgPypeVOYMWQUQ 6w4Fv2K4UmKc0XgQx6idUouHUuJ1Pk4Cm5rmmRvgdulBBU0VEX4O5wpYuhJFhSBcb1ix FFX3pwpPshk4AKOqYEIWTPgaQYwfdwfVJ6auVmb3376yX8T/sxpmVyQmXAY2dWGYbqjK iNx+XC3wrBicpU7qixTlPtZyyhFCVkNEzMAWoEyIpIObVHIWH6izF3tCXBcxuJPVsYTk 8cBw== X-Gm-Message-State: AOJu0YxdF6G63MEAGL9tENCv5IVCBMX4ov/orV8cjv5c4YL+eBTOiEIU uMGjaSZ1y+rdmhS5cTE7HD8Nwrkdk5mDDgqhr8QtxlpYo6txr3GH2TT0tU1ta+bI X-Gm-Gg: AR+sD116o+llECmGehgInT4BLRRnJUFjiEPW5Ia1j04o0aEQEPMp91b26AVBIMtLERU sy0IfURm26gvqlvx++65LZQa+WI6cLzs4OvS4dE7Gq7bIJj+9fhFfdLX7XJIrc+B3UwIfzdMRoX YamDQewoIezY5P8W7TAKJAV3hJ/K8n+yFn3t0dHwWVHpYlk0wbBYJ2zkfvcaAaHUeHt0kBuOWfE jMb6fUvTN8HzaiJ9o+rhj/UBcKfE90aqO3F/JLr1F6Bt9shU2cTwY86GmhQr2g1Gk8iHk1l5+Bm XCy266FGpsBDDTCOUW8k64QVJ1NeaxrF5L2OxpB1HP+9STj8uRamVdnbr0u/W7kFr8Oi8VSBuWA ANDcNigRuAO0g2G0UvxjwO/klbAUD0j0WPGMS8BNdsPkjTs+3BWn6oadLYRc1HAVdmaFt6sYNGx E5w/pUVOYfPXjkcIOj7JfqAKvGXWvcyk6eYsmZME7hjWaaCIQh0GMFSO8xx1OvS8+l7jTT55Bxy CZ78VfIxhvY7RfbbwyLrdsRpTqZih/5XCMBLR6PM9RTPaInX8yEv3bDo21OuUOedd7TBuTRH9x0 v6X7zBZOkefsbNMvsHVnDEhP8vhrT9F/UcIWDPuFyL5xm99D9ScA X-Received: by 2002:a05:6a20:72a4:b0:3bf:9142:ba3a with SMTP id adf61e73a8af0-3cb85ef7460mr5419658637.26.1785916987550; Wed, 05 Aug 2026 01:03:07 -0700 (PDT) Received: from spider.bream-herring.ts.net ([103.252.203.158]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cbe707cab37sm973517a12.7.2026.08.05.01.03.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2026 01:03:07 -0700 (PDT) From: Matthias Goergens To: libc-alpha@sourceware.org Cc: Matthias Goergens Subject: [PATCH 0/2] linux: Keep time64 stat layout independent of feature macros Date: Wed, 5 Aug 2026 16:03:02 +0800 Message-ID: <20260805080304.3535401-1-matthias.goergens@gmail.com> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Bug 32119 reports that feature-test macros change the public time64 struct stat layout on 32-bit targets. The series separates two causes. Patch 1 includes the endian definitions used by the shared helper. Without them, strict pre-POSIX.1-2008 modes select big-endian timestamp ordering on little-endian targets. This is an unambiguous layout bug. Patch 2 removes two trailing reserved words which the helper exposes only in those strict modes. History shows that they were imported accidentally when the public and internal time64 declarations were consolidated. The stat implementation does not write them, and the default public and internal layouts omit them. Patch 2 nevertheless changes sizeof(struct stat) for 32-bit objects already compiled with both 64-bit time and strict pre-POSIX.1-2008 feature macros. Please advise whether preserving that niche accidental layout is required by glibc ABI policy. Patch 1 is independent if the size correction is unsuitable. An i386 build and the io tests pass. The regression compares timestamp offsets and sizes across translation units built in default and POSIX.1-2001 modes. Compile-time layout models also pass for 32-bit Arm, PowerPC, and MIPS; these models are supplementary and are not full cross builds. I do not have an FSF copyright assignment on file. This series is offered under the Developer Certificate of Origin 1.1, as certified by the Signed-off-by line in each commit. Matthias Goergens (2): linux: Fix time64 stat nanosecond layout in strict modes linux: Keep time64 stat size independent of feature macros [BZ #32119] io/Makefile | 15 +++++++ io/tst-stat-layout-time64-legacy.c | 41 +++++++++++++++++++ io/tst-stat-layout-time64.c | 38 +++++++++++++++++ .../linux/bits/struct_stat_time64_helper.h | 5 +-- 4 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 io/tst-stat-layout-time64-legacy.c create mode 100644 io/tst-stat-layout-time64.c