From: Jaroslav Kysela Date: Mon, 15 Jan 2018 17:09:40 +0000 (+0100) Subject: configure: add cclang_threadsan - gcc's cpp bails out for __has_feature() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6143ce00552693035fa89d7602cdd659a1f3ff18;p=thirdparty%2Ftvheadend.git configure: add cclang_threadsan - gcc's cpp bails out for __has_feature() --- diff --git a/configure b/configure index 58c951c8c..8ba29299c 100755 --- a/configure +++ b/configure @@ -76,6 +76,7 @@ OPTIONS=( "libsystemd_daemon:no" "bintray_cache:yes" "ddci:no" + "cclang_threadsan:no" ) # @@ -298,6 +299,13 @@ int test(void) } ' +check_cc_snippet cclang_threadsan ' +int test(void){ +#if __has_feature(thread_sanitizer) + return 0; +#endif +}' + # # Python # diff --git a/src/tvheadend.h b/src/tvheadend.h index e84a62f0a..5ed6f6685 100644 --- a/src/tvheadend.h +++ b/src/tvheadend.h @@ -832,7 +832,7 @@ void tvh_qsort_r(void *base, size_t nmemb, size_t size, int (*compar)(const void #define TVH_TITLE_LEN 256 /* sanitizer helpers */ -#if __has_feature(thread_sanitizer) +#if ENABLE_CCLANG_THREADSAN void *blacklisted_memcpy(void *dest, const void *src, size_t n); int blacklisted_close(int fildes); #else diff --git a/src/wrappers.c b/src/wrappers.c index 02a58be85..1b1671f68 100644 --- a/src/wrappers.c +++ b/src/wrappers.c @@ -654,7 +654,7 @@ int regex_match_substring_length(tvh_regex_t *regex, unsigned number) /* * Sanitizer helpers to avoid false positives */ -#if __has_feature(thread_sanitizer) +#if ENABLE_CCLANG_THREADSAN void *blacklisted_memcpy(void *dest, const void *src, size_t n) __attribute__((no_sanitize("thread"))) {