question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rust compiled with optimizations shows empty assembly

See original GitHub issue

Rustc 1.9.0 seems to be the last version that works with -O. All newer version show an empty assembly if the (default) “Directives” filter is enabled.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:21 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
CryZecommented, Oct 16, 2016

Adding a #[no_mangle] attribute to the top-level functions fixes the problem. So it’s either a problem with name mangling or Rust doesn’t include mangled top-level functions in the output anymore.

1reaction
mattgodboltcommented, Apr 3, 2017

Great stuff! just making sure I hadn’t missed anything!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rust compiled with optimizations shows empty assembly #139
Rustc 1.9.0 seems to be the last version that works with -O. All newer version show an empty assembly if the (default) "Directives"...
Read more >
Why the assembly output of a compiled rust code does not ...
And since your library does not have any public symbol, it does nothing and your asm is empty. The solution, either: Declare your...
Read more >
Unusual missed optimization for signed integers modulo `1<<k`?
afetisov: You pass it a local variable by copy, so whatever it does inside has no effect on outer optimizations.
Read more >
Interacting with assembly in Rust - LogRocket Blog
In this guide, we'll explore what tools the Rust community has to offer for extracting and embedding assembly.
Read more >
Viewing assembly for Rust function | by George Shuklin
Turned out, it wasn't cargo asm fault… Optimize, inline, eliminate! After I removed bulky criterion and assembly generation become fast, I was ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found