Skip to content

[PowerPC] call to _mcount emitted by -pg needs to be emitted BEFORE function prolog #63220

Closed
@nickdesaulniers

Description

@nickdesaulniers

From an LKML thread: https://lore.kernel.org/llvm/[email protected]/

Ftrace on ppc32 expects a three instruction sequence at the beginning of
each function when specifying -pg:
	mflr	r0
	stw	r0,4(r1)
	bl	_mcount

This is the case with all supported versions of gcc. Clang however emits
a branch to _mcount after the function prologue

Example: https://godbolt.org/z/8r83PKorK

As a result, support for function tracing is being disabled in the linux kernel for ppc32 when built with clang.

cc @nemanjai @nemanja-ibm

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions