From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id B0D1B3858C41 for ; Tue, 16 Jan 2024 11:19:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B0D1B3858C41 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B0D1B3858C41 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705403961; cv=none; b=UHo4l7rwocjqlPfrjFYi0hAIvTu132aEFCtN6QizI2g6Rg0YfAb/5oWK2pfuMfcwyE/AeprIfUaI/Pq2ta8t0dpOsismzfU1QJI2/LgxondJzUr2Z9TUnA8jxW6q+gGB7bXtkSdc5zF9U9oJtZ9XvmReSS8PNtRceFKi5UTiz1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705403961; c=relaxed/simple; bh=jSLhm7SlBA6ElInk6VqiWNpjYdojAwsdhIfkgD6QOsk=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=UjIIlFgnl47ve61P/0rbryk7hC8K9BmFaudFLFe8VbJ1LjC3IPDhplRcXcPDFbECob6w9ni3L0bGi6qlgsSDSgKrXui5MhZzZRzSxShXc2+8+aXhiQ91qLaeFBceA0VTpwfD7vtlTYFTaZS/vJNUTJyLM2/KNY6WJnEhih8/mlw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1d5f38313f9so559605ad.1 for ; Tue, 16 Jan 2024 03:19:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705403950; x=1706008750; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=IW/5DIe/KTBSuto206ug66jHHPKjqlM2W48fABdfOrY=; b=B2J2RskoXBqg7TsqC+cgs+kLgH/SNczXyeXZt0jXb+e+hlq0aNCL2/W4GuG8B9omsI m7r3dV1nTAOPuemV/5V55uYJckpuAVvy6MNM/AXJOF57SuOPrnqP3s8wILw93BXmhNqx Yx7qXFmlDGLTJtUw2RQ8nMk28UJRymfG9+2m8pPr2/yPDoSW0WAa9uNLsWABY0h+YAXx 38RulfdgUFeFxxofJNJ8BJ3YvlEYxNVdZL6wBVNNSBlrYeHsDmmwteKIfdJLdllppsXG qBBD+m1Yy6dj9K/FMxZFmPdUPc1GfObr+0Q6dJv0zhoXfVeAvJX9aaTj9jhT+WHIMhTx RP8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705403950; x=1706008750; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IW/5DIe/KTBSuto206ug66jHHPKjqlM2W48fABdfOrY=; b=Ai88IgB1yeqmHSDTlnMmTbzA/vKPtOcNhq6HdSYbv9B1GqKqwO6yMIgO6cJGdwQ/sZ J4JMsbP62bKBhiqx7QTQxi6RgfdJ/zvJFLrnt/EJYXiltpWs8/qBHdmSuCiyiR27WIO8 fkbw65JVKo1tD8h5UxYn5tjP+HQjBlWOp9Z58N25uwYPv4XEbCOQYjaAiyC/MDzxNLu1 xXD9wv8mYBnFh2krAzJPtS+viZ2iOkGdllqiEsXD1nVeQEtL0yWPaOgt2W8uLW+qYeju vUJjcoWFSUeMd34VjDscgtojhGmvS8+6kdlyryfgdv+Xoc6uSlRq8H8CGiAGYHg1KKaU 5vkw== X-Gm-Message-State: AOJu0YyGgMULr6+BhqusPdo7mBiMhucSeb+6rnCss6pwazdUSSa+zs9v /vL3M/8s6eymNQWcle+B2jVvVVOzmCT5ZQ== X-Google-Smtp-Source: AGHT+IFOkg7j4vEpZSlD/KsZWzbuytrY3UloQZ8chCfYAIEckDwqBzUCLq05riDmQCE0uyYDzXSEmg== X-Received: by 2002:a17:902:db0c:b0:1d4:2bae:49f with SMTP id m12-20020a170902db0c00b001d42bae049fmr10989352plx.26.1705403949713; Tue, 16 Jan 2024 03:19:09 -0800 (PST) Received: from ?IPV6:2804:1b3:a7c2:2787:344c:b1eb:d47b:fe5e? ([2804:1b3:a7c2:2787:344c:b1eb:d47b:fe5e]) by smtp.gmail.com with ESMTPSA id m18-20020a170902db1200b001d55fa244afsm9068441plx.207.2024.01.16.03.19.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Jan 2024 03:19:08 -0800 (PST) Message-ID: Date: Tue, 16 Jan 2024 08:19:05 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: 64 bit time_t on riscv32 Content-Language: en-US To: Rich Felker Cc: Florian Weimer , Antonios Salios via Libc-help , Antonios Salios , Jan Henrik Weinstock , =?UTF-8?Q?Lukas_J=C3=BCnger?= References: <877cka7m09.fsf@oldenburg.str.redhat.com> <111c4bfb-bc58-412e-9a37-a5c2ed7f0e3c@linaro.org> <20240115222648.GO22081@brightrain.aerifal.cx> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <20240115222648.GO22081@brightrain.aerifal.cx> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 15/01/24 19:26, Rich Felker wrote: > On Mon, Jan 15, 2024 at 04:55:30PM -0300, Adhemerval Zanella Netto wrote: >> >> >> On 15/01/24 10:40, Florian Weimer via Libc-help wrote: >>> * Antonios Salios via Libc-help: >>> >>>> According to a kernel maintainer, the __USE_TIME_BITS64 macro should be >>>> set on architectures that use 64-bit time [2], otherwise the kernel >>>> headers will not be able to pick the correct definition. >>> >>> __USE_TIME_BITS64 is an internal glibc macro. It is not used on >>> architectures which have a 64-bit time_t by default. >>> >>> Surely the UAPI headers know which time size the architecture uses in >>> the kernel interface, and can be written arcordingly? >> >> The use of a glibc internal definition on a kABI header is not really >> a good design. This seems to be only user so far, so I suggest to fix >> on the kernel to not tie to a glibc internal definition. >> >> CCing Rich from musl that most likely would want to see this fixed. The >> Android developers might be interested. > > At the time this was done, I understood __USE_TIME_BITS64 as the > contract between the userspace implementation and the kernel uapi > headers to say "we use 64-bit time_t and want the 64-bit version of > the types/ioctls/etc." That's what musl does -- we always define > __USE_TIME_BITS64, unconditionally. I haven't read this whole thread, > but it sounds like glibc's rv32 port is breaking their own contract > and not defining __USE_TIME_BITS64... My understanding was __USE_TIME_BITS64 would be required only for ABIs that actually would multiple time_t sizes and the glibc 64 bit time_t supported was added on this assumption. However, the design document does state __USE_TIME_BITS64 would be defined even for architectures where is does not require it. I it was not really caught in development because the design creator was not really much involved at the time. I think it should be feasible to fix it, although backporting it would generate a quite large patch.