Skip to content

ARM: extraneous unwinder reference with -fprofile-arcs #42579

Open
@arndb

Description

@arndb
mannequin
Bugzilla Link 43234
Version 8.0
OS Linux
Blocks #4440
CC @calixteman,@kbeyls,@nickdesaulniers,@zygoloid,@smithp35,@vedantk

Extended Description

I got a link error on a 32-bit ARM kernel build with CONFIG_GCOV_KERNEL and CONFIG_UNWIND_FRAME_POINTER set:

kernel/trace/trace_clock.o:(.ARM.exidx+0x0): undefined reference to __aeabi_unwind_cpp_pr0' kernel/trace/trace_clock.o:(.ARM.exidx+0x8): undefined reference to __aeabi_unwind_cpp_pr0'
kernel/trace/trace_clock.o:(.ARM.exidx+0x10): undefined reference to `__aeabi_unwind_cpp_pr0'

I created a reduced test case at https://godbolt.org/z/gBQtAP

Basically, clang inserts __llvm_gcov_writeout/__llvm_gcov_flush/__llvm_gcov_init functions into any file it compiles, even for an empty C file input. These functions contain .fnstart/.fnend statements even when building with "-fno-omit-frame-pointer -fno-unwind-tables", which then results in unresolved references to __aeabi_unwind_cpp_pr0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclangClang issues not falling into any other category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions