[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 2/4] configure: introduce --extra-libs
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] [RFC PATCH 2/4] configure: introduce --extra-libs |
Date: |
Mon, 25 Jan 2016 17:25:48 +0000 |
User-agent: |
mu4e 0.9.17; emacs 25.0.50.6 |
Peter Maydell <address@hidden> writes:
> On 25 January 2016 at 16:49, Alex Bennée <address@hidden> 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"
>>
>> This is more explicit than just specifying --extra-ldflags which might
>> not get applied in the right place all the time.
>
> When would they differ? The commit message makes this sound like
> it's working around a bug in the code that uses LDFLAGS...
Well LDFLAGS doesn't get applied everywhere so with:
--cc=gcc-5 --cxx=g++-5 --extra-cflags="-fsanitize=thread"
--extra-ldflags="-ltsan" --with-coroutine=gthread
You get compile failures in the ancillary binaries that are used during
testing.
LINK tests/qemu-iotests/socket_scm_helper
tests/qemu-iotests/socket_scm_helper.o: In function `main':
/home/alex/lsrc/qemu/qemu.git/tests/qemu-iotests/socket_scm_helper.c:95:
undefined reference to `__tsan_func_entry'
/home/alex/lsrc/qemu/qemu.git/tests/qemu-iotests/socket_scm_helper.c:106:
undefined reference to `__tsan_read8'
/home/alex/lsrc/qemu/qemu.git/tests/qemu-iotests/socket_scm_helper.c:106:
undefined reference to `__tsan_read8'
...
I think this stems from my confusion from exactly which binaries are
meant to be affected by which flags. QEMU_CFLAGS seems to imply it's
QEMU only, but we don't have a QEMU_LDFLAGS so should LDFLAGS be shared
with all binaries we build?
--
Alex Bennée
[Qemu-devel] [RFC PATCH 3/4] include/qemu/atomic.h: default to __atomic functions, Alex Bennée, 2016/01/25
[Qemu-devel] [RFC PATCH 4/4] tsan: various fixes for make check, Alex Bennée, 2016/01/25