From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by sourceware.org (Postfix) with ESMTPS id 6D5DC381DCDF for ; Tue, 17 Mar 2020 23:18:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6D5DC381DCDF Received: by mail-wm1-x343.google.com with SMTP id a132so1222081wme.1 for ; Tue, 17 Mar 2020 16:18:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=z+GiWM4vndVP6v2uBcwHXg+Iz+M7KVKq5aQPexMwmpg=; b=n0cvIDIqexINvJk4b4JV5eunGQ9D425YmtFilakUq9/XgBmSUOlsBN1uiI9EwuhJ+W jG/JX/ISNLfXzgHbg5Ad0zW9ujtYiFFHUL3pWyTnFdj8QiqPCS3pQMFNiFb6TimFzx0d wj/1ERRHQvoBz4Mzavt62LFlFeki+/8Gd2XAX4aZr7DsR5EMOcg4KaI4BTSDbttjc7Rd uWIZ3X0oRckZbT71pB3cP8RXGLjZwF+JY0FACstXjOBSjf21H5Pw1mgTHX1Oskd8wVqA MDwxZCDsXB017aodFApkmb1uLDiBA9FubyO0T7TgLaGVcWQ6Lv6xqd0oGxhrwq/MP27x hT0Q== X-Gm-Message-State: ANhLgQ0qKTizTvPQIZO/ND/yGM5TINFkvcl3VJ1VSe0w1ETzOW7jNbD3 XxopZK9kB2cejpEPBUfF47rvow== X-Google-Smtp-Source: ADFU+vs7hCPtTMjGMJw6zmGacrQi0r1lFo0AdoOAuUgZYZ03wYIRZnDovA7rb0OjkzFAyTZ2MuzHoA== X-Received: by 2002:a1c:9816:: with SMTP id a22mr1487585wme.16.1584487095929; Tue, 17 Mar 2020 16:18:15 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:e8f7:125b:61e9:733d]) by smtp.gmail.com with ESMTPSA id q13sm6419178wrs.91.2020.03.17.16.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2020 16:18:15 -0700 (PDT) Date: Wed, 18 Mar 2020 00:18:15 +0100 From: Matthias Maennich To: Giuliano Procida Cc: libabigail@sourceware.org, Dodji Seketeli , kernel-team@android.com Subject: Re: [PATCH 1/2] configure: add support for thread sanitizer (--enable-tsan) Message-ID: <20200317231815.GH211970@google.com> References: <20200312113158.24055-1-maennich@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-38.2 required=5.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, FSL_HELO_FAKE, 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: Tue, 17 Mar 2020 23:18:21 -0000 Hi! On Mon, Mar 16, 2020 at 03:00:02PM +0000, Giuliano Procida wrote: >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 Will post a patch for msan right away :-) >lld in particular) definitely requires its flag at link time. Autotools generates the makefiles such that CXX or CC is used for linking and that gets passed the CXXFLAGS / CFLAGS. Having the compiler drive the link step allows it to translate the compile flag into the full set of linker flags. Hence, we do not need to set any LDFLAGS. TL;DR: we are good :-) > >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. When running this in our hermetic build toolchain that appears to be not an issue. Though I do not yet see where this happens when running with a normal autotools based build. Cheers, Matthias > >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. >>