public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* CONFIG_FRAME_POINTER support for Clang
@ 2019-05-30 22:56 Tri Vo
  2019-05-30 22:58 ` Nick Desaulniers
  2019-05-30 23:13 ` Russell King - ARM Linux admin
  0 siblings, 2 replies; 6+ messages in thread
From: Tri Vo @ 2019-05-30 22:56 UTC (permalink / raw)
  To: linux; +Cc: irogers, Nick Desaulniers, Linux ARM, stefan

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-05-31  0:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2019-05-31  0:03   ` Tri Vo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox