lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210927223101.3155964-1-jinshan.xiong@gmail.com>
Date:   Mon, 27 Sep 2021 15:30:26 -0700
From:   Jinshan Xiong <jinshan.xiong@...il.com>
To:     jolsa@...hat.com, arnaldo.melo@...il.com
Cc:     Jinshan Xiong <jinshan.xiong@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Namhyung Kim <namhyung@...nel.org>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2] tools/lib/perf: make the static libperf complete

This patch makes libperf.a complete. Initially it misses the symbols
fdarray_* that makes it unusable after being installed by:
   $ make install DESTDIR=<install_dir>

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" <jinshan.xiong@...il.com>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ