From nobody Tue May 7 13:35:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576075852; cv=none; d=zohomail.com; s=zohoarc; b=mcYOme2hkEoIfsJ9FIA/lQ8bhtpWRXWteuFHGapZYiTqvRbnW8hS5ssQxAanoT4ACmcZCNsoYap90xYobasv0TtzPy91KRKX9FwxMkJVPXP2gST3aZM8u3J9H63Pw6ZoW/D9m5E5J46PM6DpKYbIwDTcRafHryDMmReSj4Aw7yg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576075852; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=FtXOjnrklkvgY+YgghuBWxOUjW2j0duT4sqo5ka/V5k=; b=Oz5cqs0mX3jP3gtLV2h095a59LG9tm3pVWnMlYZvlGSd5dF/pDb0Os79FkzDMDbXNNgoGEquH9NHRc4wwtmns/UdvGdYmNl9TcpoE1rSgTZffxeakpJla8n3gtIUhdE0i4HE36w6HR0X1MAcxW2CYXGs9VKzhpNTCjd98XyTYOg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576075852356464.98571795778787; Wed, 11 Dec 2019 06:50:52 -0800 (PST) Received: from localhost ([::1]:43562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1if3KF-0005GT-1s for importer@patchew.org; Wed, 11 Dec 2019 09:50:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35925) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1if3Gf-00021r-Go for qemu-devel@nongnu.org; Wed, 11 Dec 2019 09:47:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1if3Gd-0005OW-CZ for qemu-devel@nongnu.org; Wed, 11 Dec 2019 09:47:09 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:33915) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1if3Gb-0005JX-CG for qemu-devel@nongnu.org; Wed, 11 Dec 2019 09:47:06 -0500 Received: by mail-wm1-x336.google.com with SMTP id f4so1370422wmj.1 for ; Wed, 11 Dec 2019 06:47:04 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id c9sm2439809wmc.47.2019.12.11.06.46.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Dec 2019 06:47:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FtXOjnrklkvgY+YgghuBWxOUjW2j0duT4sqo5ka/V5k=; b=g4q7/8BPFVqIlCY9xgotqUb82YdXZoudAfj7+I2LvvwUckVYOyo2HXcZPrjV+qyiNU ze9VWYM1hI8zogbINXRWDXhtzfxLUDYHcTwu2DpGTSlYayiPFp/WFV/dNmbjX4k7tRGi Zd3jL0AcQy6ugWEfFjgjhnzG84J2EHw7xdNRR1yzm8bqA+I15I/TvAdiYxsgMAy5v5kV BvTmEk8sFAhIioP8zWbC/9QPp0DM57WVDgAPA9O29aTpjMsUOUxyrt/HpK8WcWO5X8n2 tF5Ldy8QKqRv9Lm2pmVEg7cHK+onJKi+BTfowcMbpXcMxdXMK/9dmwWFVV3QqGG8A+Um EGBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=FtXOjnrklkvgY+YgghuBWxOUjW2j0duT4sqo5ka/V5k=; b=QkywdiJn10JB8w05ycrzIXA2lFq7aP/qEL53YJjdpKe5YCx/Mks/gDy4XU6vNbXiYL XNvUOBf9RqyePazh8vlI+Sfi0vzp2hq+DOCQpmqgcnOTHFadRcvI+T/9srOV476fidtR feyG3k0PNgW1LKgKCVdIyZmI1p29FqnrU5algdFOhK88Yf6hRpFh7mukQKojK5Rkho+q eWu0kl5GF9oD0B0BJX+3OkI5tPi9m+Q9SEWdHTC613+NitMCyOyVNU4MUZpOVmN0R9bU UwYysEUarhts5rJzITceFiABsLljm5y7zFJDyReVe133x9Zv5uP7p5zy1Oy2xhBowrfE UMDA== X-Gm-Message-State: APjAAAWDEjXXDK2gWvM1JCqEg/1jwkGJqn9lebeaxU5Y8Y7VT2ox3i0+ AAPB4u/Lgnr1E/bsrEK1LQbHq+E/ X-Google-Smtp-Source: APXvYqzate1zezsOIxboc2y7Xp9O4PXpIenWhE2CoegtGgt4wwohZeQ3qGkRvurgwmA5zgxYgBuJLg== X-Received: by 2002:a1c:99d4:: with SMTP id b203mr120009wme.169.1576075620705; Wed, 11 Dec 2019 06:47:00 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH] build-sys: clean up flags included in the linker command line Date: Wed, 11 Dec 2019 15:46:59 +0100 Message-Id: <1576075619-53005-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::336 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Some of the CFLAGS that are discovered during configure, for example compiler warnings, are being included on the linker command line because QEMU_CFLAGS is added to it. Other flags, such as the -m32, appear twice because they are included in both QEMU_CFLAGS and LDFLAGS. All this leads to confusion with respect to what goes in which Makefile variables (and we have plenty). So, introduce QEMU_LDFLAGS for flags discovered by configure, following the lead of QEMU_CFLAGS, and stop adding to it: 1) options that are already in CFLAGS, for example "-g" 2) duplicate options At the same time, options that _are_ needed by both compiler and linker must now be added to both QEMU_CFLAGS and QEMU_LDFLAGS, which is clearer. This is mostly -fsanitize options. Meson will not include CFLAGS on the linker command line, do the same in our build system as well. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- .travis.yml | 4 +-- Makefile | 4 +-- configure | 60 ++++++++++++++++++++++-------------------= ---- qga/vss-win32/Makefile.objs | 4 +-- rules.mak | 4 +-- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.travis.yml b/.travis.yml index d3a12ae..186738d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -193,7 +193,7 @@ matrix: compiler: clang before_script: - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} - - ${SRC_DIR}/configure ${CONFIG} --extra-cflags=3D"-fsanitize=3Dun= defined -Werror" || { cat config.log && exit 1; } + - ${SRC_DIR}/configure ${CONFIG} --extra-cflags=3D"-fsanitize=3Dun= defined -Werror" --extra-ldflags=3D"-fsanitize=3Dundefined" || { cat config= .log && exit 1; } =20 =20 - env: @@ -325,7 +325,7 @@ matrix: - TEST_CMD=3D"" before_script: - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} - - ${SRC_DIR}/configure ${CONFIG} --extra-cflags=3D"-g3 -O0 -Wno-er= ror=3Dstringop-truncation -fsanitize=3Dthread -fuse-ld=3Dgold" || { cat con= fig.log && exit 1; } + - ${SRC_DIR}/configure ${CONFIG} --extra-cflags=3D"-g3 -O0 -Wno-er= ror=3Dstringop-truncation -fsanitize=3Dthread" --extra-ldflags=3D"-fsanitiz= e=3Dthread -fuse-ld=3Dgold" || { cat config.log && exit 1; } =20 =20 # Run check-tcg against linux-user diff --git a/Makefile b/Makefile index 96e69dd..df92220 100644 --- a/Makefile +++ b/Makefile @@ -487,7 +487,7 @@ DTC_CPPFLAGS=3D-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$= (SRC_PATH)/dtc/libfdt =20 .PHONY: dtc/all dtc/all: .git-submodule-status dtc/libfdt dtc/tests - $(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS=3D"$(DTC_CPPFLAGS)= " CFLAGS=3D"$(DTC_CFLAGS)" LDFLAGS=3D"$(LDFLAGS)" ARFLAGS=3D"$(ARFLAGS)" CC= =3D"$(CC)" AR=3D"$(AR)" LD=3D"$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,) + $(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS=3D"$(DTC_CPPFLAGS)= " CFLAGS=3D"$(DTC_CFLAGS)" LDFLAGS=3D"$(QEMU_LDFLAGS)" ARFLAGS=3D"$(ARFLAGS= )" CC=3D"$(CC)" AR=3D"$(AR)" LD=3D"$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt= .a,) =20 dtc/%: .git-submodule-status @mkdir -p $@ @@ -514,7 +514,7 @@ slirp/all: .git-submodule-status BUILD_DIR=3D"$(BUILD_DIR)/slirp" \ PKG_CONFIG=3D"$(PKG_CONFIG)" \ CC=3D"$(CC)" AR=3D"$(AR)" LD=3D"$(LD)" RANLIB=3D"$(RANLIB)" \ - CFLAGS=3D"$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS=3D"$(LDFLAGS)") + CFLAGS=3D"$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS=3D"$(QEMU_LDFLAGS)") =20 # Compatibility gunk to keep make working across the rename of targets # for recursion, to be removed some time after 4.1. diff --git a/configure b/configure index 19b209a..7f96279 100755 --- a/configure +++ b/configure @@ -126,7 +126,7 @@ compile_object() { compile_prog() { local_cflags=3D"$1" local_ldflags=3D"$2" - do_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags + do_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $QEMU_LDFLAGS $local_ldf= lags } =20 # symbolically link $1 to $2. Portable version of "ln -sf". @@ -526,7 +526,7 @@ for opt do ;; --extra-cxxflags=3D*) QEMU_CXXFLAGS=3D"$QEMU_CXXFLAGS $optarg" ;; - --extra-ldflags=3D*) LDFLAGS=3D"$LDFLAGS $optarg" + --extra-ldflags=3D*) QEMU_LDFLAGS=3D"$QEMU_LDFLAGS $optarg" EXTRA_LDFLAGS=3D"$optarg" ;; --enable-debug-info) debug_info=3D"yes" @@ -599,7 +599,6 @@ QEMU_INCLUDES=3D"-iquote . -iquote \$(SRC_PATH) -iquote= \$(SRC_PATH)/accel/tcg -iq QEMU_INCLUDES=3D"$QEMU_INCLUDES -iquote \$(SRC_PATH)/disas/libvixl" if test "$debug_info" =3D "yes"; then CFLAGS=3D"-g $CFLAGS" - LDFLAGS=3D"-g $LDFLAGS" fi =20 # running configure in the source tree? @@ -845,12 +844,12 @@ Darwin) LDFLAGS_SHARED=3D"-bundle -undefined dynamic_lookup" if [ "$cpu" =3D "x86_64" ] ; then QEMU_CFLAGS=3D"-arch x86_64 $QEMU_CFLAGS" - LDFLAGS=3D"-arch x86_64 $LDFLAGS" + QEMU_LDFLAGS=3D"-arch x86_64 $QEMU_LDFLAGS" fi cocoa=3D"yes" audio_drv_list=3D"coreaudio try-sdl" audio_possible_drivers=3D"coreaudio sdl" - LDFLAGS=3D"-framework CoreFoundation -framework IOKit $LDFLAGS" + QEMU_LDFLAGS=3D"-framework CoreFoundation -framework IOKit $QEMU_LDFLAGS" libs_softmmu=3D"-F/System/Library/Frameworks -framework Cocoa -framework= IOKit $libs_softmmu" # Disable attempts to use ObjectiveC features in os/object.h since they # won't work when we're compiling with gcc as a C compiler. @@ -1025,7 +1024,7 @@ for opt do ;; --static) static=3D"yes" - LDFLAGS=3D"-static $LDFLAGS" + QEMU_LDFLAGS=3D"-static $QEMU_LDFLAGS" QEMU_PKG_CONFIG_FLAGS=3D"--static $QEMU_PKG_CONFIG_FLAGS" ;; --mandir=3D*) mandir=3D"$optarg" @@ -1551,42 +1550,42 @@ done case "$cpu" in ppc) CPU_CFLAGS=3D"-m32" - LDFLAGS=3D"-m32 $LDFLAGS" + QEMU_LDFLAGS=3D"-m32 $QEMU_LDFLAGS" ;; ppc64) CPU_CFLAGS=3D"-m64" - LDFLAGS=3D"-m64 $LDFLAGS" + QEMU_LDFLAGS=3D"-m64 $QEMU_LDFLAGS" ;; sparc) CPU_CFLAGS=3D"-m32 -mv8plus -mcpu=3Dultrasparc" - LDFLAGS=3D"-m32 -mv8plus $LDFLAGS" + QEMU_LDFLAGS=3D"-m32 -mv8plus $QEMU_LDFLAGS" ;; sparc64) CPU_CFLAGS=3D"-m64 -mcpu=3Dultrasparc" - LDFLAGS=3D"-m64 $LDFLAGS" + QEMU_LDFLAGS=3D"-m64 $QEMU_LDFLAGS" ;; s390) CPU_CFLAGS=3D"-m31" - LDFLAGS=3D"-m31 $LDFLAGS" + QEMU_LDFLAGS=3D"-m31 $QEMU_LDFLAGS" ;; s390x) CPU_CFLAGS=3D"-m64" - LDFLAGS=3D"-m64 $LDFLAGS" + QEMU_LDFLAGS=3D"-m64 $QEMU_LDFLAGS" ;; i386) CPU_CFLAGS=3D"-m32" - LDFLAGS=3D"-m32 $LDFLAGS" + QEMU_LDFLAGS=3D"-m32 $QEMU_LDFLAGS" ;; x86_64) # ??? Only extremely old AMD cpus do not have cmpxchg16b. # If we truly care, we should simply detect this case at # runtime and generate the fallback to serial emulation. CPU_CFLAGS=3D"-m64 -mcx16" - LDFLAGS=3D"-m64 $LDFLAGS" + QEMU_LDFLAGS=3D"-m64 $QEMU_LDFLAGS" ;; x32) CPU_CFLAGS=3D"-mx32" - LDFLAGS=3D"-mx32 $LDFLAGS" + QEMU_LDFLAGS=3D"-mx32 $QEMU_LDFLAGS" ;; # No special flags required for other host CPUs esac @@ -1967,6 +1966,7 @@ EOF if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC && compile_prog "-Werror $flag" ""; then QEMU_CFLAGS=3D"$QEMU_CFLAGS $flag" + QEMU_LDFLAGS=3D"$QEMU_LDFLAGS $flag" sp_on=3D1 break fi @@ -2051,10 +2051,10 @@ EOF =20 if compile_prog "-fPIE -DPIE" "-pie"; then QEMU_CFLAGS=3D"-fPIE -DPIE $QEMU_CFLAGS" - LDFLAGS=3D"-pie $LDFLAGS" + QEMU_LDFLAGS=3D"-pie $QEMU_LDFLAGS" pie=3D"yes" if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then - LDFLAGS=3D"-Wl,-z,relro -Wl,-z,now $LDFLAGS" + QEMU_LDFLAGS=3D"-Wl,-z,relro -Wl,-z,now $QEMU_LDFLAGS" fi else if test "$pie" =3D "yes"; then @@ -5862,7 +5862,7 @@ EOF hvf=3D'no' else hvf=3D'yes' - LDFLAGS=3D"-framework Hypervisor $LDFLAGS" + QEMU_LDFLAGS=3D"-framework Hypervisor $QEMU_LDFLAGS" fi fi =20 @@ -6096,8 +6096,8 @@ esac write_c_skeleton =20 if test "$gcov" =3D "yes" ; then - CFLAGS=3D"-fprofile-arcs -ftest-coverage -g $CFLAGS" - LDFLAGS=3D"-fprofile-arcs -ftest-coverage $LDFLAGS" + QEMU_CFLAGS=3D"-fprofile-arcs -ftest-coverage -g $QEMU_CFLAGS" + QEMU_LDFLAGS=3D"-fprofile-arcs -ftest-coverage $QEMU_LDFLAGS" elif test "$fortify_source" =3D "yes" ; then CFLAGS=3D"-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3D2 $CFLAGS" elif test "$debug" =3D "no"; then @@ -6105,7 +6105,8 @@ elif test "$debug" =3D "no"; then fi =20 if test "$have_asan" =3D "yes"; then - CFLAGS=3D"-fsanitize=3Daddress $CFLAGS" + QEMU_CFLAGS=3D"-fsanitize=3Daddress $QEMU_CFLAGS" + QEMU_LDFLAGS=3D"-fsanitize=3Daddress $QEMU_LDFLAGS" if test "$have_asan_iface_h" =3D "no" ; then echo "ASAN build enabled, but ASAN header missing." \ "Without code annotation, the report may be inferior." @@ -6115,7 +6116,8 @@ if test "$have_asan" =3D "yes"; then fi fi if test "$have_ubsan" =3D "yes"; then - CFLAGS=3D"-fsanitize=3Dundefined $CFLAGS" + QEMU_CFLAGS=3D"-fsanitize=3Dundefined $QEMU_CFLAGS" + QEMU_LDFLAGS=3D"-fsanitize=3Dundefined $QEMU_LDFLAGS" fi =20 ########################################## @@ -6150,7 +6152,7 @@ fi =20 if test "$solaris" =3D "no" ; then if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; = then - LDFLAGS=3D"-Wl,--warn-common $LDFLAGS" + QEMU_LDFLAGS=3D"-Wl,--warn-common $QEMU_LDFLAGS" fi fi =20 @@ -6165,7 +6167,7 @@ fi if test "$mingw32" =3D "yes" ; then for flag in --dynamicbase --no-seh --nxcompat; do if ld_has $flag ; then - LDFLAGS=3D"-Wl,$flag $LDFLAGS" + QEMU_LDFLAGS=3D"-Wl,$flag $QEMU_LDFLAGS" fi done fi @@ -6400,7 +6402,7 @@ EOF =20 update_cxxflags =20 - if do_cxx $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $LDFLAGS; then + if do_cxx $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $QEMU_LDFLAGS; then # C++ compiler $cxx works ok with C compiler $cc : else @@ -6452,7 +6454,6 @@ echo "Objective-C compiler $objcc" echo "ARFLAGS $ARFLAGS" echo "CFLAGS $CFLAGS" echo "QEMU_CFLAGS $QEMU_CFLAGS" -echo "LDFLAGS $LDFLAGS" echo "QEMU_LDFLAGS $QEMU_LDFLAGS" echo "make $make" echo "install $install" @@ -7519,9 +7520,8 @@ if test "$sparse" =3D "yes" ; then echo "HOST_CC :=3D REAL_CC=3D\"\$(HOST_CC)\" cgcc" >> $config_host= _mak echo "QEMU_CFLAGS +=3D -Wbitwise -Wno-transparent-union -Wno-old-initia= lizer -Wno-non-pointer-null" >> $config_host_mak fi -echo "LDFLAGS=3D$LDFLAGS" >> $config_host_mak -echo "LDFLAGS_NOPIE=3D$LDFLAGS_NOPIE" >> $config_host_mak echo "QEMU_LDFLAGS=3D$QEMU_LDFLAGS" >> $config_host_mak +echo "LDFLAGS_NOPIE=3D$LDFLAGS_NOPIE" >> $config_host_mak echo "LD_REL_FLAGS=3D$LD_REL_FLAGS" >> $config_host_mak echo "LD_I386_EMULATION=3D$ld_i386_emulation" >> $config_host_mak echo "LIBS+=3D$LIBS" >> $config_host_mak @@ -7847,7 +7847,7 @@ if test "$target_bsd_user" =3D "yes" ; then fi =20 =20 -# generate QEMU_CFLAGS/LDFLAGS for targets +# generate QEMU_CFLAGS/QEMU_LDFLAGS for targets =20 cflags=3D"" ldflags=3D"" @@ -7968,7 +7968,7 @@ if test "$TARGET_ARCH" =3D "s390x" && test "$target_s= oftmmu" =3D "yes" && \ fi fi =20 -echo "LDFLAGS+=3D$ldflags" >> $config_target_mak +echo "QEMU_LDFLAGS+=3D$ldflags" >> $config_target_mak echo "QEMU_CFLAGS+=3D$cflags" >> $config_target_mak =20 done # for target in $targets diff --git a/qga/vss-win32/Makefile.objs b/qga/vss-win32/Makefile.objs index fd3ba18..c82676a 100644 --- a/qga/vss-win32/Makefile.objs +++ b/qga/vss-win32/Makefile.objs @@ -5,9 +5,9 @@ qga-vss-dll-obj-y +=3D requester.o provider.o install.o obj-qga-vss-dll-obj-y =3D $(addprefix $(obj)/, $(qga-vss-dll-obj-y)) $(obj-qga-vss-dll-obj-y): QEMU_CXXFLAGS :=3D $(filter-out -fstack-protecto= r-all -fstack-protector-strong, $(QEMU_CXXFLAGS)) -Wno-unknown-pragmas -Wno= -delete-non-virtual-dtor =20 -$(obj)/qga-vss.dll: LDFLAGS =3D -shared -Wl,--add-stdcall-alias,--enable-s= tdcall-fixup -lglib-2.0 -lole32 -loleaut32 -lshlwapi -luuid -lintl -lws2_32= -static +QGA_VSS_LDFLAGS =3D -shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup= -lglib-2.0 -lole32 -loleaut32 -lshlwapi -luuid -lintl -lws2_32 -static $(obj)/qga-vss.dll: $(obj-qga-vss-dll-obj-y) $(SRC_PATH)/$(obj)/qga-vss.def - $(call quiet-command,$(CXX) -o $@ $(qga-vss-dll-obj-y) $(SRC_PATH)/qga/vs= s-win32/qga-vss.def $(CXXFLAGS) $(LDFLAGS),"LINK","$(TARGET_DIR)$@") + $(call quiet-command,$(CXX) -o $@ $(qga-vss-dll-obj-y) $(SRC_PATH)/qga/vs= s-win32/qga-vss.def $(CXXFLAGS) $(QGA_VSS_LDFLAGS),"LINK","$(TARGET_DIR)$@") =20 =20 # rules to build qga-provider.tlb diff --git a/rules.mak b/rules.mak index 967295d..c855887 100644 --- a/rules.mak +++ b/rules.mak @@ -76,7 +76,7 @@ expand-objs =3D $(strip $(sort $(filter %.o,$1)) \ # must link with the C++ compiler, not the plain C compiler. LINKPROG =3D $(or $(CXX),$(CC)) =20 -LINK =3D $(call quiet-command, $(LINKPROG) $(QEMU_LDFLAGS) $(QEMU_CFLAGS) = $(CFLAGS) $(LDFLAGS) -o $@ \ +LINK =3D $(call quiet-command, $(LINKPROG) $(CFLAGS) $(QEMU_LDFLAGS) -o $@= \ $(call process-archive-undefs, $1) \ $(version-obj-y) $(call extract-libs,$1) $(LIBS),"LINK","$(TARGET_D= IR)$@") =20 @@ -105,7 +105,7 @@ LINK =3D $(call quiet-command, $(LINKPROG) $(QEMU_LDFLA= GS) $(QEMU_CFLAGS) $(CFLAGS =20 DSO_OBJ_CFLAGS :=3D -fPIC -DBUILD_DSO module-common.o: CFLAGS +=3D $(DSO_OBJ_CFLAGS) -%$(DSOSUF): LDFLAGS +=3D $(LDFLAGS_SHARED) +%$(DSOSUF): QEMU_LDFLAGS +=3D $(LDFLAGS_SHARED) %$(DSOSUF): %.mo $(call LINK,$^) @# Copy to build root so modules can be loaded when program started witho= ut install --=20 1.8.3.1