Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5876481ybi; Sun, 21 Jul 2019 04:29:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMla2TYyCYKfjOOtgETDnExBtkoBv8s+MGDc4pqUYMn8MUmJNvoMKV1cGxQg+iUD8K3zPQ X-Received: by 2002:a63:69c1:: with SMTP id e184mr63925082pgc.198.1563708576802; Sun, 21 Jul 2019 04:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563708576; cv=none; d=google.com; s=arc-20160816; b=MhcOJ+c3tCXGtFfc5rHqmIW2Lyvzmdy2aG/qGe/L9CErTLWv75H+pyEzc/o7M8/7V9 h+0YwpqOZ4DLQjiEeODzsRwSM2QUlhomdAeBPBzekbKhH6FqVNc5NxIYPZ4f3DMkcjnA jVqrJJbccOAwjCYZRsIZWRsrzniS7Utl81VZiFTepiZqyCauAW9fi25e0oTOR0ehxIMt QLYL7xlqQJDFXTYj/plEy7gc2Bz5S1yL2v5iDu2ejdUrZJyiQIRARq4WYADPqnrsOzzp 4ZslBwaxL5qvLJy6d/3jtkMZK3Ithlx0m6EX3X0njPv0Y4OQsiNZ89AR1z39LQChy+p6 hZtQ== 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=Nqhat1gn7YbJCP0Kn6y49WQg7BuTKhxUKdn+LK7uhfU=; b=mDhUN+hnz36iLJEnFTdjLMKU/MjPwndl75KjifrRi2tplf8N8ta+B3JuPcbqOfr//P TQPimDxhpl5kXAqJe6+s3Y75hN5bQbtI8t53AMtzx1aqJcxDI7iFdWHk5CEX9WV6JeDn Yi4c0K24yspXjA9CncYusuU3z4Kv69FfaM8laz7IErlcVZdz1rC1roE8MKW0YNPhWjIm O2Ir2H2hlWHpKXGKecCsM65/Zfbc4x1b8oAyf11zl1etUmRUae78GOZ9pV7AT62/krG3 aqM9u5muUgUl8h6xTnsFsZN5hgy5ZB4tMRz3NWzylENn0pXrGpvbaTa4lTJYsYdlzCJS M6Pw== 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 z13si7314837pfr.86.2019.07.21.04.29.21; Sun, 21 Jul 2019 04:29:36 -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 S1726947AbfGUL2P (ORCPT + 99 others); Sun, 21 Jul 2019 07:28:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47028 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726275AbfGUL2O (ORCPT ); Sun, 21 Jul 2019 07:28:14 -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 mx1.redhat.com (Postfix) with ESMTPS id 996143082A98; Sun, 21 Jul 2019 11:28:14 +0000 (UTC) Received: from krava.redhat.com (ovpn-204-23.brq.redhat.com [10.40.204.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7BB995D9D3; Sun, 21 Jul 2019 11:28:10 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Andi Kleen , Alexey Budankov , Michael Petlan Subject: [PATCH 24/79] libperf: Add build version support Date: Sun, 21 Jul 2019 13:24:11 +0200 Message-Id: <20190721112506.12306-25-jolsa@kernel.org> In-Reply-To: <20190721112506.12306-1-jolsa@kernel.org> References: <20190721112506.12306-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Sun, 21 Jul 2019 11:28:14 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding shared library version, generating following files: $ ll toos/perf/lib/libperf.so* libperf.so -> libperf.so.0.0.1 libperf.so.0 -> libperf.so.0.0.1 libperf.so.0.0.1 Link: http://lkml.kernel.org/n/tip-d2cnt8qoqc5nxiibvzvuw6ir@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/lib/Makefile | 20 +++++++++++++++++--- tools/perf/lib/libperf.map | 4 ++++ 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 tools/perf/lib/libperf.map diff --git a/tools/perf/lib/Makefile b/tools/perf/lib/Makefile index e6f2eb702aaa..25a6476f8b12 100644 --- a/tools/perf/lib/Makefile +++ b/tools/perf/lib/Makefile @@ -1,6 +1,10 @@ # SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) # Most of this file is copied from tools/lib/bpf/Makefile +LIBPERF_VERSION = 0 +LIBPERF_PATCHLEVEL = 0 +LIBPERF_EXTRAVERSION = 1 + MAKEFLAGS += --no-print-directory ifeq ($(srctree),) @@ -47,7 +51,13 @@ all: export srctree OUTPUT CC LD CFLAGS V include $(srctree)/tools/build/Makefile.include -LIBPERF_SO := $(OUTPUT)libperf.so +VERSION_SCRIPT := libperf.map + +PATCHLEVEL = $(LIBPERF_PATCHLEVEL) +EXTRAVERSION = $(LIBPERF_EXTRAVERSION) +VERSION = $(LIBPERF_VERSION).$(LIBPERF_PATCHLEVEL).$(LIBPERF_EXTRAVERSION) + +LIBPERF_SO := $(OUTPUT)libperf.so.$(VERSION) LIBPERF_A := $(OUTPUT)libperf.a LIBPERF_IN := $(OUTPUT)libperf-in.o @@ -58,7 +68,11 @@ $(LIBPERF_A): $(LIBPERF_IN) $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIBPERF_SO): $(LIBPERF_IN) - $(QUIET_LINK)$(CC) --shared -Wl,-soname,libperf.so $^ -o $@ + $(QUIET_LINK)$(CC) --shared -Wl,-soname,libperf.so \ + -Wl,--version-script=$(VERSION_SCRIPT) $^ -o $@ + @ln -sf $(@F) $(OUTPUT)libperf.so + @ln -sf $(@F) $(OUTPUT)libperf.so.$(LIBPERF_VERSION) + libs: $(LIBPERF_A) $(LIBPERF_SO) @@ -67,7 +81,7 @@ all: fixdep clean: $(call QUIET_CLEAN, libperf) $(RM) $(LIBPERF_A) \ - *.o *~ *.a *.so .*.d .*.cmd LIBPERF-CFLAGS + *.o *~ *.a *.so *.so.$(VERSION) *.so.$(LIBPERF_VERSION) .*.d .*.cmd LIBPERF-CFLAGS FORCE: diff --git a/tools/perf/lib/libperf.map b/tools/perf/lib/libperf.map new file mode 100644 index 000000000000..a8e913988edf --- /dev/null +++ b/tools/perf/lib/libperf.map @@ -0,0 +1,4 @@ +LIBPERF_0.0.1 { + local: + *; +}; -- 2.21.0