From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id 8DE253858D37 for ; Mon, 18 Mar 2024 11:42:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8DE253858D37 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 8DE253858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::629 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710762140; cv=none; b=I/vhzsdLPCxoX8GSI4pK/nhJqGeZYNUP9y706V3QMBEydrZnsz0Qbmxlxh7DtS1OTEKuGWz0kSRyfDAh+EQArsz6vr3KRxh23MDW0JdjKMY1S8ovvsUiqr8urvokiYo3UZXDhG8jzVW0I67UWuWrgQnzyKGrnUI91+BLipBVmv4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710762140; c=relaxed/simple; bh=/E3TV1YamH+n6Lr3Uwg5ER6Vwv30JkOyXOdK6d2eURE=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=TrvyWfeYxcwXgxaMkeul+fU37o1h/MyA3QcJ9nr3rSFPLxgWbf7p9pwiHPf6Y9ylG+cTR5xp4ITSU3ZR6rb3b7xgc1jPmXi9oFXTbW5r5DyxXVS/eEZh3ut4zuwL6PK1aXXcmKSuuHDAXdw0lsHzQQAF4YVoALIp3lSgRf+7Wr4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1e00b1c2684so9324435ad.0 for ; Mon, 18 Mar 2024 04:42:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710762133; x=1711366933; 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=PE17//EJNtgROtOVWdD9rlmau8sB0TYwaHzwLPkySGg=; b=eBAEtjAXhX6M/HjEE3AZYWZ1HpyJBBiLVqSbrhHIYu9GNPAl1bztdNIjy/095oy9+8 Qs/0YhOvaGGCcwb+tPKAqbMHiqCiRLuOuFGIbdPB1zLkr58D5byTbqSTRhVN4uEtC73/ e2yhX0gdZGkrc2IofltKdJb7Pl/cd1+8n4X4bcL8I2NNzvNoIRFR1FyCHUD0/nX6Z50N XiWVM8EE7H7Y6DIQKuCRE8tRJpc0hWL/DntVKdPzMgtE9OaIilxUXygvbtoGkV92FRGV dytqxQNmRTswR4NhfBqRXypnYA50+mqisJzjcZOElVViWvTknQX9SRJd/pJ1d/MxzR22 6wTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710762133; x=1711366933; 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=PE17//EJNtgROtOVWdD9rlmau8sB0TYwaHzwLPkySGg=; b=ok4zuDeCpOKpRr8ppVTmr9ZGOc03GEashKNFGV8utYuGuA19+U6MQ3SefdL7QtDvyi vYKroUAd90Rd7t5yUp4gziAmSJX5deM/+F0mxDuJ7tKUH5nruFx/nh4cOBIXTFuGXAnL x1BCUhMcZCbLtn94TE1vmyW2p4xLmfKqZ5OuQNFOB2rb9gqCS9t7E4Fz4MKVu3HkmKKM 7UsSNQlfk4f4pfJv2ONtJmODGTpoX1ExJ8M7mUVq3rGj91C1BrZ0uuCYOD3yHC4gIGrW v9tW3P+/hFXnxVjADZlSeGqMbymsN8teNruYtbIDB7AAXpmMWmD+HkU+MsN0oIU9dBEA k+4g== X-Gm-Message-State: AOJu0YyeEzPSIE8doh0lFlYEXUp21cfJbpj6j4LaizZszJQ+FvbdWul4 M7OPDi8OX1ixR0Pvn7v4tKGmJ4HB0O7hcB+AQcsf7QQ2jBWcCKTc98nYsldPHj0= X-Google-Smtp-Source: AGHT+IGOzOtVffsNef/kSw4IlpW73ssK346/LmgZ/elInXlq9iv+WZycNfPstJbgADMlj8OlcOYbQA== X-Received: by 2002:a17:903:4281:b0:1dd:e115:336c with SMTP id ju1-20020a170903428100b001dde115336cmr10812698plb.69.1710762133419; Mon, 18 Mar 2024 04:42:13 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c2:8dfd:69e5:10f4:c28c:8fbb? ([2804:1b3:a7c2:8dfd:69e5:10f4:c28c:8fbb]) by smtp.gmail.com with ESMTPSA id mi16-20020a170902fcd000b001dd578121d4sm9062734plb.204.2024.03.18.04.42.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Mar 2024 04:42:12 -0700 (PDT) Message-ID: Date: Mon, 18 Mar 2024 08:42:10 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] Always define __USE_TIME_BITS64 when 64 bit time_t is used Content-Language: en-US To: DJ Delorie Cc: libc-alpha@sourceware.org References: From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham 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/03/24 18:33, DJ Delorie wrote: > > Fun stuff first... > > Adhemerval Zanella writes: >> diff --git a/manual/maint.texi b/manual/maint.texi >> >> +When @code{__TIMESIZE == 64} is set, @theglibc{} will also define the >> +@code{__USE_TIME_BITS64}. It is used by the Linux kernel ABI to set the >> +expected @code{time_t} size used on some syscalls. > > This part seems OK. > >> +Also, to define whether >> +the declarations are expanded to 64-bit @code{time_t} symbols (since not >> +all ABIs do require such expansion), @theglibc{} will also define >> +@code{__USE_TIME64_REDIRECTS}. > > This part doesn't match the code, because it's in the __TIMESIZE==64 > section, and the code only sets it when __TIMESIZE==32: > > #if defined __USE_TIME_BITS64 && __TIMESIZE == 32 > # define __USE_TIME64_REDIRECTS 1 > #endif > > Perhaps you were thinking of _TIME_BITS==64, which is defined elsewhere? > > _TIME_BITS is defined in creature.texi as a user-defined feature test macro... Right, I will move it to creature.texi. It makes more sense, since it should be a user-visible macro (albeit in the implementation-defined namespace). > >> diff --git a/sysdeps/unix/sysv/linux/features-time64.h b/sysdeps/unix/sysv/linux/features-time64.h > >> # if _TIME_BITS == 64 >> # if ! defined (_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64 >> # error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64" >> -# elif __TIMESIZE == 32 >> -# define __USE_TIME_BITS64 1 >> # endif >> +# define __USE_TIME_BITS64 1 > > If the user asks for 64-bit time, we honor it, whether __TIMESIZE is 32 > or 64. Ok. > > If the user asks for 32-bit time, we allow it, but need do nothing. Ok. > >> # elif _TIME_BITS == 32 >> # if __TIMESIZE > 32 >> # error "_TIME_BITS=32 is not compatible with __TIMESIZE > 32" >> @@ -34,4 +33,10 @@ >> # else >> # error Invalid _TIME_BITS value (can only be 32 or 64-bit) >> # endif > > This is for when _TIME_BITS is not set: > >> +#elif __TIMESIZE == 64 >> +# define __USE_TIME_BITS64 1 >> +#endif > > So if the user does not specify _TIME_BITS, we default to 64-bit kabi > for 64-bit time_t. OK. > >> +#if defined __USE_TIME_BITS64 && __TIMESIZE == 32 >> +# define __USE_TIME64_REDIRECTS 1 >> #endif > > If we want 64-bit time_t (for any reason) but the default time_t is 32 > bits, we need the redirected functions et al. Ok. > >> diff --git a/sysdeps/generic/features-time64.h b/sysdeps/generic/features-time64.h >> /* The generic configuration only support _TIME_BITS=32. */ >> +#define __USE_TIME_BITS64 0 >> +/* The following macro defines whether the 64 time_t redirects will be >> + used for 64 bit aware symbols. */ >> +#define __USE_TIME64_REDIRECTS 0 > > So the default for non-linux platforms is to not do any of the linux > magic. Ok. > > And now for the mechanical part... > >> diff --git a/io/bits/poll2.h b/io/bits/poll2.h >> . . . >> diff --git a/time/time.h b/time/time.h > > They're all good :-) >