Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp902442ybe; Fri, 13 Sep 2019 08:05:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlcP0mXuIXkNQMQnWuWk6tb4rb1eqvZrdnIqIXP6nyScYfZdmGut5B7qx0SfkPsK9RxgLc X-Received: by 2002:a17:906:583:: with SMTP id 3mr38757039ejn.74.1568387129054; Fri, 13 Sep 2019 08:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568387129; cv=none; d=google.com; s=arc-20160816; b=OkbAYiLDoCCmAZwDVEjSU0SzWIRFQ61Bgj9jTW9AFEi31oW1QpvtCyG4fXCU49BLyp IGsQZCI2iFI0/Qjijef7uGON1SPAAyW++lrR6L+2nXQoYPZDfqe4f/Pfh8ouvOL4y9v4 /07lKjrGE0uQCDK/ro4lSO7GUbP1jJiouS5hL8AEoOAKlEl4BapYiha8REBc4jp0gen1 d8w5pe+xXL1lvoqaKXM8p8V3OP1j2ucU3Z2Mybc8ViZppg54xW+ItVbg674aj6AUpjmP ufv5m0kfPwevHDwJO3IEjvMuB0HYY3M7WyqQbyfWKy/hGu49M7Iu3L6SGOf2v8k+dT4r ZgUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=N7jTCxx4qZ2ECbeGJ1fPMhxzc/oTR/27bl7NC5TGHAM=; b=PGe8MqN7nm41odZphwAluYKRAD++D4CBno35VSRrfMuYRcdv8idzPs/THM60qeZ8uu 69DDlVVtehcou5WGYjkJzwukXeznHZD418/DMXxJ6bHMY9DMtMR9WYE+LVIa/I5DYOiV Lei21/GgykBmFHlOwGJvem9lRg5/OY9l/UADEaNbxtWBvCR8aA5P2a+E5s6yIiMWvuYd Q7j2cmxvQeqBWbx/qqquXvyD/lU6IcZhULL8KsNGqhSocLtFfpAE2zGjKNbto+ML3hY4 a4aBShxPDIlvZUIX9rKvBn+1z9sULjDh5giDFxKkySqKRBLWEH1FyBEKDFQEhk2pRuGr evLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p13si13971728edx.162.2019.09.13.08.05.04; Fri, 13 Sep 2019 08:05:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391157AbfIMNY0 (ORCPT + 99 others); Fri, 13 Sep 2019 09:24:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50942 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391144AbfIMNYX (ORCPT ); Fri, 13 Sep 2019 09:24:23 -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 mx1.redhat.com (Postfix) with ESMTPS id BB2473061424; Fri, 13 Sep 2019 13:24:23 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1156F5C1D4; Fri, 13 Sep 2019 13:24:20 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: [PATCH 09/73] libperf: Link libapi.a in libperf.so Date: Fri, 13 Sep 2019 15:22:51 +0200 Message-Id: <20190913132355.21634-10-jolsa@kernel.org> In-Reply-To: <20190913132355.21634-1-jolsa@kernel.org> References: <20190913132355.21634-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 13 Sep 2019 13:24:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linking libapi.a in libperf.so, because we are about to use some of the api functions in it. Link: http://lkml.kernel.org/n/tip-a31mqxtuket2y8sdn7un7dka@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/lib/Makefile | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/tools/perf/lib/Makefile b/tools/perf/lib/Makefile index e325c0503dc6..54466cc84544 100644 --- a/tools/perf/lib/Makefile +++ b/tools/perf/lib/Makefile @@ -59,7 +59,13 @@ else CFLAGS := -g -Wall endif -INCLUDES = -I$(srctree)/tools/perf/lib/include -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/ -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi +INCLUDES = \ +-I$(srctree)/tools/perf/lib/include \ +-I$(srctree)/tools/lib/ \ +-I$(srctree)/tools/include \ +-I$(srctree)/tools/arch/$(SRCARCH)/include/ \ +-I$(srctree)/tools/arch/$(SRCARCH)/include/uapi \ +-I$(srctree)/tools/include/uapi # Append required CFLAGS override CFLAGS += $(EXTRA_WARNINGS) @@ -88,13 +94,34 @@ LIBPERF_PC := $(OUTPUT)libperf.pc LIBPERF_ALL := $(LIBPERF_A) $(OUTPUT)libperf.so* +LIB_DIR := $(srctree)/tools/lib/api/ + +ifneq ($(OUTPUT),) +ifneq ($(subdir),) + API_PATH=$(OUTPUT)/../lib/api/ +else + API_PATH=$(OUTPUT) +endif +else + API_PATH=$(LIB_DIR) +endif + +LIBAPI = $(API_PATH)libapi.a + +$(LIBAPI): FORCE + $(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) $(OUTPUT)libapi.a + +$(LIBAPI)-clean: + $(call QUIET_CLEAN, libapi) + $(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null + $(LIBPERF_IN): FORCE $(Q)$(MAKE) $(build)=libperf $(LIBPERF_A): $(LIBPERF_IN) $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) -$(LIBPERF_SO): $(LIBPERF_IN) +$(LIBPERF_SO): $(LIBPERF_IN) $(LIBAPI) $(QUIET_LINK)$(CC) --shared -Wl,-soname,libperf.so \ -Wl,--version-script=$(VERSION_SCRIPT) $^ -o $@ @ln -sf $(@F) $(OUTPUT)libperf.so @@ -106,7 +133,7 @@ libs: $(LIBPERF_A) $(LIBPERF_SO) $(LIBPERF_PC) all: fixdep $(Q)$(MAKE) libs -clean: +clean: $(LIBAPI)-clean $(call QUIET_CLEAN, libperf) $(RM) $(LIBPERF_A) \ *.o *~ *.a *.so *.so.$(VERSION) *.so.$(LIBPERF_VERSION) .*.d .*.cmd LIBPERF-CFLAGS $(LIBPERF_PC) $(Q)$(MAKE) -C tests clean -- 2.21.0