On Mon, Nov 23, 2015 at 10:46:33AM +0300, Maxim Ostapenko wrote:
> Index: libsanitizer/configure.ac
> ===================================================================
> --- libsanitizer/configure.ac (revision 230597)
> +++ libsanitizer/configure.ac (working copy)
> @@ -136,6 +136,12 @@
>  esac
>  AM_CONDITIONAL(USING_MAC_INTERPOSE, $MAC_INTERPOSE)
>  
> +case "$target" in
> +  aarch64-*-linux*) tsan_aarch64=true ;;
> +  *) tsan_aarch64=false ;;
> +esac
> +AM_CONDITIONAL(TSAN_AARCH64, $tsan_aarch64)
> +

I don't understand the purpose of the above.

> Index: libsanitizer/configure.tgt
> ===================================================================
> --- libsanitizer/configure.tgt        (revision 230597)
> +++ libsanitizer/configure.tgt        (working copy)
> @@ -37,6 +37,8 @@
>    aarch64*-*-linux*)
>       if test x$ac_cv_sizeof_void_p = x8; then
>               TSAN_SUPPORTED=yes
> +             LSAN_SUPPORTED=yes
> +             TSAN_TARGET_DEPENDENT_OBJECTS=tsan_rtl_aarch64.lo
>       fi
>       ;;
>    x86_64-*-darwin[1]* | i?86-*-darwin[1]*)

You already have this.

> Index: libsanitizer/tsan/Makefile.am
> ===================================================================
> --- libsanitizer/tsan/Makefile.am     (revision 230597)
> +++ libsanitizer/tsan/Makefile.am     (working copy)
> @@ -21,6 +21,8 @@
>       tsan_interface_atomic.cc \
>       tsan_interface.cc \
>       tsan_interface_java.cc \
> +     tsan_libdispatch_mac.cc \
> +     tsan_malloc_mac.cc \
>       tsan_md5.cc \
>       tsan_mman.cc \
>       tsan_mutex.cc \
> @@ -28,6 +30,7 @@
>       tsan_new_delete.cc \
>       tsan_platform_linux.cc \
>       tsan_platform_mac.cc \
> +     tsan_platform_posix.cc \
>       tsan_platform_windows.cc \
>       tsan_report.cc \
>       tsan_rtl.cc \
> @@ -41,7 +44,11 @@
>       tsan_sync.cc 
>  
>  libtsan_la_SOURCES = $(tsan_files)
> +if TSAN_AARCH64
> +EXTRA_libtsan_la_SOURCES = tsan_rtl_aarch64.S
> +else
>  EXTRA_libtsan_la_SOURCES = tsan_rtl_amd64.S
> +endif

And if I understand automake manual, you can list in there both
EXTRA_libtsan_la_SOURCES = tsan_rtl_amd64.S tsan_rtl_aarch64.S
unconditionally, and what object actually gets linked in is picked from the
$(TSAN_TARGET_DEPENDENT_OBJECTS) (and similarly dependencies).

Otherwise LGTM.

        Jakub

Reply via email to