From patchwork Thu Jan 28 10:15:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 8148361 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D06E6BEEE5 for ; Thu, 28 Jan 2016 10:17:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 173E52034F for ; Thu, 28 Jan 2016 10:17:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 65A1120320 for ; Thu, 28 Jan 2016 10:17:03 +0000 (UTC) Received: from localhost ([::1]:55069 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOjdN-0001zT-I6 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 28 Jan 2016 05:17:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42542) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOjbs-0007b8-DB for qemu-devel@nongnu.org; Thu, 28 Jan 2016 05:15:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOjbp-0001Wf-MD for qemu-devel@nongnu.org; Thu, 28 Jan 2016 05:15:28 -0500 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:34578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOjbp-0001WL-F2 for qemu-devel@nongnu.org; Thu, 28 Jan 2016 05:15:25 -0500 Received: by mail-wm0-x233.google.com with SMTP id 128so3576951wmz.1 for ; Thu, 28 Jan 2016 02:15:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=PYLKj6L3Pprjk4HcGep3f1xYNJaarlHAyGjiq72Qiz4=; b=UUQxdnV4uofu2wwa/GFJiSe+Bofs0uETupRjKkmCNUXi6WVz3hXLWsNZ3f6gkFM15w 9g8/w2k5s1JccdosqjB+bPQb8dn0Q4ozP1Y3R86tPm7gD5hOLnPhoVuDNizFjIsTFlns BB57G+UWSlopKeCTDzYr5hYgsDRVNZQCgkbrk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=PYLKj6L3Pprjk4HcGep3f1xYNJaarlHAyGjiq72Qiz4=; b=CrEZBOZ0fblmjVwBTNbv5LOEKFfBFESAuyOzfX1pKRNU4EosBwexELlgG9yCF4YTs7 h4FVl6fiyr1nTkTI/PNKOO1+flA0jEXop90ygfimgTuFJpVb+msHzUT/7WLIVp9GPZ1Q 78lkccJcx+43p3dkJ29TOSAMC18tsekX3aNO7eqTjyjg1yrpeG/9CgJqZDdAe7izv2Uf IS88z2xmCc9iUcKcHqYTQa3PXkQlPBIcxD3QazgZABvegFazsCO++OczexdB/G/N+623 rZB2yUlRDQzG3pnKri6cQ1GhXHcN+fNAQbC8cX8Q2N/Y8i7D4S2VyMpZrOdQowpdZSsB d0LA== X-Gm-Message-State: AG10YORMbixOTyJeNs4brBGCN2H5taxYW05pAyv9QlcsT1CqMV9q19lglnTNWa4DskzvCxYP X-Received: by 10.28.182.133 with SMTP id g127mr2077168wmf.61.1453976124900; Thu, 28 Jan 2016 02:15:24 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id lc3sm10308581wjb.7.2016.01.28.02.15.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2016 02:15:23 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 94EA63E0770; Thu, 28 Jan 2016 10:15:22 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 28 Jan 2016 10:15:16 +0000 Message-Id: <1453976119-24372-3-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453976119-24372-1-git-send-email-alex.bennee@linaro.org> References: <1453976119-24372-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::233 Cc: mttcg@listserver.greensocs.com, peter.maydell@linaro.org, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, stefanha@redhat.com, pbonzini@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , fred.konrad@greensocs.com Subject: [Qemu-devel] [PATCH v1 2/5] configure: ensure ldflags propagated to config_host X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If for example you want to use the thread sanitizer you want to ensure all binaries have the extra linker flags applied: ./configure ${TARGETS} --cc=gcc-5 --cxx=g++-5 \ --extra-cflags="-fsanitize=thread" --extra-ldflags="-fsanitize=thread" Or possibly: ./configure ${TARGETS} --extra-cflags="-fsanitize=thread -fPIC" \ --extra-ldflags="-fsanitize=thread -pie" Unlike CFLAGS we don't have a QEMU_LDFLAGS which would be appropriate if we only ever needed to affect ${TARGET} binaries. Signed-off-by: Alex Bennée --- v1 - new for v1 - --extra-ldflags alternative to -ltsan - yet another example invocation (gcc 4.9/Gentoo) --- Makefile | 4 ++-- configure | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d0de2d4..d30532f 100644 --- a/Makefile +++ b/Makefile @@ -329,9 +329,9 @@ qemu-ga: qemu-ga$(EXESUF) $(QGA_VSS_PROVIDER) $(QEMU_GA_MSI) endif ivshmem-client$(EXESUF): $(ivshmem-client-obj-y) - $(call LINK, $^) + $(call LINK, $^, $(ldflags)) ivshmem-server$(EXESUF): $(ivshmem-server-obj-y) libqemuutil.a libqemustub.a - $(call LINK, $^) + $(call LINK, $^, $(ldflags)) clean: # avoid old build problems by removing potentially incorrect old files 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