From patchwork Sat Jul 20 03:03:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick McLean X-Patchwork-Id: 11050755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C8BB813A4 for ; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B60C2289B4 for ; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A24FA289BF; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46604289BF for ; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390435AbfGTDD5 (ORCPT ); Fri, 19 Jul 2019 23:03:57 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:39662 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390431AbfGTDD4 (ORCPT ); Fri, 19 Jul 2019 23:03:56 -0400 Received: from chiana.gaikai.org (unknown [100.42.98.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: chutzpah) by smtp.gentoo.org (Postfix) with ESMTPSA id 57A79348129 for ; Sat, 20 Jul 2019 03:03:56 +0000 (UTC) From: Patrick McLean To: linux-trace-devel@vger.kernel.org Subject: [PATCH 2/4] trace-cmd: No automagic dependency on udis86 Date: Fri, 19 Jul 2019 20:03:42 -0700 Message-Id: <20190720030344.1991393-3-chutzpah@gentoo.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190720030344.1991393-1-chutzpah@gentoo.org> References: <20190720030344.1991393-1-chutzpah@gentoo.org> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Patrick McLean Currently if udis86 is detected on the system, trace-cmd automatically uses it. This is generally a problem for packagers since if the build machine happens to have udis86, now there is a dependency on it that may or may not be tracked. This adds a NO_UDIS86 variable that can be set by the packager to disable using udis86 completely. Signed-off-by: Patrick McLean Signed-off-by: Patrick McLean --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3579f27..6b85e21 100644 --- a/Makefile +++ b/Makefile @@ -136,8 +136,13 @@ export NO_PYTHON test-build = $(if $(shell sh -c 'echo "$(1)" | \ $(CC) -o /dev/null -c -x c - > /dev/null 2>&1 && echo y'), $2) +ifndef NO_UDIS86 # have udis86 disassembler library? -udis86-flags := $(call test-build,\#include ,-DHAVE_UDIS86 -ludis86) +udis86-flags := -DHAVE_UDIS86 +udis86-ldflags := -ludis86 +else +udis86-flags := -UHAVE_UDIS86 +endif # NO_UDIS86 define BLK_TC_FLUSH_SOURCE #include @@ -237,6 +242,7 @@ endif # Append required CFLAGS override CFLAGS += $(INCLUDES) $(PLUGIN_DIR_SQ) $(VAR_DIR) override CFLAGS += $(udis86-flags) $(blk-flags) +override LDFLAGS += $(udis86-ldflags) CMD_TARGETS = trace-cmd $(BUILD_PYTHON)