Thanks for the comment.

On 2/21/22 21:07, Stefan Sperling wrote:
On Mon, Feb 21, 2022 at 10:20:17AM +0100, Marc Espie wrote:
On Mon, Feb 21, 2022 at 05:36:16PM +0900, Yuichiro NAITO wrote:
Of course, all programs compiled without '-pg' work fine for me.
I found this issue when I profile my application with gprof(1).
For example, following example C source code fails to execute on OpenBSD 7.0.

Profile is partly broken and has been for a while.

Compiling with -static and removing any pledge() call allow profiling to work.

Yes, and the proposed patch effectively enables -static if -pg is used.
I don't know if this the best fix. But this issue keeps popping up and
it would be nice to have something that works out of the box.
I would not mind this patch going in.

Yes.
When I use ld.bfd as /usr/bin/ld, this problem doesn't happen
although without '-static' option. So, my patch is helpful to keep same
usability between ld.bfd and ld.lld.

Pledge and unveil interfering with profiling is a separate issue which
is more obvious when it occurs and can easily be worked around by the
developer.

I don't have pledge issues in my use case.
My patch isn't intended to change anything about pledge.

--
Yuichiro NAITO ([email protected])

Reply via email to