[PING]: [PATCH]: Conditionally include target specific files while building TSAN

Venkataramanan Kumar venkataramanan.kumar@linaro.org
Sat Jan 24 10:16:00 GMT 2015


Hi Rainer,

I reused libgcc's "host_address" test and the patch passed normal
bootstrap in x86_64.

Can you please check if this is fine ?

regards,
Venkat.

On 24 January 2015 at 12:53, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
> Hi Venkat,
>
>> Yes thanks I will work on fixing this. Let me know if I need to revert
>> the patch meanwhile.
>
> I don't think this is urgent enough to justify reversion.
>
> Thanks.
>         Rainer
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
-------------- next part --------------
Index: libsanitizer/ChangeLog
===================================================================
--- libsanitizer/ChangeLog	(revision 220077)
+++ libsanitizer/ChangeLog	(working copy)
@@ -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.
Index: libsanitizer/configure
===================================================================
--- libsanitizer/configure	(revision 220077)
+++ libsanitizer/configure	(working copy)
@@ -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
Index: libsanitizer/configure.ac
===================================================================
--- libsanitizer/configure.ac	(revision 220077)
+++ libsanitizer/configure.ac	(working copy)
@@ -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


More information about the Gcc-patches mailing list