2f7f533
diff --git a/gdb/configure b/gdb/configure
2f7f533
index 7ff74ba..00a5b5b 100755
2f7f533
--- a/gdb/configure
2f7f533
+++ b/gdb/configure
2f7f533
@@ -7382,10 +7382,12 @@ _ACEOF
2f7f533
 
2f7f533
 
2f7f533
 
2f7f533
-if test "x${ac_cv_sizeof_unsigned_long}" = "x8"; then
2f7f533
-  TARGET_PTR="unsigned long"
2f7f533
-elif test "x${ac_cv_sizeof_unsigned_long_long}" = "x8"; then
2f7f533
+# Try to keep TARGET_PTR the same across archs so that jit-reader.h file
2f7f533
+# content is the same for multilib distributions.
2f7f533
+if test "x${ac_cv_sizeof_unsigned_long_long}" = "x8"; then
2f7f533
   TARGET_PTR="unsigned long long"
2f7f533
+elif test "x${ac_cv_sizeof_unsigned_long}" = "x8"; then
2f7f533
+  TARGET_PTR="unsigned long"
2f7f533
 elif test "x${ac_cv_sizeof_unsigned___int128}" = "x16"; then
2f7f533
   TARGET_PTR="unsigned __int128"
2f7f533
 else
2f7f533
diff --git a/gdb/configure.ac b/gdb/configure.ac
2f7f533
index ec776d7..c02ace9 100644
2f7f533
--- a/gdb/configure.ac
2f7f533
+++ b/gdb/configure.ac
2f7f533
@@ -648,10 +648,12 @@ AC_CHECK_SIZEOF(unsigned long long)
2f7f533
 AC_CHECK_SIZEOF(unsigned long)
2f7f533
 AC_CHECK_SIZEOF(unsigned __int128)
2f7f533
 
2f7f533
-if test "x${ac_cv_sizeof_unsigned_long}" = "x8"; then
2f7f533
-  TARGET_PTR="unsigned long"
2f7f533
-elif test "x${ac_cv_sizeof_unsigned_long_long}" = "x8"; then
2f7f533
+# Try to keep TARGET_PTR the same across archs so that jit-reader.h file
2f7f533
+# content is the same for multilib distributions.
2f7f533
+if test "x${ac_cv_sizeof_unsigned_long_long}" = "x8"; then
2f7f533
   TARGET_PTR="unsigned long long"
2f7f533
+elif test "x${ac_cv_sizeof_unsigned_long}" = "x8"; then
2f7f533
+  TARGET_PTR="unsigned long"
2f7f533
 elif test "x${ac_cv_sizeof_unsigned___int128}" = "x16"; then
2f7f533
   TARGET_PTR="unsigned __int128"
2f7f533
 else