Skip to content

Commit

Permalink
Switch to force loading std for panic_handler
Browse files Browse the repository at this point in the history
Summary:
When building buck sysroot from source, `#[no_std]` crates would fail to link as shared libraries, citing "missing #[panic_handler]".

Matt introduced a mechanism in rust-lang/rust#109421 that allows us to still link in the default panic handler from `std`, even if the rest of the crate is completely unused (as is the case with `no_std` crates).

The net result is that we no longer need to force static linkage when building no_std crates with buckified sysroot.

Reviewed By: zertosh

Differential Revision: D47402849

fbshipit-source-id: 35e31c7ff6d5683ff32a3c1eb2d67acec57acc8f
  • Loading branch information
capickett authored and facebook-github-bot committed Jul 14, 2023
1 parent da6320e commit a03f2d4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# #[no_std] cannot be built with shared linkage
preferred_linkage = "static"

[[buildscript]]
[buildscript.rustc_flags]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
# #[no_std] cannot be built with shared linkage
preferred_linkage = "static"

[[buildscript]]
[buildscript.rustc_flags]

0 comments on commit a03f2d4

Please sign in to comment.