From: Neal Gompa <neal@gompa.dev>
To: Thomas Bertschinger <tahbertschinger@gmail.com>
Cc: kent.overstreet@linux.dev, linux-bcachefs@vger.kernel.org,
bfoster@redhat.com
Subject: Re: [PATCH TOOLS] powerpc: use "long long" for 64-bit types in userspace
Date: Fri, 23 Feb 2024 18:31:26 -0500 [thread overview]
Message-ID: <CAEg-Je9AXSS7-62=UEbYt0_oAFPNK1yrXMv9dMn+njzNp8ioig@mail.gmail.com> (raw)
In-Reply-To: <20240223222042.140688-1-tahbertschinger@gmail.com>
On Fri, Feb 23, 2024 at 5:21 PM Thomas Bertschinger
<tahbertschinger@gmail.com> wrote:
>
> This resolves build warnings and failures for architectures where the
> Linux userspace `asm/types.h` header defines 64-bit types (u64, s64) as
> `long` instead of `long long`.
>
> By defining `__SANE_USERSPACE_TYPES__`, these types are defined as
> `long long` instead.
>
> Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
> ---
> Makefile | 1 +
> include/linux/types.h | 2 ++
> 2 files changed, 3 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 6e5d0e5..7363d5d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -42,6 +42,7 @@ CFLAGS+=-std=gnu11 -O2 -g -MMD -Wall -fPIC \
> -DNO_BCACHEFS_FS \
> -DNO_BCACHEFS_SYSFS \
> -DVERSION_STRING='"$(VERSION)"' \
> + -D__SANE_USERSPACE_TYPES__ \
> $(EXTRA_CFLAGS)
>
> # Intenionally not doing the above to $(LDFLAGS) because we rely on
> diff --git a/include/linux/types.h b/include/linux/types.h
> index 6ae97c4..004d5eb 100644
> --- a/include/linux/types.h
> +++ b/include/linux/types.h
> @@ -10,7 +10,9 @@
> #include <sys/types.h>
> #include <linux/posix_types.h>
>
> +#ifndef __SANE_USERSPACE_TYPES__
> #define __SANE_USERSPACE_TYPES__ /* For PPC64, to get LL64 types */
> +#endif
> #include <asm/types.h>
>
> #include <linux/cache.h>
> --
> 2.43.0
>
>
This looks good, works, and fixes the build for Fedora on ppc64le.
Reviewed-by: Neal Gompa <neal@gompa.dev>
--
真実はいつも一つ!/ Always, there's only one truth!
prev parent reply other threads:[~2024-02-23 23:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-23 22:20 [PATCH TOOLS] powerpc: use "long long" for 64-bit types in userspace Thomas Bertschinger
2024-02-23 22:26 ` Kent Overstreet
2024-02-23 23:31 ` Neal Gompa [this message]
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='CAEg-Je9AXSS7-62=UEbYt0_oAFPNK1yrXMv9dMn+njzNp8ioig@mail.gmail.com' \
--to=neal@gompa.dev \
--cc=bfoster@redhat.com \
--cc=kent.overstreet@linux.dev \
--cc=linux-bcachefs@vger.kernel.org \
--cc=tahbertschinger@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).