From 1757bed1ccd54d388bce80662e785cd9ae47dd87 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 17 Jul 2021 14:57:53 -0700 Subject: [PATCH] Make Newlib use `int` for INT32 PRx types Otherwise GCC will default to using `long` which can cause format strings to fail due to int/long mismatch. --- patches/gcc10.3/gcc-int32-is-int.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 patches/gcc10.3/gcc-int32-is-int.patch diff --git a/patches/gcc10.3/gcc-int32-is-int.patch b/patches/gcc10.3/gcc-int32-is-int.patch new file mode 100644 index 0000000..6dce6e0 --- /dev/null +++ b/patches/gcc10.3/gcc-int32-is-int.patch @@ -0,0 +1,13 @@ +diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h +index 8e1bcf823e4..3cfcd2b6628 100644 +--- a/gcc/config/xtensa/xtensa.h ++++ b/gcc/config/xtensa/xtensa.h +@@ -801,3 +801,8 @@ typedef struct xtensa_args + callx0\ta0\n" \ + TEXT_SECTION_ASM_OP); + #endif ++ ++ ++/* Use int, instead of long int, for int32_t and uint32_t. */ ++#undef STDINT_LONG32 ++#define STDINT_LONG32 0