--- mono/configure-orig.ac	2022-02-23 00:18:59.460273300 +0800
+++ mono/configure.ac	2022-02-22 22:06:47.615862400 +0800
@@ -603,9 +603,9 @@
 
 ## PLATFORM_AOT_SUFFIX not so simple for windows :-)
 
-AC_CHECK_TOOL(CC, gcc, gcc)
+AC_CHECK_TOOL(CC, gcc, cc)
 AC_PROG_CC
-AC_CHECK_TOOL(CXX, g++, g++)
+AC_CHECK_TOOL(CXX, g++, c++)
 AC_PROG_CXX
 AM_PATH_PYTHON([3.2])
 AM_PROG_AS
@@ -5246,7 +5246,7 @@
 			unsigned __int64 *a = (size_t*)0;
 		])], [
 			AC_MSG_RESULT(yes)
-			AC_SUBST(GSIZE_FORMAT, '"I64u"')
+			AC_SUBST(GSIZE_FORMAT, '"z"')
 		], [
 			AC_MSG_RESULT(no)
 			AC_MSG_CHECKING(if size_t is unsigned long long)
@@ -5255,7 +5255,7 @@
 				unsigned long long *a = (size_t*)0;
 			])], [
 				AC_MSG_RESULT(yes)
-				AC_SUBST(GSIZE_FORMAT, '"llu"')
+				AC_SUBST(GSIZE_FORMAT, '"z"')
 			], [
 				AC_MSG_RESULT(no)
 				AC_MSG_ERROR(Unable to determine size_t among unsigned long, int, __int64, long long)
