From patchwork Tue Sep 26 20:14:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 114292 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4242408qgf; Tue, 26 Sep 2017 13:21:18 -0700 (PDT) X-Received: by 10.200.17.20 with SMTP id c20mr17942996qtj.321.1506457277986; Tue, 26 Sep 2017 13:21:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506457277; cv=none; d=google.com; s=arc-20160816; b=dTTJRD7nxiu9ZyPAPrQOQCmnfwAygI6QGr5qB7dkzIexvEaVjsdypYZQ7NPtERayDn ysIBBr6OMFXaev3Kyv3/dnTARqDyaQqM/E0pZm5YRA+wkELys0bpHwUcYb7zVFJx9FCC hNtrQNPoGy3Mi+BQDXrxzIhv2pjxuuQagecgbkbZC+ftojB0gx5doQxLnKdafbDpzmTk V8tj2UKjHjBuWqafqX9ExN4IKT7RPFp8dg80HyJhEM3FMUSlksYqnAS/mi+eT3Ax/nsG JaA8mcljpKX5V1sHlEnWbt+WlxiMSUW6ix4PjBKqIgA/2KpB+ZizhJ0K7KbgqSRnsedX Q3Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=hZDT8cNI/9rhnMMwQw4AhrvAIrHkiQH4MRh280ZdV2M=; b=iYGOebl+CDxHS4v9orGTTI7Zsv8CrxLlOEX9uOgMWxSuBxOfL9ov/OlPK5T4XHZ5fQ sqqnmDC5rOFuHF/nvHQ+LDg735pEzKQGSCk8I4ZXAfUTLUtfqvc9gRFTkHg4sTWVNGGh ICnJ8sxZesp7TPcVDoxSLYxaiCmuUOD3Ru9P+E7MYyKkQ/u4LiZ4MMFnARXWskM0+sHE ZCxTgTZ4FaJmsfKM363d0FXe6NBMEZ4lv7p9pd5xNBnqvdkh/UWpb3jfs2s//E3ouMoQ FxS54J1Zx1Ex0xCQVgH0NOGofkIoGzVD70cQJQvurOptamG9YoYzXMcpd2ka6otbWR5C uX4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Pu2g9p0b; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id y8si7207259qty.19.2017.09.26.13.21.17 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 26 Sep 2017 13:21:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Pu2g9p0b; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51013 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwwLz-0008Of-Rr for patch@linaro.org; Tue, 26 Sep 2017 16:21:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwwFi-000315-6s for qemu-devel@nongnu.org; Tue, 26 Sep 2017 16:14:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwwFh-0003Hy-3r for qemu-devel@nongnu.org; Tue, 26 Sep 2017 16:14:46 -0400 Received: from mail-pg0-x22f.google.com ([2607:f8b0:400e:c05::22f]:57028) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dwwFg-0003HW-VY for qemu-devel@nongnu.org; Tue, 26 Sep 2017 16:14:45 -0400 Received: by mail-pg0-x22f.google.com with SMTP id 7so6503514pgd.13 for ; Tue, 26 Sep 2017 13:14:44 -0700 (PDT) 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; bh=hZDT8cNI/9rhnMMwQw4AhrvAIrHkiQH4MRh280ZdV2M=; b=Pu2g9p0bK1/u++slvUhBPxZU9XF6joQc5nMHbrDwVv4NuQZWx7udIrQPhc8lJWexXC WckqFKsaFPVPqLxfOK2PFtXqyJWWOlag2YIVMDLUFWUtpPBQZU6Xo/HSbvuetO0ZXRnA +AQmXOutRl8XQecKa56zjjKnZC7pY5EEecBhA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hZDT8cNI/9rhnMMwQw4AhrvAIrHkiQH4MRh280ZdV2M=; b=HkOIPhRAhq7OX/8DmFnuBAmTPf+aHjeGTSe2IYxGBrG7tx3q8GXYLOAV/xGKovCaJd nll30+jCWR/a4Z1HWDnLFL/ZO9/fcscEeUTi/82pxGmhfm5AFIcvAFF6qQEmFoPEK9/x hAXkGjlBwZmPSRoSjsbtdmn4/2mnppmW2rZz0LikNyLMk+/A5eCB63YcZ8Mz+KSBc65C f4fZvR/WvfdyPXE3O7zGS6+1ICzFpgWvFyHUYA+qmMYX+Ho23DCB9Cv5p9EnfBaFPUpw 697QXPs+kpGHZ1sj+yISEsG18ssPdC42E5c2Lbd6AIz9gwL76BVlQxDHUqzkB4nOJJDM rzKg== X-Gm-Message-State: AHPjjUgDbmBFWZolEB2QI1nVURjgnPC4uUpSQESAHNB3pQys0jafecEu Pn2paXVNi/ro5cAAP8eyg+E5Hmt6HVo= X-Google-Smtp-Source: AOwi7QAFb9qltYmvIRokcGdT8iR6AYYdm+RN8YKybatACZMnTiCpc4/HwwaNBNZuePywAW1ZBz+5mg== X-Received: by 10.99.113.94 with SMTP id b30mr12036012pgn.312.1506456883824; Tue, 26 Sep 2017 13:14:43 -0700 (PDT) Received: from bigtime.twiddle.net ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id r138sm15582470pgr.12.2017.09.26.13.14.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Sep 2017 13:14:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 26 Sep 2017 13:14:27 -0700 Message-Id: <20170926201427.2833-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170926201427.2833-1-richard.henderson@linaro.org> References: <20170926201427.2833-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::22f Subject: [Qemu-devel] [PATCH v3 9/9] disas: Add capstone as submodule X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-ppc@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Do not require the submodule, but use it if present (in preference even to a system copy). This will allow us to easily use capstone in older systems for which a package is not available, and also easily track bug fixes from upstream. Signed-off-by: Richard Henderson --- Makefile | 4 ++++ .gitmodules | 3 +++ capstone | 1 + configure | 12 +++++++++++- 4 files changed, 19 insertions(+), 1 deletion(-) create mode 160000 capstone -- 2.13.5 diff --git a/Makefile b/Makefile index 2be61fcf1c..4723a65e9c 100644 --- a/Makefile +++ b/Makefile @@ -335,6 +335,10 @@ subdir-dtc:dtc/libfdt dtc/tests dtc/%: mkdir -p $@ +# ??? Overriding CFLAGS causes us to lose defines added in the sub-makefile. +subdir-capstone: + $(call quiet-command,$(MAKE) -C $(SRC_PATH)/capstone CAPSTONE_SHARED=no BUILDDIR="$(BUILD_DIR)/capstone" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) $(BUILD_DIR)/capstone/libcapstone.a) + $(SUBDIR_RULES): libqemuutil.a $(common-obj-y) $(chardev-obj-y) \ $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY)) diff --git a/.gitmodules b/.gitmodules index 84c54cdc49..bcb80d701a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,3 +34,6 @@ [submodule "roms/QemuMacDrivers"] path = roms/QemuMacDrivers url = git://git.qemu.org/QemuMacDrivers.git +[submodule "capstone"] + path = capstone + url = https://github.com/aquynh/capstone.git diff --git a/capstone b/capstone new file mode 160000 index 0000000000..a279481dbf --- /dev/null +++ b/capstone @@ -0,0 +1 @@ +Subproject commit a279481dbfd54bb1e2336d771e89978cc6d43176 diff --git a/configure b/configure index 62d172d88a..b0c30992ff 100755 --- a/configure +++ b/configure @@ -4378,7 +4378,14 @@ fi # capstone if test "$capstone" != no; then - if $pkg_config capstone; then + if test -d ${source_path}/capstone ; then + # have submodule capstone - use it + capstone=yes + capstone_internal=yes + mkdir -p capstone + QEMU_CFLAGS="$QEMU_CFLAGS -I\$(SRC_PATH)/capstone/include" + LIBS="\$(BUILD_DIR)/capstone/libcapstone.a $LIBS" + elif $pkg_config capstone; then capstone=yes QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags capstone)" LIBS="$($pkg_config --libs capstone) $LIBS" @@ -6577,6 +6584,9 @@ done # for target in $targets if [ "$dtc_internal" = "yes" ]; then echo "config-host.h: subdir-dtc" >> $config_host_mak fi +if [ "$capstone_internal" = "yes" ]; then + echo "config-host.h: subdir-capstone" >> $config_host_mak +fi if test "$numa" = "yes"; then echo "CONFIG_NUMA=y" >> $config_host_mak