From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id 144A53858D39 for ; Tue, 28 Dec 2021 21:53:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 144A53858D39 Received: by mail-pl1-x632.google.com with SMTP id i6so8454895pla.0 for ; Tue, 28 Dec 2021 13:53:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/yfPGT1vR+CiyRfhu3WFwsgo1khmDBNMs7+UBjbRulA=; b=056w6dhBXKbqYcHNpStrLwhQjV366vPtdJoL2CdEGZir+9c9mdNcBzO4IY87WxrBCR ldZ1JfOxNUDnLBzO0ar4YPNC7r6robQ0X/SX3BtB/Y1ziYOzkPaUKZaqOTmuua6/Rvqf TJ2eCNmNWWIT4NzRyPMaI908O0Ai2BW49js1wXPCSEiaRxW4UWzs6zvXYfQImM5l1cGt etzNVvln4X8XcZlrB7XqOcVIyYVfWXUzPM5wE1Hqscu4FxfxNuz8066ObfM03iodTq64 5C75flDx6/M8KsG9exUqPz3SLvHU9d1groKmOHkzu1t6EoaUS1SnD6r9mbkRuZVLda7K +SBQ== X-Gm-Message-State: AOAM530tY/U3WiFakpFW7y0+p5JwpQBZqXHbO5sJOy53aNICVl2Rwqs6 PrSj3qVk/WmEMISKx7uRLRNfE6/jNt8= X-Google-Smtp-Source: ABdhPJxhSU7zw7Mwj3Pz9lAGME3ZkL5e8utbA0QsO+AY2PxMNco7I8V30iyXC49RWjTUJTgaQNrGHA== X-Received: by 2002:a17:903:283:b0:149:3523:3d8e with SMTP id j3-20020a170903028300b0014935233d8emr24097936plr.75.1640728405214; Tue, 28 Dec 2021 13:53:25 -0800 (PST) Received: from localhost ([2409:10:24a0:4700:e8ad:216a:2a9d:6d0c]) by smtp.gmail.com with ESMTPSA id p15sm7607469pfh.86.2021.12.28.13.53.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 13:53:23 -0800 (PST) Date: Wed, 29 Dec 2021 06:53:22 +0900 From: Stafford Horne To: Adhemerval Zanella Cc: GLIBC patches Subject: Re: [PATCH] open64: Force O_LARGEFILE on 32-bit architectures Message-ID: References: <20211226072008.1575854-1-shorne@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Dec 2021 21:53:29 -0000 On Tue, Dec 28, 2021 at 04:43:05PM -0300, Adhemerval Zanella wrote: > > > On 26/12/2021 04:20, Stafford Horne via Libc-alpha wrote: > > When running tests on OpenRISC which has 32-bit wordsize but 64-bit > > timesize it was found that O_LARGEFILE is not being set when calling > > open64. For 64-bit architectures the O_LARGEFILE flag is generally > > implied by the kernel according to force_o_largefile. However, for > > 32-bit architectures this is not done. > > > > For this patch I add an extra condition to the EXTRA_OPEN_FLAGS ifdef > > logic to allow setting O_LARGEFILE on 32-bit architectures. > > > > Tested on the OpenRISC the build works and timezone/tst-tzset passes > > which was failing before. I would expect this also would fix arc. > > The O_LARGEFILE is implicit for architectures that defines ARCH_32BIT_OFF_T, > which are usually old legacy ABIs (it is not defined for newer 32-bit ABIs). > > However, Linux will also internally adds the flag for such cases > (force_o_largefile macro), which means that passing it, even for ABIs that > do not require it, is ok. > > So I think it would be simpler to just remove EXTRA_OPEN_FLAGS and > use O_LARGEFILE unconditionally. Yes, I agree on this. I thought maybe there was some reason for having the ifdef there, like avoiding the extra instructions to set the flag. But, I don't think it's going to show up on any profiles. I'll send a v2. > > --- > > sysdeps/unix/sysv/linux/open64.c | 3 +-- > > sysdeps/unix/sysv/linux/open64_nocancel.c | 2 +- > > sysdeps/unix/sysv/linux/openat64.c | 2 +- > > sysdeps/unix/sysv/linux/openat64_nocancel.c | 2 +- > > 4 files changed, 4 insertions(+), 5 deletions(-) > > > > diff --git a/sysdeps/unix/sysv/linux/open64.c b/sysdeps/unix/sysv/linux/open64.c > > index 0904696973..5ae5e98b57 100644 > > --- a/sysdeps/unix/sysv/linux/open64.c > > +++ b/sysdeps/unix/sysv/linux/open64.c > > @@ -23,8 +23,7 @@ > > #include > > #include > > > > - > > -#ifdef __OFF_T_MATCHES_OFF64_T > > +#if defined __OFF_T_MATCHES_OFF64_T && (__WORDSIZE != 32) > > # define EXTRA_OPEN_FLAGS 0 > > #else > > # define EXTRA_OPEN_FLAGS O_LARGEFILE > > diff --git a/sysdeps/unix/sysv/linux/open64_nocancel.c b/sysdeps/unix/sysv/linux/open64_nocancel.c > > index d7f35656a1..0fe41175ac 100644 > > --- a/sysdeps/unix/sysv/linux/open64_nocancel.c > > +++ b/sysdeps/unix/sysv/linux/open64_nocancel.c > > @@ -23,7 +23,7 @@ > > > > #include > > > > -#ifdef __OFF_T_MATCHES_OFF64_T > > +#if defined __OFF_T_MATCHES_OFF64_T && (__WORDSIZE != 32) > > # define EXTRA_OPEN_FLAGS 0 > > #else > > # define EXTRA_OPEN_FLAGS O_LARGEFILE > > diff --git a/sysdeps/unix/sysv/linux/openat64.c b/sysdeps/unix/sysv/linux/openat64.c > > index dc226567c1..1019fc13ac 100644 > > --- a/sysdeps/unix/sysv/linux/openat64.c > > +++ b/sysdeps/unix/sysv/linux/openat64.c > > @@ -21,7 +21,7 @@ > > > > #include > > > > -#ifdef __OFF_T_MATCHES_OFF64_T > > +#if defined __OFF_T_MATCHES_OFF64_T && (__WORDSIZE != 32) > > # define EXTRA_OPEN_FLAGS 0 > > #else > > # define EXTRA_OPEN_FLAGS O_LARGEFILE > > diff --git a/sysdeps/unix/sysv/linux/openat64_nocancel.c b/sysdeps/unix/sysv/linux/openat64_nocancel.c > > index 51377aea45..324f719ea4 100644 > > --- a/sysdeps/unix/sysv/linux/openat64_nocancel.c > > +++ b/sysdeps/unix/sysv/linux/openat64_nocancel.c > > @@ -22,7 +22,7 @@ > > #include > > #include > > > > -#ifdef __OFF_T_MATCHES_OFF64_T > > +#if defined __OFF_T_MATCHES_OFF64_T && (__WORDSIZE != 32) > > # define EXTRA_OPEN_FLAGS 0 > > #else > > # define EXTRA_OPEN_FLAGS O_LARGEFILE