From d9641b64e988d57f93b9e95aabf507ff8134ef15 Mon Sep 17 00:00:00 2001
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date: Sat, 25 Oct 2025 20:15:41 +0100
Subject: [PATCH] libgccjit: Fix bootstrap fail from format specifiers.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The changes in r16-4527-gc11d9eaa8ac9ee caused format mismatches
in jit-recording.cc because Darwin’s uint64_t == long long unsigned int
(and the format specifiers were %ld and %li).

gcc/jit/ChangeLog:

	* jit-recording.cc (recording::array_type::make_debug_string,
	recording::array_type::write_reproducer): Use PRIu64 format
	specifier for uint64_t.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
---
 gcc/jit/jit-recording.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
index 6816a71dcd8..5c641f690d6 100644
--- a/gcc/jit/jit-recording.cc
+++ b/gcc/jit/jit-recording.cc
@@ -3430,7 +3430,7 @@ recording::string *
 recording::array_type::make_debug_string ()
 {
   return string::from_printf (m_ctxt,
-			      "%s[%ld]",
+			      "%s[%" PRIu64 "]",
 			      m_element_type->get_debug_string (),
 			      m_num_elements);
 }
@@ -3446,7 +3446,7 @@ recording::array_type::write_reproducer (reproducer &r)
 	   "    gcc_jit_context_new_array_type_u64 (%s,\n"
 	   "                                        %s, /* gcc_jit_location *loc */\n"
 	   "                                        %s, /* gcc_jit_type *element_type */\n"
-	   "                                        %li); /* int num_elements */\n",
+	   "                                        %" PRIu64 "); /* int num_elements */\n",
 	   id,
 	   r.get_identifier (get_context ()),
 	   r.get_identifier (m_loc),
-- 
2.39.5 (Apple Git-154)

