From b00139d8f2b45b40b2e2b6c78db614d2af5abda2 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 22 Jan 2025 10:09:38 +0100 Subject: [PATCH] libc: unify base types for arm_64 and riscv Fixes #5431 --- repos/libports/ports/libc.hash | 2 +- .../libports/src/lib/libc/patches/types.patch | 56 +++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/repos/libports/ports/libc.hash b/repos/libports/ports/libc.hash index e90372ce285..202bad509b9 100644 --- a/repos/libports/ports/libc.hash +++ b/repos/libports/ports/libc.hash @@ -1 +1 @@ -b36b17e21acc3a6b70bc550e19d08abbb15db71a +bc721727d40eed2e4034055bd0400374fcaa4d61 diff --git a/repos/libports/src/lib/libc/patches/types.patch b/repos/libports/src/lib/libc/patches/types.patch index e401f6e6438..6b379b2363e 100644 --- a/repos/libports/src/lib/libc/patches/types.patch +++ b/repos/libports/src/lib/libc/patches/types.patch @@ -50,3 +50,59 @@ index 07893c6..abd2ea4 100644 typedef __int32_t __time_t; typedef __uint32_t __uintfptr_t; typedef __uint32_t __uintptr_t; +--- src/lib/libc/sys/arm64/include/_types.h ++++ src/lib/libc/sys/arm64/include/_types.h +@@ -48,8 +48,8 @@ + typedef unsigned short __uint16_t; + typedef int __int32_t; + typedef unsigned int __uint32_t; +-typedef long __int64_t; +-typedef unsigned long __uint64_t; ++typedef long long __int64_t; ++typedef unsigned long long __uint64_t; + + /* + * Standard type definitions. +@@ -71,11 +71,11 @@ + typedef __int16_t __int_least16_t; + typedef __int32_t __int_least32_t; + typedef __int64_t __int_least64_t; +-typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ ++typedef __PTRDIFF_TYPE__ __ptrdiff_t; /* ptr1 - ptr2 */ + typedef __int64_t __register_t; + typedef __int64_t __segsz_t; /* segment size (in pages) */ +-typedef __uint64_t __size_t; /* sizeof() */ +-typedef __int64_t __ssize_t; /* byte count or error */ ++typedef __SIZE_TYPE__ __size_t; /* sizeof() */ ++typedef __PTRDIFF_TYPE__ __ssize_t; /* byte count or error */ + typedef __int64_t __time_t; /* time()... */ + typedef __uint64_t __uintfptr_t; + typedef __uint64_t __uintmax_t; +--- src/lib/libc/sys/riscv/include/_types.h ++++ src/lib/libc/sys/riscv/include/_types.h +@@ -48,8 +48,8 @@ + typedef unsigned short __uint16_t; + typedef int __int32_t; + typedef unsigned int __uint32_t; +-typedef long __int64_t; +-typedef unsigned long __uint64_t; ++typedef long long __int64_t; ++typedef unsigned long long __uint64_t; + + /* + * Standard type definitions. +@@ -71,11 +71,11 @@ + typedef __int16_t __int_least16_t; + typedef __int32_t __int_least32_t; + typedef __int64_t __int_least64_t; +-typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ ++typedef __PTRDIFF_TYPE__ __ptrdiff_t; /* ptr1 - ptr2 */ + typedef __int64_t __register_t; + typedef __int64_t __segsz_t; /* segment size (in pages) */ +-typedef __uint64_t __size_t; /* sizeof() */ +-typedef __int64_t __ssize_t; /* byte count or error */ ++typedef __SIZE_TYPE__ __size_t; /* sizeof() */ ++typedef __PTRDIFF_TYPE__ __ssize_t; /* byte count or error */ + typedef __int64_t __time_t; /* time()... */ + typedef __uint64_t __uintfptr_t; + typedef __uint64_t __uintmax_t;