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: Tri Vo <trong@android.com>
Cc: irogers@google.com, Nick Desaulniers <ndesaulniers@google.com>,
	stefan@agner.ch, Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: CONFIG_FRAME_POINTER support for Clang
Date: Fri, 31 May 2019 00:13:46 +0100	[thread overview]
Message-ID: <20190530231346.ede52pjznj3pgfll@shell.armlinux.org.uk> (raw)
In-Reply-To: <CANA+-vBHL9a9fXDWxALXXuJk6r8ObZZjhrGp-p5JUnfOThEV5g@mail.gmail.com>

On Thu, May 30, 2019 at 03:56:06PM -0700, Tri Vo 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

What format stack frames does Clang use?  I don't use clang, never seen
any clang ARM assembly, so I've no idea on this.

> 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
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

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

  parent 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
2019-05-30 23:13 ` Russell King - ARM Linux admin [this message]
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=20190530231346.ede52pjznj3pgfll@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=irogers@google.com \
    --cc=linux-arm-kernel@lists.infradead.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