All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Brian Cain <quic_bcain@quicinc.com>
Cc: Brian Cain <bcain@quicinc.com>,  <qemu-devel@nongnu.org>
Subject: Re: [PATCH] tests/tcg/multiarch: Define _LARGEFILE64_SOURCE
Date: Mon, 16 Sep 2024 16:47:37 +0100	[thread overview]
Message-ID: <87msk7fvmu.fsf@draig.linaro.org> (raw)
In-Reply-To: <b6ef0a81-1153-4aca-9e27-570c2f0a6853@quicinc.com> (Brian Cain's message of "Mon, 16 Sep 2024 09:23:21 -0500")

Brian Cain <quic_bcain@quicinc.com> writes:

> On 9/16/2024 8:12 AM, Alex Bennée wrote:
>> Brian Cain <quic_bcain@quicinc.com> writes:
>>
>>> On 9/6/2024 9:39 PM, Brian Cain wrote:
>>>> With newer clang builds (19.x), there's a warning for implicit function
>>>> declarations and it rejects linux-test.c.
>>>>
>>>> glibc/musl's readdir64() declaration in dirent is guarded by
>>>> _LARGEFILE64_SOURCE, so we'll define it to fix the warning.
>>>>
>>>>         BUILD   hexagon-linux-user guest-tests
>>>>       /local/mnt/workspace/upstream/toolchain_for_hexagon/qemu/tests/tcg/multiarch/linux/linux-test.c:189:14: error: call to undeclared function 'readdir64'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>>>>         189 |         de = readdir64(dir);
>>>>             |              ^
>>>>
>>>> Signed-off-by: Brian Cain <bcain@quicinc.com>
>>>> ---
>>>>    tests/tcg/multiarch/linux/linux-test.c | 1 +
>>>>    1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/tests/tcg/multiarch/linux/linux-test.c b/tests/tcg/multiarch/linux/linux-test.c
>>>> index 64f57cb287..4e0e862ad9 100644
>>>> --- a/tests/tcg/multiarch/linux/linux-test.c
>>>> +++ b/tests/tcg/multiarch/linux/linux-test.c
>>>> @@ -17,6 +17,7 @@
>>>>     *  along with this program; if not, see <http://www.gnu.org/licenses/>.
>>>>     */
>>>>    #define _GNU_SOURCE
>>>> +#define _LARGEFILE64_SOURCE
>>>>    #include <stdarg.h>
>>>>    #include <stdlib.h>
>>>>    #include <stdio.h>
>>>
>>> Alex -- what do you think about this one?
>> Actually scratch that, this is a 32 compat hack:
>>
>>    1f442da51e (tests/tcg/multiarch: fix 32bit linux-test on 64bit host)
>>
>> Is the __USE_LARGEFILE64 symbol in the hexagon headers?
>>
> musl does not define/use __USE_LARGEFILE64, no.  If it's well defined
> I could examine whether it makes sense to add this feature to musl,
> though.  How does __USE_LARGEFILE64 differ from _LARGEFILE64_SOURCE? 
> Is it more appropriate to define that here?

Digging into the GNU source _LARGEFILE* is the correct define, the __USE
flags are internal. features.h says:

   _LARGEFILE_SOURCE    Some more functions for correct standard I/O.
   _LARGEFILE64_SOURCE  Additional functionality from LFS for large files.

although looking at _LARGEFILE64_SOURCE should be defined by
_GNU_SOURCE which is already set for linux-test.c

According to the musl WHATSNEW:

  compatibility:
  - make _GNU_SOURCE imply _LARGEFILE64_SOURCE

So is this a hexagon only thing?

>
> -Brian

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  reply	other threads:[~2024-09-16 15:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-07  2:39 [PATCH] tests/tcg/multiarch: Define _LARGEFILE64_SOURCE Brian Cain
2024-09-16 12:45 ` Brian Cain
2024-09-16 13:08   ` Alex Bennée
2024-09-16 13:12   ` Alex Bennée
2024-09-16 14:23     ` Brian Cain
2024-09-16 15:47       ` Alex Bennée [this message]
2024-09-16 16:05         ` Brian Cain
2024-09-16 16:31           ` Brian Cain
2024-09-19 13:48             ` Brian Cain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87msk7fvmu.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=bcain@quicinc.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quic_bcain@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.