From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNktm-0007YM-I6 for qemu-devel@nongnu.org; Mon, 25 Jan 2016 12:25:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aNktj-0006aS-Bn for qemu-devel@nongnu.org; Mon, 25 Jan 2016 12:25:54 -0500 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:38725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNktj-0006a5-1L for qemu-devel@nongnu.org; Mon, 25 Jan 2016 12:25:51 -0500 Received: by mail-wm0-x22b.google.com with SMTP id b14so91612936wmb.1 for ; Mon, 25 Jan 2016 09:25:50 -0800 (PST) References: <1453740558-16303-1-git-send-email-alex.bennee@linaro.org> <1453740558-16303-3-git-send-email-alex.bennee@linaro.org> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: Date: Mon, 25 Jan 2016 17:25:48 +0000 Message-ID: <87wpqxo9k3.fsf@linaro.org> MIME-Version: 1.0 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: Peter Maydell Cc: mttcg@listserver.greensocs.com, Mark Burton , Alvise Rigo , QEMU Developers , Paolo Bonzini , KONRAD =?utf-8?B?RnLDqWTDqXJp?= =?utf-8?B?Yw==?= Peter Maydell writes: > On 25 January 2016 at 16: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" >> >> 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