Linux Perf Users
 help / color / mirror / Atom feed
From: James Clark <james.clark@arm.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Branislav Rankov" <Branislav.Rankov@arm.com>
Cc: "Mark Rutland" <mark.rutland@arm.com>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Jiri Olsa" <jolsa@redhat.com>,
	"Namhyung Kim" <namhyung@kernel.org>,
	linux-perf-users@vger.kernel.org,
	"Diederik de Haas" <didi.debian@cknow.org>,
	"Uwe Kleine-König" <uwe@kleine-koenig.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Arnaldo Carvalho de Melo" <acme@kernel.org>
Subject: Re: [PATCH] perf: Drop -lstdc++ from OPENCSDLIBS
Date: Thu, 2 Dec 2021 15:36:12 +0000	[thread overview]
Message-ID: <8a5aead5-369d-5c0b-1ef7-362f777c5b9a@arm.com> (raw)
In-Reply-To: <20211202134337.1109300-1-u.kleine-koenig@pengutronix.de>



On 02/12/2021 13:43, Uwe Kleine-König wrote:
> 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++

Do you have this library installed for arm64? I know you said you had OpenCSD installed, but
maybe the arm64 stdc++ lib is missing?

> 
> 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.

This -lstdc++ was only just added a few months ago by Branislav so I'm
not sure if it should be removed. OpenCSD does use C++ so it is involved,
although I would have thought that stdc++ was a dependency of opencsd so
it would automatically get pulled in.

@Branislav, what was the build error that you were fixing with the recent
change? I checked the commit message but it's not listed.

James

> 
> 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
> 

  parent reply	other threads:[~2021-12-02 15:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=8a5aead5-369d-5c0b-1ef7-362f777c5b9a@arm.com \
    --to=james.clark@arm.com \
    --cc=Branislav.Rankov@arm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=didi.debian@cknow.org \
    --cc=jolsa@redhat.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=uwe@kleine-koenig.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