From nobody Sun Nov 16 07:41:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599052860; cv=none; d=zohomail.com; s=zohoarc; b=ZkVRG98MNJ3dChgQlcMRCaawqVd5gMLph4IJsxDU5jwHuOATcN14xVZGlnmXw824r7wZvwgTqltcT/4mABNFeMZZDFZHEoXuJLHXHnK92p6rFh/UP9iP/Fm4Ie6nPA+a9vjkU/VH9S11a3KPp0L374YT9C7+QkleP9OiDJ+uH0k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599052860; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=k1XV5DOHzM01Ds3aOXz7sZWweYvqtSodxJFaptYarYQ=; b=BzbkJK2ft6cOgWaHQ0jhvwMH39SkfV6O33GxZz6gMT/B+QIgfLL8ayDs/eUW8NSFK07K0dPinaM3beZrDgilarMIbrGXa/6Czp/SMhL67zXBSaNWtIdF3qHu79SXJHtKD2VIlQDBeVMDRQdbL1GjXe+pyCechZaWm40gv1NL8pw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1599052860753575.2216357281412; Wed, 2 Sep 2020 06:21:00 -0700 (PDT) Received: from localhost ([::1]:60216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDSh9-0004sH-RN for importer@patchew.org; Wed, 02 Sep 2020 09:20:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDSMc-0006XB-7e for qemu-devel@nongnu.org; Wed, 02 Sep 2020 08:59:46 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:56766 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDSMX-0007Ar-GK for qemu-devel@nongnu.org; Wed, 02 Sep 2020 08:59:45 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-339-lf3v4jhUO4eF0BhHZZZmKA-1; Wed, 02 Sep 2020 08:59:38 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F78C85B67B for ; Wed, 2 Sep 2020 12:59:35 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D25F5D9CC for ; Wed, 2 Sep 2020 12:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599051580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k1XV5DOHzM01Ds3aOXz7sZWweYvqtSodxJFaptYarYQ=; b=K7zGxBJ5g2Xa6Z4VlaTkTiSgVOn9jrh2jwQso1w4Y5pcnfs+rLZf/UuWr2qX8ncX1OqIhP vDkwZwzlMaGL9u51HLqaWrZ605oSzureu92NTG3rfhKGUEex5XinMhSfjCqZMr1W4URNxH iGbV0ULJGQvCeJVRJabFDwoKr8nhq0A= X-MC-Unique: lf3v4jhUO4eF0BhHZZZmKA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 37/39] configure: do not include dependency flags in QEMU_CFLAGS and LIBS Date: Wed, 2 Sep 2020 08:59:15 -0400 Message-Id: <20200902125917.26021-38-pbonzini@redhat.com> In-Reply-To: <20200902125917.26021-1-pbonzini@redhat.com> References: <20200902125917.26021-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=207.211.31.120; envelope-from=pbonzini@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/02 02:07:24 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" All Meson executables should specify their dependencies explicitly, either directly or indirectly via declare_dependency. Makefiles instead did not propagate dependencies correctly from static libraries, for example. Therefore, flags for dependencies need not be included in QEMU_CFLAGS. LIBS is not used at all, so drop that one as well. In a few cases the dependencies were not yet specified, so add them. Signed-off-by: Paolo Bonzini --- Makefile | 2 +- configure | 40 ---------------------------------------- hw/arm/meson.build | 2 +- hw/riscv/meson.build | 2 +- monitor/meson.build | 2 +- 5 files changed, 4 insertions(+), 44 deletions(-) diff --git a/Makefile b/Makefile index 678e76d6f2..d6c5c9fdef 100644 --- a/Makefile +++ b/Makefile @@ -155,7 +155,7 @@ dtc/%: .git-submodule-status # Therefore we replicate some of the logic in the sub-makefile. # Remove all the extra -Warning flags that QEMU uses that Capstone doesn't; # no need to annoy QEMU developers with such things. -CAP_CFLAGS =3D $(patsubst -W%,,$(CFLAGS) $(QEMU_CFLAGS)) +CAP_CFLAGS =3D $(patsubst -W%,,$(CFLAGS) $(QEMU_CFLAGS)) $(CAPSTONE_CFLAGS) CAP_CFLAGS +=3D -DCAPSTONE_USE_SYS_DYN_MEM CAP_CFLAGS +=3D -DCAPSTONE_HAS_ARM CAP_CFLAGS +=3D -DCAPSTONE_HAS_ARM64 diff --git a/configure b/configure index 7d4e499202..044cb413f2 100755 --- a/configure +++ b/configure @@ -814,7 +814,6 @@ FreeBSD) audio_drv_list=3D"oss try-sdl" audio_possible_drivers=3D"oss sdl pa" # needed for kinfo_getvmmap(3) in libutil.h - LIBS=3D"-lutil $LIBS" netmap=3D"" # enable netmap autodetect HOST_VARIANT_DIR=3D"freebsd" ;; @@ -872,13 +871,10 @@ SunOS) QEMU_CFLAGS=3D"-D_XOPEN_SOURCE=3D600 $QEMU_CFLAGS" # needed for TIOCWIN* defines in termios.h QEMU_CFLAGS=3D"-D__EXTENSIONS__ $QEMU_CFLAGS" - solarisnetlibs=3D"-lsocket -lnsl -lresolv" - LIBS=3D"$solarisnetlibs $LIBS" ;; Haiku) haiku=3D"yes" QEMU_CFLAGS=3D"-DB_USE_POSITIVE_POSIX_ERRORS -DBSD_SOURCE $QEMU_CFLAGS" - LIBS=3D"-lposix_error_mapper -lnetwork -lbsd $LIBS" ;; Linux) audio_drv_list=3D"try-pa oss" @@ -948,11 +944,7 @@ if test "$mingw32" =3D "yes" ; then HOST_DSOSUF=3D".dll" # MinGW needs -mthreads for TLS and macro _MT. CFLAGS=3D"-mthreads $CFLAGS" - LIBS=3D"-lwinmm -lws2_32 $LIBS" write_c_skeleton; - if compile_prog "" "-liberty" ; then - LIBS=3D"-liberty $LIBS" - fi prefix=3D"c:/Program Files/QEMU" qemu_suffix=3D"" libs_qga=3D"-lws2_32 -lwinmm -lpowrprof -lwtsapi32 -lwininet -liphlpapi = -lnetapi32 $libs_qga" @@ -2673,7 +2665,6 @@ if test "$xen" !=3D "no" ; then if $pkg_config --exists xentoolcore; then xen_pc=3D"$xen_pc xentoolcore" fi - QEMU_CFLAGS=3D"$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)" xen_cflags=3D"$($pkg_config --cflags $xen_pc)" xen_libs=3D"$($pkg_config --libs $xen_pc)" else @@ -3058,8 +3049,6 @@ if test "$gnutls" !=3D "no"; then # At least ubuntu 18.04 ships only shared libraries. write_c_skeleton if compile_prog "" "$gnutls_libs" ; then - LIBS=3D"$gnutls_libs $LIBS" - QEMU_CFLAGS=3D"$QEMU_CFLAGS $gnutls_cflags" pass=3D"yes" fi fi @@ -3129,8 +3118,6 @@ if test "$nettle" !=3D "no"; then # Link test to make sure the given libraries work (e.g for static). write_c_skeleton if compile_prog "" "$nettle_libs" ; then - LIBS=3D"$nettle_libs $LIBS" - QEMU_CFLAGS=3D"$QEMU_CFLAGS $nettle_cflags" if test -z "$gcrypt"; then gcrypt=3D"no" fi @@ -3173,8 +3160,6 @@ if test "$gcrypt" !=3D "no"; then # Link test to make sure the given libraries work (e.g for static). write_c_skeleton if compile_prog "" "$gcrypt_libs" ; then - LIBS=3D"$gcrypt_libs $LIBS" - QEMU_CFLAGS=3D"$QEMU_CFLAGS $gcrypt_cflags" pass=3D"yes" fi fi @@ -3746,7 +3731,6 @@ for i in $glib_modules; do if $pkg_config --atleast-version=3D$glib_req_ver $i; then glib_cflags=3D$($pkg_config --cflags $i) glib_libs=3D$($pkg_config --libs $i) - LIBS=3D"$glib_libs $LIBS" else error_exit "glib-$glib_req_ver $i is required to compile QEMU" fi @@ -4056,11 +4040,6 @@ if test "$linux_io_uring" !=3D "no" ; then linux_io_uring_cflags=3D$($pkg_config --cflags liburing) linux_io_uring_libs=3D$($pkg_config --libs liburing) linux_io_uring=3Dyes - - # io_uring is used in libqemuutil.a where per-file -libs variables are= not - # seen by programs linking the archive. It's not ideal, but just add = the - # library dependency globally. - LIBS=3D"$linux_io_uring_libs $LIBS" else if test "$linux_io_uring" =3D "yes" ; then feature_not_found "linux io_uring" "Install liburing devel" @@ -4105,7 +4084,6 @@ EOF elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then attr=3Dyes libattr_libs=3D"-lattr" - LIBS=3D"$libattr_libs $LIBS" libattr=3Dyes else if test "$attr" =3D "yes" ; then @@ -4225,7 +4203,6 @@ if test "$opengl" !=3D "no" ; then if test "$gtk" =3D "yes" && $pkg_config --exists "$gtkpackage >=3D 3.1= 6"; then gtk_gl=3D"yes" fi - QEMU_CFLAGS=3D"$QEMU_CFLAGS $opengl_cflags" else if test "$opengl" =3D "yes" ; then feature_not_found "opengl" "Please install opengl (mesa) devel pkgs:= $opengl_pkgs" @@ -4974,7 +4951,6 @@ EOF $pkg_config --atleast-version=3D0.12.3 spice-protocol && \ compile_prog "$spice_cflags" "$spice_libs" ; then spice=3D"yes" - QEMU_CFLAGS=3D"$QEMU_CFLAGS $spice_cflags" else if test "$spice" =3D "yes" ; then feature_not_found "spice" \ @@ -5157,7 +5133,6 @@ case "$capstone" in git_submodules=3D"${git_submodules} capstone" fi mkdir -p capstone - QEMU_CFLAGS=3D"$QEMU_CFLAGS -I${source_path}/capstone/include" if test "$mingw32" =3D "yes"; then LIBCAPSTONE=3Dcapstone.lib else @@ -5170,7 +5145,6 @@ case "$capstone" in system) capstone_libs=3D"$($pkg_config --libs capstone)" capstone_cflags=3D"$($pkg_config --cflags capstone)" - QEMU_CFLAGS=3D"$QEMU_CFLAGS $($pkg_config --cflags capstone)" ;; =20 no) @@ -5319,8 +5293,6 @@ EOF else urcu_bp_libs=3D"-lurcu-bp" fi - - LIBS=3D"$lttng_ust_libs $urcu_bp_libs $LIBS" else error_exit "Trace backend 'ust' missing lttng-ust header files" fi @@ -6101,7 +6073,6 @@ if test "$libpmem" !=3D "no"; then libpmem=3D"yes" libpmem_libs=3D$($pkg_config --libs libpmem) libpmem_cflags=3D$($pkg_config --cflags libpmem) - QEMU_CFLAGS=3D"$QEMU_CFLAGS $libpmem_cflags" else if test "$libpmem" =3D "yes" ; then feature_not_found "libpmem" "Install nvml or pmdk" @@ -6118,7 +6089,6 @@ if test "$libdaxctl" !=3D "no"; then libdaxctl=3D"yes" libdaxctl_libs=3D$($pkg_config --libs libdaxctl) libdaxctl_cflags=3D$($pkg_config --cflags libdaxctl) - QEMU_CFLAGS=3D"$QEMU_CFLAGS $libdaxctl_cflags" else if test "$libdaxctl" =3D "yes" ; then feature_not_found "libdaxctl" "Install libdaxctl" @@ -6301,11 +6271,6 @@ if test "$libudev" !=3D "no" ; then fi fi =20 -# Now we've finished running tests it's OK to add -Werror to the compiler = flags -if test "$werror" =3D "yes"; then - QEMU_CFLAGS=3D"-Werror $QEMU_CFLAGS" -fi - # Exclude --warn-common with TSan to suppress warnings from the TSan libra= ries. if test "$solaris" =3D "no" && test "$tsan" =3D "no"; then if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; = then @@ -6490,10 +6455,6 @@ echo_version() { fi } =20 -# prepend ftd flags after all config tests are done -QEMU_CFLAGS=3D"$fdt_cflags $QEMU_CFLAGS" -QEMU_LDFLAGS=3D"$fdt_ldflags $QEMU_LDFLAGS" - config_host_mak=3D"config-host.mak" =20 echo "# Automatically generated by configure - do not modify" >config-all-= disas.mak @@ -7423,7 +7384,6 @@ echo "QEMU_LDFLAGS=3D$QEMU_LDFLAGS" >> $config_host_m= ak 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 echo "LIBS_TOOLS+=3D$libs_tools" >> $config_host_mak echo "PTHREAD_LIB=3D$PTHREAD_LIB" >> $config_host_mak echo "EXESUF=3D$EXESUF" >> $config_host_mak diff --git a/hw/arm/meson.build b/hw/arm/meson.build index 1ae5e17eeb..8480b7f37d 100644 --- a/hw/arm/meson.build +++ b/hw/arm/meson.build @@ -1,5 +1,5 @@ arm_ss =3D ss.source_set() -arm_ss.add(files('boot.c')) +arm_ss.add(files('boot.c'), fdt) arm_ss.add(when: 'CONFIG_PLATFORM_BUS', if_true: files('sysbus-fdt.c')) arm_ss.add(when: 'CONFIG_ARM_VIRT', if_true: files('virt.c')) arm_ss.add(when: 'CONFIG_ACPI', if_true: files('virt-acpi-build.c')) diff --git a/hw/riscv/meson.build b/hw/riscv/meson.build index 25af9db75e..fe2ea75f65 100644 --- a/hw/riscv/meson.build +++ b/hw/riscv/meson.build @@ -1,5 +1,5 @@ riscv_ss =3D ss.source_set() -riscv_ss.add(files('boot.c')) +riscv_ss.add(files('boot.c'), fdt) riscv_ss.add(files('numa.c')) riscv_ss.add(when: 'CONFIG_HART', if_true: files('riscv_hart.c')) riscv_ss.add(when: 'CONFIG_OPENTITAN', if_true: files('opentitan.c')) diff --git a/monitor/meson.build b/monitor/meson.build index 0484a64341..eb2a534fdc 100644 --- a/monitor/meson.build +++ b/monitor/meson.build @@ -6,4 +6,4 @@ softmmu_ss.add(files( 'qmp-cmds.c', )) =20 -specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files('misc.c')) +specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files('misc.c'), spice]) --=20 2.26.2