From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPAwm-0003ex-Ry for qemu-devel@nongnu.org; Fri, 29 Jan 2016 10:26:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPAwj-0003r1-Kt for qemu-devel@nongnu.org; Fri, 29 Jan 2016 10:26:52 -0500 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:36651) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPAwj-0003pl-Dl for qemu-devel@nongnu.org; Fri, 29 Jan 2016 10:26:49 -0500 Received: by mail-wm0-x22c.google.com with SMTP id p63so73292308wmp.1 for ; Fri, 29 Jan 2016 07:26:48 -0800 (PST) References: <1453976119-24372-1-git-send-email-alex.bennee@linaro.org> <1453976119-24372-3-git-send-email-alex.bennee@linaro.org> <56A9F7F1.7070903@redhat.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <56A9F7F1.7070903@redhat.com> Date: Fri, 29 Jan 2016 15:26:45 +0000 Message-ID: <87twlwh0ei.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v1 2/5] configure: ensure ldflags propagated to config_host List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: mttcg@listserver.greensocs.com, peter.maydell@linaro.org, mark.burton@greensocs.com, qemu-devel@nongnu.org, a.rigo@virtualopensystems.com, stefanha@redhat.com, fred.konrad@greensocs.com Paolo Bonzini writes: > On 28/01/2016 11:15, Alex Bennée wrote: >> diff --git a/configure b/configure >> index bd29ba7..148b79a 100755 >> --- a/configure >> +++ b/configure >> @@ -5871,7 +5871,7 @@ if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then >> ldflags="$ldflags $textseg_ldflags" >> fi >> >> -echo "LDFLAGS+=$ldflags" >> $config_target_mak >> +echo "LDFLAGS+=$ldflags" >> $config_host_mak >> echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak >> >> done # for target in $targets > > Hmm wait, it's not okay. > > This adds the *target* LDFLAGS to config-host.mak, and adds them a > zillion times. extra-ldflags is already added to LDFLAGS in > config-host.mak: > > --extra-ldflags=*) LDFLAGS="$LDFLAGS $optarg" > EXTRA_LDFLAGS="$optarg" > ;; > > ... > > echo "LDFLAGS=$LDFLAGS" >> $config_host_mak > > So I'm totally confused as to what this patch is trying to achieve... It seems so was I. So I was having problems with ancillary binaries failing to link against tsan but as you point out this should work with "-fsantiize=thread" in the ldflags which are already available to config_host.mak On my Gentoo (GCC 4.9) system without this I can build with: ./configure ${TARGETS} --extra-cflags="-fsanitize=thread -fPIE" \ --extra-ldflags="-pie -fsanitize=thread" --with-coroutine=gthread Although I get make check failures: GTESTER tests/check-qdict FATAL: ThreadSanitizer can not mmap the shadow memory (something is mapped at 0x555555554000 < 0x7cf000000000) FATAL: Make sure to compile with -fPIE and to link with -pie. /home/alex/lsrc/qemu/qemu.git/tests/Makefile:629: recipe for target 'check-tests/check-qdict' failed make: *** [check-tests/check-qdict] Error 1 But I suspect this is possibly an ASLR issue. I think this patch can be dropped altogether. With the other patches can you build with tsan the proper way? What are you running? I'll add it to the VMs I have to double check. -- Alex Bennée