From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by sourceware.org (Postfix) with ESMTPS id 544BB385E82C for ; Mon, 16 Mar 2020 15:00:20 +0000 (GMT) Received: by mail-qk1-x744.google.com with SMTP id j2so13793872qkl.7 for ; Mon, 16 Mar 2020 08:00:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=p9Mt9oitRB0r8zE830w/Q5Bv0hSw+D35yYvK//Ioppo=; b=ba622nuuey0wK0ali0C6xpnhzpiQ2Q2tcjuJrMud7UrnXDQilAo2t+K4NotgOgn0JL Lxuym3iTZYJE/KRCgR8w2oG6uYLsSIM6oCINSQhL7+uNOuPpPOMauonmT1m84P57FnGb vbHX2gZkrlWRRxQUsdxHyUX5RFldI2F3f6S4C4JiY8qS/zNBqF/di4WyZ5Mc9iMeCW1z Xva7qBsdeJGz/TMRp2i4mpHTedd1xox7fTwqmWAep4Pw2jD/qBRIXPYnfTRfuJfbOWPW k5ObAHu2OPH5gswn8uFZB++/BA/T/9TjqkE+130zHbibQ/LKJvTwmPJWOCbJcore2r84 piMQ== X-Gm-Message-State: ANhLgQ2dJWUb6rVAKsq/YIgA9SAH4Q6MGc0YaBDJ7l7SWP4NGW+/iwBn QqpHACoxIpbtFCmW31Cgw47M/i+AjuAIwwqlsnJojA== X-Google-Smtp-Source: ADFU+vuiD+JH/pUKgDdCf3sR38s/KiXT5jhSDbFceYD0e66GmTM/IOq5svwrL90zNADbFrcsGJwS/qCva7+rUvw98cM= X-Received: by 2002:a25:b841:: with SMTP id b1mr36846214ybm.463.1584370819567; Mon, 16 Mar 2020 08:00:19 -0700 (PDT) MIME-Version: 1.0 References: <20200312113158.24055-1-maennich@google.com> In-Reply-To: <20200312113158.24055-1-maennich@google.com> From: Giuliano Procida Date: Mon, 16 Mar 2020 15:00:02 +0000 Message-ID: Subject: Re: [PATCH 1/2] configure: add support for thread sanitizer (--enable-tsan) To: Matthias Maennich Cc: libabigail@sourceware.org, Dodji Seketeli , kernel-team@android.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-38.7 required=5.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNSUBSCRIBE_BODY, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libabigail mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Mar 2020 15:00:23 -0000 On Thu, 12 Mar 2020 at 11:32, 'Matthias Maennich' via kernel-team wrote: > > Similarly to asan and ubsan, add support for tsan conditionally at > configure time. This allows us to track down race conditions etc. > > * configure.ac: Add configure options for -fsanitize=thread Please verify that there's no need to add the various flags to LDFLAGS (or no difference if you do so) thanks to CXX anf CFLAGS. msan (for which there isn't support yet; it also requires Clang and lld in particular) definitely requires its flag at link time. Assuming this is the case: Reviewed-by: Giuliano Procida It's also noticeable that turning on some sanitisers affects abidiff output. This can't be good and we should look into it when we have time. Regards, Giuliano. > Signed-off-by: Matthias Maennich > --- > configure.ac | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/configure.ac b/configure.ac > index ba800a72ac7a..50a50c6c8932 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -120,6 +120,12 @@ AC_ARG_ENABLE(asan, > ENABLE_ASAN=$enableval, > ENABLE_ASAN=no) > > +AC_ARG_ENABLE(tsan, > + AS_HELP_STRING([--enable-tsan=yes|no], > + [enable the support of building with -fsanitize=thread)]), > + ENABLE_TSAN=$enableval, > + ENABLE_TSAN=no) > + > AC_ARG_ENABLE(ubsan, > AS_HELP_STRING([--enable-ubsan=yes|no], > [enable the support of building with -fsanitize=undefined)]), > @@ -614,6 +620,11 @@ if test x$ENABLE_ASAN = xyes; then > CXXFLAGS="$CXXFLAGS -fsanitize=address" > fi > > +if test x$ENABLE_TSAN = xyes; then > + CFLAGS="$CFLAGS -fsanitize=thread" > + CXXFLAGS="$CXXFLAGS -fsanitize=thread" > +fi > + > if test x$ENABLE_UBSAN = xyes; then > CFLAGS="$CFLAGS -fsanitize=undefined" > CXXFLAGS="$CXXFLAGS -fsanitize=undefined" > @@ -907,6 +918,7 @@ AC_MSG_NOTICE([ > Enable python 3 : ${ENABLE_PYTHON3} > Enable running tests under Valgrind : ${enable_valgrind} > Enable build with -fsanitize=address : ${ENABLE_ASAN} > + Enable build with -fsanitize=thread : ${ENABLE_TSAN} > Enable build with -fsanitize=undefined : ${ENABLE_UBSAN} > Generate html apidoc : ${ENABLE_APIDOC} > Generate html manual : ${ENABLE_MANUAL} > -- > 2.25.1.481.gfbce0eb801-goog > > -- > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com. >