linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jinshan Xiong <jinshan.xiong@gmail.com>
To: jolsa@redhat.com
Cc: Jinshan Xiong <jinshan.xiong@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] tools/lib/perf: make the static libperf complete
Date: Sat, 25 Sep 2021 19:30:24 -0700	[thread overview]
Message-ID: <20210926023028.2338342-1-jinshan.xiong@gmail.com> (raw)

This patch makes libperf.a complete. Initially it misses the symbols
fdarray_* that makes it unusable:
   $ 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.a | grep fdarray_
    00000000000063f7 T fdarray__add
    ......
    00000000000065d4 T fdarray__poll

Signed-off-by: "Jinshan Xiong" <jinshan.xiong@gmail.com>
---
 tools/lib/perf/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/lib/perf/Makefile b/tools/lib/perf/Makefile
index 08fe6e3c4089..840366584fc1 100644
--- a/tools/lib/perf/Makefile
+++ b/tools/lib/perf/Makefile
@@ -121,8 +121,8 @@ $(LIBAPI)-clean:
 $(LIBPERF_IN): FORCE
 	$(Q)$(MAKE) $(build)=libperf
 
-$(LIBPERF_A): $(LIBPERF_IN)
-	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN)
+$(LIBPERF_A): $(LIBPERF_IN) $(LIBAPI)
+	$(QUIET_AR)$(RM) $@ && $(LD) -r -o libperf-ar.o $^ && $(AR) rcs $@ libperf-ar.o
 
 $(LIBPERF_SO): $(LIBPERF_IN) $(LIBAPI)
 	$(QUIET_LINK)$(CC) --shared -Wl,-soname,libperf.so \
-- 
2.30.2


             reply	other threads:[~2021-09-26  2:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-26  2:30 Jinshan Xiong [this message]
2021-09-26 12:14 ` [PATCH] tools/lib/perf: make the static libperf complete Arnaldo Carvalho de Melo
2021-09-27 22:12   ` Jinshan Xiong
2021-09-27 22:30     ` [PATCH v2] " Jinshan Xiong
2021-09-28 21:43       ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210926023028.2338342-1-jinshan.xiong@gmail.com \
    --to=jinshan.xiong@gmail.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).