From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNpL9-0004Kc-IB for qemu-devel@nongnu.org; Mon, 25 Jan 2016 17:10:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aNpL4-000584-I3 for qemu-devel@nongnu.org; Mon, 25 Jan 2016 17:10:27 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:36676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNpL4-00057O-B1 for qemu-devel@nongnu.org; Mon, 25 Jan 2016 17:10:22 -0500 Received: by mail-wm0-x242.google.com with SMTP id l65so13900054wmf.3 for ; Mon, 25 Jan 2016 14:10:22 -0800 (PST) Sender: Paolo Bonzini References: <1453740558-16303-1-git-send-email-alex.bennee@linaro.org> <1453740558-16303-3-git-send-email-alex.bennee@linaro.org> <56A6625E.7070408@redhat.com> <87vb6ho79i.fsf@linaro.org> From: Paolo Bonzini Message-ID: <56A69D4A.3060807@redhat.com> Date: Mon, 25 Jan 2016 23:10:18 +0100 MIME-Version: 1.0 In-Reply-To: <87vb6ho79i.fsf@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC PATCH 2/4] configure: introduce --extra-libs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Alex_Benn=c3=a9e?= Cc: mttcg@greensocs.com, peter.maydell@linaro.org, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, qemu-devel@nongnu.org, fred.konrad@greensocs.com On 25/01/2016 19:15, Alex Bennée wrote: > > Paolo Bonzini writes: > >> On 25/01/2016 17:49, Alex Bennée wrote: >>> If for example you want to use the thread sanitizer you want to ensure all >>> binaries are linked with the library: >>> >>> ./configure ${TARGETS} --cc=gcc-5 --cxx=g++-5 \ >>> --extra-cflags="-fsanitize=thread" --extra-libs="-ltsan" >> >> Shouldn't -fsanitize=thread work as a linker command line flag too? > > No, the sanitizers are compile time options as they instrument the > generated code. It's just in the case of the ThreadSanitizer you also > need the support library. That's certainly not the case. My system has at least a libubsan, libasan and liblsan (in addition to libtsan), and "gcc -dumpspecs" suggests that the -fsanitize options are also valid at link time: %{%:sanitize(address):%{!shared:libasan_preinit%O%s} %{static-libasan:%{!shared:-Bstatic --whole-archive -lasan --no-whole-archive -Bdynamic}}%{!static-libasan:-lasan}} %{%:sanitize(thread):%{static-libtsan:%{!shared:-Bstatic --whole-archive -ltsan --no-whole-archive -Bdynamic}}%{!static-libtsan:-ltsan}} %{%:sanitize(leak):%{static-liblsan:%{!shared:-Bstatic --whole-archive -llsan --no-whole-archive -Bdynamic}}%{!static-liblsan:-llsan}} (GCC specs are what they are, but you get the idea). Paolo