summaryrefslogtreecommitdiff
path: root/tools/perf
diff options
context:
space:
mode:
authorUwe Kleine-König <uwe@kleine-koenig.org>2021-12-04 00:05:44 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-27 13:05:38 +0300
commit115b85125624457bfc859ea2b6d9a9366535ff53 (patch)
tree2a18b6d572e1d3256d908d074e78006bb6892742 /tools/perf
parente73f737a6e71e863dc46dff5061b2ca4543ba84b (diff)
downloadlinux-115b85125624457bfc859ea2b6d9a9366535ff53.tar.xz
perf tools: Drop requirement for libstdc++.so for libopencsd check
commit ed17b1914978eddb2b01f2d34577f1c82518c650 upstream. It's possible to link against libopencsd_c_api without having libstdc++.so available, only libstdc++.so.6.0.28 (or whatever version is in use) needs to be available. The same holds true for libopencsd.so. When -lstdc++ (or -lopencsd) is explicitly passed to the linker however the .so file must be available. So wrap adding the dependencies into a check for static linking that actually requires adding them all. The same construct is already used for some other tests in the same file to reduce dependencies in the dynamic linking case. Fixes: 573cf5c9a152 ("perf build: Add missing -lstdc++ when linking with libopencsd") Reviewed-by: James Clark <james.clark@arm.com> Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Cc: Adrian Bunk <bunk@debian.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Branislav Rankov <branislav.rankov@arm.com> Cc: Diederik de Haas <didi.debian@cknow.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/all/20211203210544.1137935-1-uwe@kleine-koenig.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/Makefile.config5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 3c077f61d676..71772b20ea73 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -143,7 +143,10 @@ FEATURE_CHECK_LDFLAGS-libcrypto = -lcrypto
ifdef CSINCLUDES
LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)
endif
-OPENCSDLIBS := -lopencsd_c_api -lopencsd -lstdc++
+OPENCSDLIBS := -lopencsd_c_api
+ifeq ($(findstring -static,${LDFLAGS}),-static)
+ OPENCSDLIBS += -lopencsd -lstdc++
+endif
ifdef CSLIBS
LIBOPENCSD_LDFLAGS := -L$(CSLIBS)
endif