Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4361498pxb; Mon, 27 Sep 2021 15:32:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxBFiLThrMOjXwbOyLn+6SR7wx02h7kKYzgKHguzCQY5iq04YCoNDDVs94kRZWGA+RracV X-Received: by 2002:a17:903:2308:b0:13d:ec2a:2e07 with SMTP id d8-20020a170903230800b0013dec2a2e07mr2131350plh.3.1632781944511; Mon, 27 Sep 2021 15:32:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632781944; cv=none; d=google.com; s=arc-20160816; b=AKvZbjCgHclemahBl+0WMssmL3WgZ9jeRhA1ZtTMcO5YbmWafEGmmD4CM2oaCduqFi g69Ss72B+bo82Z/iUmbX4AM9VThZ3X1g3xPDt0vx/XOQpIWxWd/X6kYHv+9uuI0slail U60ega0A2rgcey/lnZGRBc8D1p5RMiXcaUm/gdNOg2bI7DHw1+fspuTEgkGEO7WgvKZR gsbbIxSmPatWWeaJ26RlZyUd+cVR1glmJ1qHW267qurz/NYKObw0YLY9jPa9WlMviV3y 9L7ageliDJKfcJmWJ05DQNKKkeImqV5jjglyrqAgyMX83VX7YqCSJLXttc2GDnaAwwye QYfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jtohzWpaqkO4tU2pAeEn9Z5yAnnkQyBYiaAEVGUJmac=; b=mcpwZqUnOzx8cnTaxPq3BaSNEIuRgz/kt7rzNKT5zSEb6eJSGX3XljPw1qur63+Iho dXZNGzRV0bzfuBwTMYwBG2f3EJ5yrTxB34mQ/xVGg3O8Cz7pr2sx4h8JaEozRS0kFk+z mdBXPGFbZVHbVjH5o7EKwzHfJh/PL18Evr2quFhNK6rE6KXwAOaIoonDyxebuhydJEoH wNaobgv464eYkZ0idFNiZ669CezJOidj2Z/iT8MlMZmndLLyD0hbOJ8F0r6HG9C965eJ OdmoXr5nsC3n4rOpkSjeH+BG2OuDM8ZbgJmM8OnROoQsd2+S539ScK2LkAyUY5cwlBv3 fBRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YQicmZtm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u72si23206301pfc.10.2021.09.27.15.32.11; Mon, 27 Sep 2021 15:32:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YQicmZtm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237687AbhI0WdB (ORCPT + 99 others); Mon, 27 Sep 2021 18:33:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237545AbhI0WdA (ORCPT ); Mon, 27 Sep 2021 18:33:00 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D550C061575; Mon, 27 Sep 2021 15:31:20 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id n2so12760027plk.12; Mon, 27 Sep 2021 15:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jtohzWpaqkO4tU2pAeEn9Z5yAnnkQyBYiaAEVGUJmac=; b=YQicmZtm0w6K2IXXhrqHlHrViMkMyd07v8gqlk365KYOU0spBQS4exom6/om/3WcjL c3rp8Lplq7zhtrl0s4verCbiToNLsHwf2N1a46iD1NshaU75szMCfvC2Ve6SDwsAmile +5u4+X0gQRA5RO5oMgX4tcmHvGyh2HcFIIut1U5CEBUx0Le4uJJEed+nonnGQWtgP37L T+SeFD5Kts1c+1cN0APv5MkHqQ3lTOrH/coOC+73A3h1cEgyRe5Ve4op5yU76WK3rsQ2 eOLmTij9la89JEoFqJ5mXJhfJVs2vTIfklEBfqmXx/2Be5JjX310tX2FxMta7hW6TxqI dpfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jtohzWpaqkO4tU2pAeEn9Z5yAnnkQyBYiaAEVGUJmac=; b=Scs/Mr+6s3CFUnbAB4jjfodQYj8nLoQxP+XWvsBgJh286eBOva5G+IvpFg1H33kwhM r7zX1nUpnDNajEvrBOkG1wBlxAV+CRgKFLA5wONjnD0O/pwsgiiK0rwfu02eK+2+Wu5p jz4IulfmLHNpM1hhMpSfi+hNUYY19lYdhNrSt8GlHOOccyctL1l59rbxsVsfRtosd7Wm rPxrs57EiPG4Rn58ZzrStAwz/mKdgYoBTPaeYEaDthm0xwBmP4hV0SrkcshOkrwgaY0p MKX55PDKi0ayIKWIPQnElIp8W9DJTU+JVtTsBF/pBRgJxFmhZusV1DioDGNdodVg22OS mINw== X-Gm-Message-State: AOAM532zb9V5lK6et2bO4On04biG7lZRJJQbJoBXQNC4yNosGIruLVGA fMMwY2AY5XW1cqa58a5ezZM6c6Osa6sbDA== X-Received: by 2002:a17:90a:854b:: with SMTP id a11mr222853pjw.4.1632781880154; Mon, 27 Sep 2021 15:31:20 -0700 (PDT) Received: from titan.corp.tusimple.io ([2601:644:8300:136:a6bb:6dff:feb6:3500]) by smtp.gmail.com with ESMTPSA id i27sm18081225pfq.184.2021.09.27.15.31.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 15:31:19 -0700 (PDT) From: Jinshan Xiong To: jolsa@redhat.com, arnaldo.melo@gmail.com Cc: Jinshan Xiong , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] tools/lib/perf: make the static libperf complete Date: Mon, 27 Sep 2021 15:30:26 -0700 Message-Id: <20210927223101.3155964-1-jinshan.xiong@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch makes libperf.a complete. Initially it misses the symbols fdarray_* that makes it unusable after being installed by: $ make install DESTDIR= Check missing symbols: $ nm tools/lib/perf/libperf.a | grep fdarray_ U fdarray__add 0000000000002b3e t fdarray__available_entries U fdarray__exit U fdarray__filter U fdarray__grow U fdarray__init U fdarray__poll After this patch is applied: $ nm tools/lib/perf/libperf-ext.a | grep fdarray_ 00000000000063f7 T fdarray__add ...... 00000000000065d4 T fdarray__poll Signed-off-by: "Jinshan Xiong" --- tools/lib/perf/Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/lib/perf/Makefile b/tools/lib/perf/Makefile index 08fe6e3c4089..b2f7f4fd7065 100644 --- a/tools/lib/perf/Makefile +++ b/tools/lib/perf/Makefile @@ -94,7 +94,8 @@ LIBPERF_A := $(OUTPUT)libperf.a LIBPERF_IN := $(OUTPUT)libperf-in.o LIBPERF_PC := $(OUTPUT)libperf.pc -LIBPERF_ALL := $(LIBPERF_A) $(OUTPUT)libperf.so* +LIBPERF_A_EXT := $(OUTPUT)libperf-ext.a +LIBPERF_LIBS_INSTALL := $(LIBPERF_A_EXT) $(OUTPUT)libperf.so* LIB_DIR := $(srctree)/tools/lib/api/ @@ -124,6 +125,9 @@ $(LIBPERF_IN): FORCE $(LIBPERF_A): $(LIBPERF_IN) $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) +$(LIBPERF_A_EXT): $(LIBPERF_IN) $(LIBAPI) + $(QUIET_AR)$(RM) $@ && $(LD) -r -o libperf-ext.o $^ && $(AR) rcs $@ libperf-ext.o + $(LIBPERF_SO): $(LIBPERF_IN) $(LIBAPI) $(QUIET_LINK)$(CC) --shared -Wl,-soname,libperf.so \ -Wl,--version-script=$(VERSION_SCRIPT) $^ -o $@ @@ -131,7 +135,7 @@ $(LIBPERF_SO): $(LIBPERF_IN) $(LIBAPI) @ln -sf $(@F) $(OUTPUT)libperf.so.$(LIBPERF_VERSION) -libs: $(LIBPERF_A) $(LIBPERF_SO) $(LIBPERF_PC) +libs: $(LIBPERF_A) $(LIBPERF_A_EXT) $(LIBPERF_SO) $(LIBPERF_PC) all: fixdep $(Q)$(MAKE) libs @@ -183,9 +187,9 @@ define do_install endef install_lib: libs - $(call QUIET_INSTALL, $(LIBPERF_ALL)) \ + $(call QUIET_INSTALL, $(LIBPERF_LIBS_INSTALL)) \ $(call do_install_mkdir,$(libdir_SQ)); \ - cp -fpR $(LIBPERF_ALL) $(DESTDIR)$(libdir_SQ) + cp -fpR $(LIBPERF_LIBS_INSTALL) $(DESTDIR)$(libdir_SQ) install_headers: $(call QUIET_INSTALL, headers) \ -- 2.30.2