From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOkWu-0007ux-IZ for qemu-devel@nongnu.org; Thu, 28 Jan 2016 06:14:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOkWq-0002MM-FW for qemu-devel@nongnu.org; Thu, 28 Jan 2016 06:14:24 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:33320) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOkWq-0002M0-4u for qemu-devel@nongnu.org; Thu, 28 Jan 2016 06:14:20 -0500 Received: by mail-wm0-x242.google.com with SMTP id r129so3032526wmr.0 for ; Thu, 28 Jan 2016 03:14:20 -0800 (PST) Sender: Paolo Bonzini References: <1453976119-24372-1-git-send-email-alex.bennee@linaro.org> <1453976119-24372-2-git-send-email-alex.bennee@linaro.org> From: Paolo Bonzini Message-ID: <56A9F809.8000700@redhat.com> Date: Thu, 28 Jan 2016 12:14:17 +0100 MIME-Version: 1.0 In-Reply-To: <1453976119-24372-2-git-send-email-alex.bennee@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v1 1/5] configure: introduce --extra-libs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Alex_Benn=c3=a9e?= , qemu-devel@nongnu.org Cc: mttcg@listserver.greensocs.com, peter.maydell@linaro.org, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, stefanha@redhat.com, fred.konrad@greensocs.com On 28/01/2016 11:15, 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 does > not get applied at the end of the linker string. > > Signed-off-by: Alex Bennée Did you find out why you need -ltsan? Paolo > --- > v1 > - rebase > - also ensure it is applied to test builds > --- > configure | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/configure b/configure > index 44ac9ab..bd29ba7 100755 > --- a/configure > +++ b/configure > @@ -113,7 +113,7 @@ compile_object() { > compile_prog() { > local_cflags="$1" > local_ldflags="$2" > - do_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags > + do_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags $EXTRA_LIBS > } > > do_libtool() { > @@ -366,6 +366,8 @@ for opt do > --extra-ldflags=*) LDFLAGS="$LDFLAGS $optarg" > EXTRA_LDFLAGS="$optarg" > ;; > + --extra-libs=*) EXTRA_LIBS="$optarg" > + ;; > --enable-debug-info) debug_info="yes" > ;; > --disable-debug-info) debug_info="no" > @@ -786,6 +788,8 @@ for opt do > ;; > --extra-ldflags=*) > ;; > + --extra-libs=*) > + ;; > --enable-debug-info) > ;; > --disable-debug-info) > @@ -1282,6 +1286,7 @@ Advanced options (experts only): > --objcc=OBJCC use Objective-C compiler OBJCC [$objcc] > --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS > --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS > + --extra-libs=LIBS append extra libraries when linking > --make=MAKE use specified make [$make] > --install=INSTALL use specified install [$install] > --python=PYTHON use specified python [$python] > @@ -4715,6 +4720,11 @@ fi > QEMU_CFLAGS="$pixman_cflags $fdt_cflags $QEMU_CFLAGS" > libs_softmmu="$pixman_libs $libs_softmmu" > > +# extra-libs > +LIBS="$LIBS $EXTRA_LIBS" > +libs_softmmu="$libs_softmmu $EXTRA_LIBS" > +libs_qga="$libs_qga $EXTRA_LIBS" > + > echo "Install prefix $prefix" > echo "BIOS directory `eval echo $qemu_datadir`" > echo "binary directory `eval echo $bindir`" > @@ -4885,6 +4895,7 @@ fi > echo "qemu_helperdir=$libexecdir" >> $config_host_mak > echo "extra_cflags=$EXTRA_CFLAGS" >> $config_host_mak > echo "extra_ldflags=$EXTRA_LDFLAGS" >> $config_host_mak > +echo "extra_libs=$EXTRA_LIBS" >> $config_host_mak > echo "qemu_localedir=$qemu_localedir" >> $config_host_mak > echo "libs_softmmu=$libs_softmmu" >> $config_host_mak > >