From: "Alex Bennée" <alex.bennee@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: mttcg@greensocs.com, peter.maydell@linaro.org,
mark.burton@greensocs.com, a.rigo@virtualopensystems.com,
qemu-devel@nongnu.org, fred.konrad@greensocs.com
Subject: Re: [Qemu-devel] [RFC PATCH 2/4] configure: introduce --extra-libs
Date: Tue, 26 Jan 2016 08:43:59 +0000 [thread overview]
Message-ID: <87r3h4ohm8.fsf@linaro.org> (raw)
In-Reply-To: <56A69D4A.3060807@redhat.com>
Paolo Bonzini <pbonzini@redhat.com> writes:
> On 25/01/2016 19:15, Alex Bennée wrote:
>>
>> Paolo Bonzini <pbonzini@redhat.com> 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).
Hmm odd. I ran the undefined and address sanitizers without having to
mess with the ldflags. I'll have a deeper dive into the docs to see
whats going on.
>
> Paolo
--
Alex Bennée
next prev parent reply other threads:[~2016-01-26 8:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-25 16:49 [Qemu-devel] [RFC PATCH 0/4] ThreadSanitizer support Alex Bennée
2016-01-25 16:49 ` [Qemu-devel] [RFC PATCH 1/4] configure: move EXTRA_CFLAGS append to the end Alex Bennée
2016-01-25 17:04 ` Peter Maydell
2016-01-25 17:37 ` Peter Maydell
2016-01-25 16:49 ` [Qemu-devel] [RFC PATCH 2/4] configure: introduce --extra-libs Alex Bennée
2016-01-25 17:08 ` Peter Maydell
2016-01-25 17:25 ` Alex Bennée
2016-01-25 17:36 ` Peter Maydell
2016-01-25 17:58 ` Paolo Bonzini
2016-01-25 18:15 ` Alex Bennée
2016-01-25 22:10 ` Paolo Bonzini
2016-01-26 8:43 ` Alex Bennée [this message]
2016-01-25 16:49 ` [Qemu-devel] [RFC PATCH 3/4] include/qemu/atomic.h: default to __atomic functions Alex Bennée
2016-01-25 18:04 ` Paolo Bonzini
2016-01-25 18:23 ` Alex Bennée
2016-01-25 22:02 ` Paolo Bonzini
2016-01-25 16:49 ` [Qemu-devel] [RFC PATCH 4/4] tsan: various fixes for make check Alex Bennée
2016-01-25 18:09 ` Paolo Bonzini
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=87r3h4ohm8.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=a.rigo@virtualopensystems.com \
--cc=fred.konrad@greensocs.com \
--cc=mark.burton@greensocs.com \
--cc=mttcg@greensocs.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.