Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will rustc enable frame pointers on linux by default?

Tags:

linux

rust

llvm

The rustc book indicates that

The default behaviour, if frame pointers are not force-enabled, depends on the target

What is the default behavior on linux, and how can I find the default value for all targets?

like image 704
Pure White Avatar asked Aug 01 '26 21:08

Pure White


1 Answers

Having a look through the rustc-code, it looks as linux is defaulted to FramePointer::MayOmit

Allows the machine code generator to omit the frame pointers. This option does not guarantee that the frame pointers will be omitted.

This corresponds to llvm's frame-pointer function attribute with a value of none. So it leaves it up to llvm to decide on a per-function basis.

You can see all the platform defaults in rust/src/librustc_target/spec/.

like image 143
pigeonhands Avatar answered Aug 05 '26 14:08

pigeonhands



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!