Linux Perf Users
 help / color / mirror / Atom feed
From: Branislav Rankov <branislav.rankov@arm.com>
To: "James Clark" <james.clark@arm.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
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 16:00:23 +0000	[thread overview]
Message-ID: <241b28ec-4acf-b30f-90c1-e1f7ef6c1443@arm.com> (raw)
In-Reply-To: <8a5aead5-369d-5c0b-1ef7-362f777c5b9a@arm.com>



On 12/2/21 15:36, James Clark wrote:
>
>
> 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.

Hi. I was fixing the static build with this. When doing the static build you need
to list all the dependencies. I thought it would not be a problem to also list it
in the dynamic case.

I did not have problems when trying crosscompile in both dynamic and static case.
But maybe you have a case where this is a problem. I would like to understand what
your case is.
Does your libOpenCSD.so have a dependency on libstdc++.so?
If so, where is the libstdc++.so?

If this is a genuine problem, we could add -lstdc++ conditionally only for the
static build.

>
> 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
>>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

  reply	other threads:[~2021-12-02 16:00 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
2021-12-02 16:00   ` Branislav Rankov [this message]
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=241b28ec-4acf-b30f-90c1-e1f7ef6c1443@arm.com \
    --to=branislav.rankov@arm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=didi.debian@cknow.org \
    --cc=james.clark@arm.com \
    --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