All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/lib/perf: make the static libperf complete
@ 2021-09-26  2:30 Jinshan Xiong
  2021-09-26 12:14 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 5+ messages in thread
From: Jinshan Xiong @ 2021-09-26  2:30 UTC (permalink / raw)
  To: jolsa
  Cc: Jinshan Xiong, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
	Namhyung Kim, linux-perf-users, linux-kernel

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-28 21:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-26  2:30 [PATCH] tools/lib/perf: make the static libperf complete Jinshan Xiong
2021-09-26 12:14 ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.