Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH] perf: Drop -lstdc++ from OPENCSDLIBS
@ 2021-12-02 13:43 Uwe Kleine-König
  2021-12-02 15:23 ` Uwe Kleine-König
  2021-12-02 15:36 ` James Clark
  0 siblings, 2 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2021-12-02 13:43 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo
  Cc: Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-perf-users, Diederik de Haas, Uwe Kleine-König

From: Uwe Kleine-König <uwe@kleine-koenig.org>

When cross compiling on amd64 for arm64 the build failed on my machine with:

	Makefile.config:493: *** Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1.  Stop.

even though libopencsd was installed (for both amd64 and arm64). After
some digging around I found the relevant error message in
tools/perf/feature/test-libopencsd.make.output:

	/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: cannot find -lstdc++

Instead of fixing the error message to also include a request to install
libstdc++, just drop -lstdc++. With this change the build completed.

Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
---
Hello,

not sure this is a pure cross compilation problem. I think in general
it's a bad idea to link against libstdc++ explicitly. Still more if
there is no C++ involved.

Best regards
Uwe

 tools/perf/Makefile.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index afd144725a0b..dc946b7a802e 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -143,7 +143,7 @@ FEATURE_CHECK_LDFLAGS-libcrypto = -lcrypto
 ifdef CSINCLUDES
   LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)
 endif
-OPENCSDLIBS := -lopencsd_c_api -lopencsd -lstdc++
+OPENCSDLIBS := -lopencsd_c_api -lopencsd
 ifdef CSLIBS
   LIBOPENCSD_LDFLAGS := -L$(CSLIBS)
 endif
-- 
2.30.2


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

end of thread, other threads:[~2021-12-03  9:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-02 13:43 [PATCH] perf: Drop -lstdc++ from OPENCSDLIBS Uwe Kleine-König
2021-12-02 15:23 ` Uwe Kleine-König
2021-12-02 15:36 ` James Clark
2021-12-02 16:00   ` Branislav Rankov
2021-12-02 16:07     ` Uwe Kleine-König
2021-12-03  9:22       ` James Clark
2021-12-02 16:03   ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox