powerpc: use "long long" for 64-bit types in userspace
PATCH 1/1 powerpc: use "long long" for 64-bit types in userspace
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.
--- Makefile | 1 + include/linux/types.h | 2 ++ 2 files changed, 3 insertions(+)
Makefile +1 -0
@@ -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
include/linux/types.h +2 -0
@@ -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>
Signature · 1 line
2.43.0
Quoted 6 lines · Thomas Bertschinger
This resolves build warnings and failures for architectures where the Linux userspace
asm/types.hheader defines 64-bit types (u64, s64) aslonginstead oflong long.By defining
__SANE_USERSPACE_TYPES__, these types are defined aslong longinstead.
Never realized this was a thing! This fixes all the printf format madness.
Quoted 41 lines · Thomas Bertschinger
This resolves build warnings and failures for architectures where the Linux userspace
asm/types.hheader defines 64-bit types (u64, s64) aslonginstead oflong long.By defining
__SANE_USERSPACE_TYPES__, these types are defined aslong longinstead.Signed-off-by Thomas Bertschinger <[email protected]>--- Makefile | 1 + include/linux/types.h | 2 ++ 2 files changed, 3 insertions(+)Makefile +1
-0@@ -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 oninclude/linux/types.h +2
-1@@ -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> --
Quoted 3 lines
2.43.0
This looks good, works, and fixes the build for Fedora on ppc64le.
Signature · 1 line
真実はいつも一つ!/ Always, there's only one truth!