Changeset 120a28c3


Ignore:
Timestamp:
Jun 17, 2019, 11:26:14 AM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
8b34df0
Parents:
462a7c7
Message:

Added support for address-sanitizer which requires disabling Heap Statistics and TCMalloc

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • configure

    r462a7c7 r120a28c3  
    796796with_cfa_name
    797797with_target_hosts
     798enable_gprofiler
    798799enable_dependency_tracking
    799800enable_shared
     
    14551456  --enable-silent-rules   less verbose build output (undo: "make V=1")
    14561457  --disable-silent-rules  verbose build output (undo: "make V=0")
     1458  --enable-gprofiler     whether or not to enable gprofiler tools (if available)
    14571459  --enable-dependency-tracking
    14581460                          do not reject slow dependency extractors
     
    32833285                \'--with-target-hosts=*) ;;
    32843286
     3287                # skip gprofiler for libcfa
     3288                \'--enable-gprofiler=*) ;;
     3289                \'--disable-gprofiler) ;;
     3290
    32853291                # append all other arguments to the sub configure arguments
    32863292                *) LIBCFA_GENERAL_ARGS="${LIBCFA_GENERAL_ARGS} $var";;
     
    33843390else
    33853391  target_hosts=${default_target}
     3392fi
     3393
     3394
     3395# Check whether --enable-gprofiler was given.
     3396if test "${enable_gprofiler+set}" = set; then :
     3397  enableval=$enable_gprofiler; enable_gprofiler=$enableval
     3398else
     3399  enable_gprofiler=yes
    33863400fi
    33873401
     
    1670416718fi
    1670516719
    16706  if test "$HAVE_LIBPROFILER" -eq 1; then
     16720 if test "x$enable_gprofiler" = "xyes" -a "$HAVE_LIBPROFILER" -eq 1; then
    1670716721  WITH_LIBPROFILER_TRUE=
    1670816722  WITH_LIBPROFILER_FALSE='#'
     
    1675516769fi
    1675616770
    16757  if test "$HAVE_LIBTCMALLOC" -eq 1; then
     16771 if test "x$enable_gprofiler" = "xyes" -a "$HAVE_LIBTCMALLOC" -eq 1; then
    1675816772  WITH_LIBTCMALLOC_TRUE=
    1675916773  WITH_LIBTCMALLOC_FALSE='#'
  • configure.ac

    r462a7c7 r120a28c3  
    9494                # skip the target hosts
    9595                \'--with-target-hosts=*) ;;
     96
     97                # skip gprofiler for libcfa
     98                \'--enable-gprofiler=*) ;;
     99                \'--disable-gprofiler) ;;
    96100
    97101                # append all other arguments to the sub configure arguments
     
    125129        target_hosts=$withval, target_hosts=${default_target})
    126130
     131AC_ARG_ENABLE(gprofiler,
     132        [  --enable-gprofiler     whether or not to enable gprofiler tools (if available)],
     133        enable_gprofiler=$enableval, enable_gprofiler=yes)
     134
    127135AC_SUBST(TARGET_HOSTS, ${target_hosts})
    128136
     
    192200
    193201AC_CHECK_LIB([profiler], [ProfilingIsEnabledForAllThreads], [HAVE_LIBPROFILER=1], [HAVE_LIBPROFILER=0])
    194 AM_CONDITIONAL([WITH_LIBPROFILER], [test "$HAVE_LIBPROFILER" -eq 1])
     202AM_CONDITIONAL([WITH_LIBPROFILER], [test "x$enable_gprofiler" = "xyes" -a "$HAVE_LIBPROFILER" -eq 1])
    195203
    196204AC_CHECK_LIB([tcmalloc], [malloc], [HAVE_LIBTCMALLOC=1], [HAVE_LIBTCMALLOC=0])
    197 AM_CONDITIONAL([WITH_LIBTCMALLOC], [test "$HAVE_LIBTCMALLOC" -eq 1])
     205AM_CONDITIONAL([WITH_LIBTCMALLOC], [test "x$enable_gprofiler" = "xyes" -a "$HAVE_LIBTCMALLOC" -eq 1])
    198206
    199207# Checks for header files.
  • src/Common/Stats/Heap.cc

    r462a7c7 r120a28c3  
    2121#include <iostream>
    2222
    23 #if defined( NO_STATISTICS ) || defined( TCMALLOC )
    24         #define NO_HEAP_STATISTICS
     23#if defined(__has_feature)
     24        #if __has_feature(address_sanitizer)
     25                #define NO_HEAP_STATISTICS
     26        # endif
     27#endif
     28
     29#if defined( NO_STATISTICS ) || defined( TCMALLOC ) || defined(__SANITIZE_ADDRESS__)
     30        #if !defined(NO_HEAP_STATISTICS)
     31                #define NO_HEAP_STATISTICS
     32        #endif
    2533#endif
    2634
Note: See TracChangeset for help on using the changeset viewer.