From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: "Maciej W. Rozycki" <macro@embecosm.com>
Cc: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>,
Vladimir Mezentsev via Binutils <binutils@sourceware.org>
Subject: Re: [PATCH V4] gprofng: a new GNU profiler
Date: Thu, 03 Feb 2022 13:16:13 +0100 [thread overview]
Message-ID: <87sft06t82.fsf@oracle.com> (raw)
In-Reply-To: <alpine.DEB.2.20.2202031003130.11348@tpp.orcam.me.uk> (Maciej W. Rozycki's message of "Thu, 3 Feb 2022 11:02:12 +0000 (GMT)")
> On Wed, 2 Feb 2022, Vladimir Mezentsev wrote:
>
>> > > > Woudn't it be better to skip building gprofng in case no --enable-shared
>> > > > is specified at `configure' time?
>> > > Is it actually necessary to require `--enable-shared' in the first place
>> > > for the program to work?
>> > I think so. AFAIK the gprofng collector works as an interposed shared
>> > object.
>>
>> yes.
>> We use the gprofng library in LD_PRELOAD. This library should be a shared
>> library.
>>
>>
>> I am trying to set extra_configure_flags='--enable-shared' for gprofng build
>> only.
>> But gprofng depens on libopcodes and this library should build with -fPIC.
>> I haven't yet found how to solve this build issue.
>
> Forcing `--enable-shared' in gprofng/ unconditionally could be confusing
> to the user who might want to avoid shared libraries for a reason.
>
> I think perhaps the best solution would be using AC_ENABLE_SHARED in
> gprofng/ or the equivalent LT_INIT option (I think it's the default
> anyway) and bail out with a suitable message such as:
>
> "Building in gprofng is unsupported with shared libraries disabled.
> Please reconfigure with `--enable-shared=gprofng' or `--disable-gprofng'."
>
> or suchlike.
I think this warning could be implemented in the top-level configure.ac,
setting `notsupp' for gprofng if `enable_shared' is "no".
Then, if the user builds binutils without --enable-shared, or in a host
or target for which gprofng is not supported, you get the familiar
message:
*** This configuration is not supported in the following subdirectories:
gprofng
(Any other directories should still work fine.)
> Then in libopcodes/ you probably want the `pic-only' option to LT_INIT
> (or use `--with-pic') unless `--enable-shared' has been also used for the
> library, though I think it would best be conditionalised on gprofng having
> been enabled if possible as there's a performance hit from using PIC code.
> As there's a `--without-pic' option too the user can give this all may
> have to be coordinated at the top level rather than within gprofng/.
>
> Perhaps the way how `extra_host_libiberty_configure_flags' are handled
> could serve as an example (though I think it should also use `--with-pic'
> rather than `--enable-shared' unless `--enable-shared' has been explicitly
> given already).
>
> I realise what I have outlined is not a complete solution, but I hope it
> can help regardless.
>
> Maciej
next prev parent reply other threads:[~2022-02-03 12:16 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fcc77804-0d0c-0f8e-5c3b-3ac034340b1a@oracle.com>
2021-11-03 18:05 ` Vladimir Mezentsev
2021-11-15 18:13 ` Ping: " Vladimir Mezentsev
2021-11-29 17:34 ` Vladimir Mezentsev
2021-12-10 9:38 ` Nick Clifton
2021-12-10 17:31 ` Vladimir Mezentsev
2021-12-13 15:13 ` Nick Clifton
2021-12-16 22:22 ` Vladimir Mezentsev
2022-01-12 0:48 ` Vladimir Mezentsev
2022-01-12 12:42 ` Nick Clifton
2022-01-12 15:17 ` Jose E. Marchesi
2022-01-12 15:23 ` Jose E. Marchesi
[not found] ` <c26c71b2-8cf1-2eef-206f-14c4774b2ba0@oracle.com>
2022-01-26 12:04 ` Nick Clifton
2022-01-26 17:10 ` Vladimir Mezentsev
2022-01-27 14:34 ` Jose E. Marchesi
2022-02-02 12:40 ` Maciej W. Rozycki
2022-02-02 16:30 ` Jose E. Marchesi
2022-02-03 6:23 ` Vladimir Mezentsev
2022-02-03 11:02 ` Maciej W. Rozycki
2022-02-03 12:16 ` Jose E. Marchesi [this message]
2022-03-02 19:47 ` Vladimir Mezentsev
2022-03-04 13:53 ` Nick Clifton
2022-03-07 21:42 ` Vladimir Mezentsev
2022-03-07 21:57 ` H.J. Lu
2022-03-07 22:25 ` Vladimir Mezentsev
2022-03-09 16:36 ` Nick Clifton
2022-03-09 21:13 ` Vladimir Mezentsev
2022-03-14 11:12 ` Martin Liška
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=87sft06t82.fsf@oracle.com \
--to=jose.marchesi@oracle.com \
--cc=binutils@sourceware.org \
--cc=macro@embecosm.com \
--cc=vladimir.mezentsev@oracle.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).