diff mbox

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

Message ID CAJK_mQ1swUd5cusREP9s_DtfibA39GbYjxb6YfX3FXEyHPDcEA@mail.gmail.com
State New
Headers show

Commit Message

Venkataramanan Kumar Jan. 24, 2015, 8:13 a.m. UTC
Hi Rainer,

Please find the corrected patch attached.  I removed some eval
statements I added for debugging.

regards,
Venkat,

On 24 January 2015 at 13:23, Venkataramanan Kumar
<venkataramanan.kumar@linaro.org> wrote:
> 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
diff mbox

Patch

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,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 `${CC-cc} -E conftest.c | grep host_address=`
+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,27 @@ 
 ])
 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 `${CC-cc} -E conftest.c | grep host_address=`
+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