diff options
author | Chris Wailes <chriswailes@google.com> | 2024-05-09 14:33:05 -0700 |
---|---|---|
committer | Chris Wailes <chriswailes@google.com> | 2024-05-09 22:01:38 +0000 |
commit | 869bf4fb7f7fe78fa5da1619921648f4d41e2b96 (patch) | |
tree | 0213c7c9dcc40b9f5feb03bee20e32a2f2aab2f0 | |
parent | fa1532529950129739711da320bc9b50c21c2591 (diff) | |
download | oorandom-869bf4fb7f7fe78fa5da1619921648f4d41e2b96.tar.gz |
Ensure crate is compiled with std for panic handler
This CL adds a patch to use `extern crate std` to ensure that a panic
handler is available when the crate is compiled as a dylib.
Test: m liboorandom
Bug: 333887339
Change-Id: Idc09364cecfbeb7614d1626ea34da701e9988617
-rw-r--r-- | patches/std.diff | 14 | ||||
-rw-r--r-- | src/lib.rs | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/patches/std.diff b/patches/std.diff new file mode 100644 index 0000000..4524081 --- /dev/null +++ b/patches/std.diff @@ -0,0 +1,14 @@ +diff --git a/src/lib.rs b/src/lib.rs +index 8196950..f77d0b1 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -22,6 +22,9 @@ + #![no_std] + use core::ops::Range; + ++#[cfg(android_dylib)] ++extern crate std; ++ + /// A PRNG producing a 32-bit output. + /// + /// The current implementation is `PCG-XSH-RR`. @@ -22,6 +22,9 @@ #![no_std] use core::ops::Range; +#[cfg(android_dylib)] +extern crate std; + /// A PRNG producing a 32-bit output. /// /// The current implementation is `PCG-XSH-RR`. |