Skip to content

Commit f267005

Browse files
committed
Don't emit binary info unless we are bare-metal.
The change for `#[used]` in Rust 1.89 causes linker errors when compiling this library for a Linux target (and probably other OSes as well). So now only emit this global variable when target_os is none.
1 parent 01cdf55 commit f267005

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rp-binary-info/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ extern "C" {
115115
/// The data here tells picotool the start and end flash addresses of our
116116
/// metadata.
117117
#[link_section = ".boot_info"]
118-
#[cfg(feature = "binary-info")]
118+
#[cfg(all(feature = "binary-info", target_os = "none"))]
119119
#[used]
120120
#[allow(unused_unsafe)] // addr_of! is safe since rust 1.82.0
121121
pub static PICOTOOL_HEADER: Header = unsafe {

0 commit comments

Comments
 (0)