From: David Sterba <dsterba@suse.cz>
To: Adam Buchbinder <abuchbinder@google.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: Enable ThreadSanitizer, using D=tsan.
Date: Thu, 13 Jul 2017 00:53:35 +0200 [thread overview]
Message-ID: <20170712225335.GU2866@suse.cz> (raw)
In-Reply-To: <CALb+jKoe8U5XdnPT1KnYsJBezrk=FcsbEsu3+ibT+Xv8gOhp=g@mail.gmail.com>
On Wed, Jul 12, 2017 at 03:45:46PM -0700, Adam Buchbinder wrote:
> On Wed, Jul 12, 2017 at 2:51 PM, David Sterba <dsterba@suse.cz> wrote:
> >
> > On Wed, Jul 12, 2017 at 01:04:49PM -0700, Adam Buchbinder wrote:
> > > Tested with clang-3.9.
> > >
> > > Signed-off-by: Adam Buchbinder <abuchbinder@google.com>
> > > ---
> > > Makefile | 6 ++++++
> > > 1 file changed, 6 insertions(+)
> > >
> > > diff --git a/Makefile b/Makefile
> > > index 81598df..8948301 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -17,6 +17,7 @@
> > > # abort - call abort() on first error (dumps core)
> > > # all - shortcut for all of the above
> > > # asan - enable address sanitizer compiler feature
> > > +# tsan - enable thread sanitizer compiler feature
> > > # ubsan - undefined behaviour sanitizer compiler
> feature
> > > # bcheck - extended build checks
> > > # W=123 build with warnings (default: off)
> > > @@ -157,6 +158,11 @@ ifneq (,$(findstring asan,$(D)))
> > > DEBUG_CFLAGS_INTERNAL += -fsanitize=address
> > > endif
> > >
> > > +ifneq (,$(findstring tsan,$(D)))
> > > + DEBUG_CFLAGS_INTERNAL += -fsanitize=thread -fPIE
> > > + LD_FLAGS += -fsanitize=thread -ltsan -pie
> >
> > Why do you need to set PIE here? Is is necessary for tsan?
>
> Yes; see https://clang.llvm.org/docs/ThreadSanitizer.html:
> "Non-position-independent executables are not supported."
Thanks, patch applied.
next prev parent reply other threads:[~2017-07-12 22:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-12 20:04 [PATCH] btrfs-progs: Enable ThreadSanitizer, using D=tsan Adam Buchbinder
2017-07-12 21:51 ` David Sterba
[not found] ` <CALb+jKoe8U5XdnPT1KnYsJBezrk=FcsbEsu3+ibT+Xv8gOhp=g@mail.gmail.com>
2017-07-12 22:53 ` David Sterba [this message]
2017-08-25 18:03 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170712225335.GU2866@suse.cz \
--to=dsterba@suse.cz \
--cc=abuchbinder@google.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox