From nobody Mon Feb 9 04:46:15 2026 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=1596744789; cv=none; d=zohomail.com; s=zohoarc; b=VUdx5XixI6Qb20spSaKl+Hnv+7O8T89M4WvdYGIZVhDZmv15Wesc0a1OB62V8drJlL9YGPZMDExiabHycEQ8hliPDpgBjqc4QlD3NQE+5XodwgZNXvQzY1F1npq5lP8UrJqJ+ggqPSM/LExcUD2K74/ih2gLG4giZi1lE1KGxJo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596744789; h=Content-Type:Content-Transfer-Encoding:Cc: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=ihCti3XLbliKzKVveic1hC5S/JNzHZAojXsiG6HCWdk=; b=jQQxLvgqxOG0xbeQ7dZJwdYDpO+f/NYqBsFomyRGmui2OKCJ7EdA50S7jUq+jD8tv9yCuqMUr+GL/Wm0H6appTLDG49NdWLdIHEnhKb6IRc+NFbMhc7/m6qXngyBGaDyQ3zU9uSCCscbNM1zl/Pew0tkhIw8RweWoCed3JbyA6k= 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 1596744789039840.0672177979117; Thu, 6 Aug 2020 13:13:09 -0700 (PDT) Received: from localhost ([::1]:50130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3mGB-00087G-JC for importer@patchew.org; Thu, 06 Aug 2020 16:13:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3lRC-0002wa-4o for qemu-devel@nongnu.org; Thu, 06 Aug 2020 15:20:26 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:27606 helo=us-smtp-delivery-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 1k3lR9-0006tk-JF for qemu-devel@nongnu.org; Thu, 06 Aug 2020 15:20:25 -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-263-UNpWBrCPOZi9P3-N3Pn7cg-1; Thu, 06 Aug 2020 15:20:19 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9DA88800468 for ; Thu, 6 Aug 2020 19:20:18 +0000 (UTC) Received: from 640k.localdomain.com (unknown [10.36.110.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF3A35F9DC; Thu, 6 Aug 2020 19:20:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596741622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ihCti3XLbliKzKVveic1hC5S/JNzHZAojXsiG6HCWdk=; b=dZEP8b9J8IhpcIMVA1vLA3M+7/XztO5NnGkGWTO1h940jIp3uMRyDlX91BwFSeyZojH/eI 6Kd/KBCU8OQmkqKBr8Tki3MjJj3Vr2xX8oV/VNh/o2nJyRJPg4qA/JEiwDZqORaiHgRdhA urS5S1UGtzBhwBabXsUqg6Zln61iuMk= X-MC-Unique: UNpWBrCPOZi9P3-N3Pn7cg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 128/143] meson: cpu-emu Date: Thu, 6 Aug 2020 21:16:04 +0200 Message-Id: <1596741379-12902-129-git-send-email-pbonzini@redhat.com> In-Reply-To: <1596741379-12902-1-git-send-email-pbonzini@redhat.com> References: <1596741379-12902-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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.81; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/06 05:03:13 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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: , 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: pass (identity @redhat.com) From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- Makefile.target | 12 ------------ configure | 8 ++++++++ meson.build | 37 +++++++++++++++++++++++++++++++++++++ scripts/feature_to_c.sh | 24 ++++++++---------------- 4 files changed, 53 insertions(+), 28 deletions(-) diff --git a/Makefile.target b/Makefile.target index 5c099fa..c180b4c 100644 --- a/Makefile.target +++ b/Makefile.target @@ -108,15 +108,6 @@ obj-y +=3D $(LIBQEMU) obj-y +=3D trace/ =20 ######################################################### -# cpu emulator library -obj-y +=3D exec.o exec-vary.o -obj-$(CONFIG_TCG) +=3D tcg/tcg.o tcg/tcg-op.o tcg/tcg-op-vec.o tcg/tcg-op-= gvec.o -obj-$(CONFIG_TCG) +=3D tcg/tcg-common.o tcg/optimize.o -obj-$(CONFIG_TCG_INTERPRETER) +=3D tcg/tci.o -obj-$(CONFIG_TCG_INTERPRETER) +=3D disas/tci.o -obj-$(CONFIG_TCG) +=3D fpu/softfloat.o -obj-y +=3D disas.o -obj-$(call notempty,$(TARGET_XML_FILES)) +=3D gdbstub-xml.o LIBS :=3D $(libs_cpu) $(LIBS) =20 obj-$(CONFIG_PLUGIN) +=3D plugins/ @@ -200,9 +191,6 @@ ifdef CONFIG_DARWIN $(call quiet-command,SetFile -a C $@,"SETFILE","$(TARGET_DIR)$@") endif =20 -gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh - $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_= c.sh $@ $(TARGET_XML_FILES),"GEN","$(TARGET_DIR)$@") - clean: clean-target rm -f *.a *~ $(PROGS) rm -f $(shell find . -name '*.[od]') diff --git a/configure b/configure index 525f415..a7a4538 100755 --- a/configure +++ b/configure @@ -5416,9 +5416,13 @@ case "$capstone" in LIBCAPSTONE=3Dlibcapstone.a fi libs_cpu=3D"-L$PWD/capstone -lcapstone $libs_cpu" + capstone_libs=3D"-L$PWD/capstone -lcapstone" + capstone_cflags=3D"-I${source_path}/capstone/include" ;; =20 system) + capstone_libs=3D"$($pkg_config --libs capstone)" + capstone_cflags=3D"$($pkg_config --cflags capstone)" QEMU_CFLAGS=3D"$QEMU_CFLAGS $($pkg_config --cflags capstone)" libs_cpu=3D"$($pkg_config --libs capstone) $libs_cpu" ;; @@ -7637,6 +7641,8 @@ if test "$ivshmem" =3D "yes" ; then fi if test "$capstone" !=3D "no" ; then echo "CONFIG_CAPSTONE=3Dy" >> $config_host_mak + echo "CAPSTONE_CFLAGS=3D$capstone_cflags" >> $config_host_mak + echo "CAPSTONE_LIBS=3D$capstone_libs" >> $config_host_mak fi if test "$debug_mutex" =3D "yes" ; then echo "CONFIG_DEBUG_MUTEX=3Dy" >> $config_host_mak @@ -7657,6 +7663,8 @@ fi =20 if test "$libpmem" =3D "yes" ; then echo "CONFIG_LIBPMEM=3Dy" >> $config_host_mak + echo "LIBPMEM_LIBS=3D$libpmem_libs" >> $config_host_mak + echo "LIBPMEM_CFLAGS=3D$libpmem_cflags" >> $config_host_mak fi =20 if test "$libdaxctl" =3D "yes" ; then diff --git a/meson.build b/meson.build index e1d7672..7ed8276 100644 --- a/meson.build +++ b/meson.build @@ -328,6 +328,16 @@ if 'CONFIG_USB_LIBUSB' in config_host libusb =3D declare_dependency(compile_args: config_host['LIBUSB_CFLAGS']= .split(), link_args: config_host['LIBUSB_LIBS'].split(= )) endif +capstone =3D not_found +if 'CONFIG_CAPSTONE' in config_host + capstone =3D declare_dependency(compile_args: config_host['CAPSTONE_CFLA= GS'].split(), + link_args: config_host['CAPSTONE_LIBS'].sp= lit()) +endif +libpmem =3D not_found +if 'CONFIG_LIBPMEM' in config_host + libpmem =3D declare_dependency(compile_args: config_host['LIBPMEM_CFLAGS= '].split(), + link_args: config_host['LIBPMEM_LIBS'].spli= t()) +endif =20 create_config =3D find_program('scripts/create_config') minikconf =3D find_program('scripts/minikconf.py') @@ -505,6 +515,8 @@ target_softmmu_arch =3D {} # Trace files # ############### =20 +# TODO: add each directory to the subdirs from its own meson.build, once +# we have those trace_events_subdirs =3D [ 'accel/kvm', 'accel/tcg', @@ -670,6 +682,20 @@ softmmu_ss.add(when: ['CONFIG_FDT', fdt], if_true: [f= iles('device_tree.c')]) common_ss.add(files('cpus-common.c')) =20 subdir('softmmu') + +specific_ss.add(files('disas.c', 'exec.c', 'gdbstub.c'), capstone, libpmem) +specific_ss.add(files('exec-vary.c')) +specific_ss.add(when: 'CONFIG_TCG', if_true: files( + 'fpu/softfloat.c', + 'tcg/optimize.c', + 'tcg/tcg-common.c', + 'tcg/tcg-op-gvec.c', + 'tcg/tcg-op-vec.c', + 'tcg/tcg-op.c', + 'tcg/tcg.c', +)) +specific_ss.add(when: 'CONFIG_TCG_INTERPRETER', if_true: files('disas/tci.= c', 'tcg/tci.c')) + subdir('backends') subdir('disas') subdir('migration') @@ -761,6 +787,8 @@ common_all =3D static_library('common', dependencies: common_all.dependencies(), name_suffix: 'fa') =20 +feature_to_c =3D find_program('scripts/feature_to_c.sh') + foreach target : target_dirs config_target =3D config_target_mak[target] target_name =3D config_target['TARGET_NAME'] @@ -807,6 +835,15 @@ foreach target : target_dirs endif endif =20 + if 'TARGET_XML_FILES' in config_target + gdbstub_xml =3D custom_target(target + '-gdbstub-xml.c', + output: target + '-gdbstub-xml.c', + input: files(config_target['TARGET_XML_FIL= ES'].split()), + command: [feature_to_c, '@INPUT@'], + capture: true) + arch_srcs +=3D gdbstub_xml + endif + t =3D target_arch[arch].apply(config_target, strict: false) arch_srcs +=3D t.sources() =20 diff --git a/scripts/feature_to_c.sh b/scripts/feature_to_c.sh index c8ce9b8..b116989 100644 --- a/scripts/feature_to_c.sh +++ b/scripts/feature_to_c.sh @@ -19,16 +19,8 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, see . =20 -output=3D$1 -shift - -if test -z "$output" || test -z "$1"; then - echo "Usage: $0 OUTPUTFILE INPUTFILE..." - exit 1 -fi - -if test -e "$output"; then - echo "Output file \"$output\" already exists; refusing to overwrite." +if test -z "$1"; then + echo "Usage: $0 INPUTFILE..." exit 1 fi =20 @@ -60,17 +52,17 @@ for input; do printf "'\''\\n'\'', \n" } END { print " 0 };" - }' < $input >> $output + }' < $input done =20 -echo >> $output -echo "const char *const xml_builtin[][2] =3D {" >> $output +echo +echo "const char *const xml_builtin[][2] =3D {" =20 for input; do basename=3D$(echo $input | sed 's,.*/,,') arrayname=3Dxml_feature_$(echo $input | sed 's,.*/,,; s/[-.]/_/g') - echo " { \"$basename\", $arrayname }," >> $output + echo " { \"$basename\", $arrayname }," done =20 -echo " { (char *)0, (char *)0 }" >> $output -echo "};" >> $output +echo " { (char *)0, (char *)0 }" +echo "};" --=20 1.8.3.1