public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Ian Rogers <irogers@google.com>
Cc: Tri Vo <trong@android.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Stefan Agner <stefan@agner.ch>,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	Matthias Kaehlcke <mka@chromium.org>,
	Manoj Gupta <manojgupta@google.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: CONFIG_FRAME_POINTER support for Clang
Date: Fri, 31 May 2019 00:14:18 +0100	[thread overview]
Message-ID: <20190530231418.nuwn2kfatcn6cxlc@shell.armlinux.org.uk> (raw)
In-Reply-To: <CAP-5=fUQQAEcZQ4KXAa8pLQFnD0nrN42faYGY2NPAziguTnwKg@mail.gmail.com>

On Thu, May 30, 2019 at 04:12:05PM -0700, Ian Rogers wrote:
> Would it be practical to use __builtin_return_address for the caller's PC?

That works for arguments of zero, but guaranteed for non-zero arguments.

> 
> Thanks,
> Ian
> 
> On Thu, May 30, 2019 at 3:58 PM Nick Desaulniers
> <ndesaulniers@google.com> wrote:
> >
> > + Some more lists/people
> >
> > On Thu, May 30, 2019 at 3:56 PM Tri Vo <trong@android.com> wrote:
> > >
> > > Hello Russell,
> > >
> > > I'm trying to implement support for CONFIG_FRAME_POINTER when building Linux
> > > with Clang compiler.
> > >
> > > Currently, CONFIG_FRAME_POINTER relies on function prologue that is emitted by
> > > GCC using -mapcs flag. However, APCS is obsolete and Clang doesn't support it.
> > >
> > > So in order to accommodate Clang-emitted frame layout, I'm thinking of
> > > providing Clang-specific implementation of code that relies on frame pointer,
> > > most notably in these files:
> > >         lib/backtrace.S
> > >         arch/arm/kernel/stacktrace.c
> > >         arch/arm/net/bpf_jit_32.c
> > >
> > > This will likely involve putting "#ifdef CC_IS_CLANG" statements in the source
> > > code. Is that OK?
> > >
> > > Another caveat is that Clang implementation of backtracing won't be able to
> > > dump saved registers or dump precise pc value of the caller, because IIUC that
> > > information is derived from APCS's fixed prologue.
> > >
> > > What do you think about this approach?
> > >
> > > Thanks,
> > > Tri
> >
> >
> >
> > --
> > Thanks,
> > ~Nick Desaulniers
> 

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-05-30 23:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30 22:56 CONFIG_FRAME_POINTER support for Clang Tri Vo
2019-05-30 22:58 ` Nick Desaulniers
2019-05-30 23:12   ` Ian Rogers
2019-05-30 23:14     ` Russell King - ARM Linux admin [this message]
2019-05-30 23:13 ` Russell King - ARM Linux admin
2019-05-31  0:03   ` Tri Vo

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=20190530231418.nuwn2kfatcn6cxlc@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=clang-built-linux@googlegroups.com \
    --cc=irogers@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=manojgupta@google.com \
    --cc=mka@chromium.org \
    --cc=ndesaulniers@google.com \
    --cc=stefan@agner.ch \
    --cc=trong@android.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