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