This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/2] Libsanitizer merge from upstream r253555.
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Maxim Ostapenko <m dot ostapenko at partner dot samsung dot com>
- Cc: Kostya Serebryany <kcc at google dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Yury Gribov <y dot gribov at samsung dot com>, Vyacheslav Barinov <v dot barinov at samsung dot com>, Slava Garbuzov <v dot garbuzov at samsung dot com>
- Date: Mon, 23 Nov 2015 09:07:53 +0100
- Subject: Re: [PATCH 1/2] Libsanitizer merge from upstream r253555.
- Authentication-results: sourceware.org; auth=none
- References: <5652C3E0 dot 4030000 at partner dot samsung dot com> <5652C459 dot 8090500 at partner dot samsung dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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