Skip to content

Rebuild std with frame pointers #213

Closed
@YaLTeR

Description

@YaLTeR

At the moment, the official std binaries are built without frame pointers: rust-lang/rust#103711. This means that libraries and apps built with freedesktop SDK's Rust have clobbered frame pointers in std functions, even when building with -C force-frame-pointers=yes. This can be verified with a command from the issue:

$ objdump -Cd src/identity | grep -E '>:$|\$0x1,%bpl' | grep -B1 bpl | head -n 50
000000000080da60 <std::panicking::default_hook>:
  80dcea:	40 b5 01             	mov    $0x1,%bpl
--
000000000080fb30 <std::sys::unix::futex::futex_wait>:
  80fbd2:	40 b5 01             	mov    $0x1,%bpl
--
000000000080fcc0 <std::sys::unix::os::glibc_version>:
  80fdbf:	40 f6 c5 01          	test   $0x1,%bpl
  80fdc9:	40 f6 c5 01          	test   $0x1,%bpl
000000000080fe00 <<std::sys::unix::os_str::Slice as core::fmt::Display>::fmt>:
  80fe9d:	40 b5 01             	mov    $0x1,%bpl

<and so on>

Frame pointers in all functions are needed for fast profiling, and they are already enabled across the freedesktop SDK. To be able to profile Rust applications and applications depending on Rust libraries (e.g. Rust gstreamer plugins), they should also be built with frame pointers, including the standard library crates.

Until there are official binaries with frame pointers, would it be possible to rebuild the standard library crates with -C force-frame-pointers=yes for the freedesktop SDK extension?

You can verify that it worked if building an app with -C force-frame-pointers=yes produces empty output for the above command:

$ objdump -Cd src/identity | grep -E '>:$|\$0x1,%bpl' | grep -B1 bpl | head -n 50
$

cc @alatiera

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions