===================================================================
@@ -1,5 +1,10 @@
2015-01-25 Venkataramanan Kumar <venkataramanan.kumar@linaro.org>
+ * configure.ac: Set host_address to 64 or 32.
+ * configure: Regenerate.
+
+2015-01-25 Venkataramanan Kumar <venkataramanan.kumar@linaro.org>
+
* configure.ac (TSAN_TARGET_DEPENDENT_OBJECTS): Define.
* configure: Regenerate.
* tsan/Makefile.am (EXTRA_libtsan_la_SOURCES): Define.
===================================================================
@@ -16363,12 +16363,31 @@
fi
-case "${target}" in
- x86_64-*-linux-*) TSAN_TARGET_DEPENDENT_OBJECTS='tsan_rtl_amd64.lo' ;;
- *) TSAN_TARGET_DEPENDENT_OBJECTS='' ;;
-esac
+# Check 32bit or 64bit. In the case of MIPS, this really determines the
+# word size rather than the address size.
+cat > conftest.c <<EOF
+#if defined(__x86_64__) || (!defined(__i386__) && defined(__LP64__)) \
+ || defined(__mips64)
+host_address=64
+#else
+host_address=32
+#endif
+EOF
+eval `echo venkat tart`
+eval `${CC-cc} -E conftest.c | grep host_address=`
+eval `echo venkat end`
+rm -f conftest.c
+if test "${host_address}" = "64"; then
+ case "${target}" in
+ x86_64-*-linux-*|i?86-*-linux-*)TSAN_TARGET_DEPENDENT_OBJECTS='tsan_rtl_amd64.lo' ;;
+ *) TSAN_TARGET_DEPENDENT_OBJECTS='' ;;
+ esac
+else
+ TSAN_TARGET_DEPENDENT_OBJECTS=''
+fi
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
===================================================================
@@ -346,10 +346,29 @@
])
fi
-case "${target}" in
- x86_64-*-linux-*) TSAN_TARGET_DEPENDENT_OBJECTS='tsan_rtl_amd64.lo' ;;
- *) TSAN_TARGET_DEPENDENT_OBJECTS='' ;;
-esac
+# Check 32bit or 64bit. In the case of MIPS, this really determines the
+# word size rather than the address size.
+cat > conftest.c <<EOF
+#if defined(__x86_64__) || (!defined(__i386__) && defined(__LP64__)) \
+ || defined(__mips64)
+host_address=64
+#else
+host_address=32
+#endif
+EOF
+eval `echo venkat tart`
+eval `${CC-cc} -E conftest.c | grep host_address=`
+eval `echo venkat end`
+rm -f conftest.c
+
+if test "${host_address}" = "64"; then
+ case "${target}" in
+ x86_64-*-linux-*|i?86-*-linux-*)TSAN_TARGET_DEPENDENT_OBJECTS='tsan_rtl_amd64.lo' ;;
+ *) TSAN_TARGET_DEPENDENT_OBJECTS='' ;;
+ esac
+else
+ TSAN_TARGET_DEPENDENT_OBJECTS=''
+fi
AC_SUBST([TSAN_TARGET_DEPENDENT_OBJECTS])
AC_OUTPUT