aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Mayle <fmayle@google.com>2024-04-15 10:44:28 -0700
committerFrederick Mayle <fmayle@google.com>2024-04-15 22:58:56 +0000
commit2a9a3407346fd09aa3ddf89d320e4700211cee5a (patch)
treecb3c3820c20bdf0651553914107cc6a4187a6f88
parentc223989d8457ecb2345a8d2831d8a1e599abcb0c (diff)
downloadcrosvm-2a9a3407346fd09aa3ddf89d320e4700211cee5a.tar.gz
UPSTREAM: base: fix musl build
musl doesn't appear to provide _SC_LEVEL1_DCACHE_LINESIZE, neither in its C headers nor in the `libc` crate. BUG=b:332584046 TEST=built in AOSP against musl target Bug: 332584046 Change-Id: I3c79435ff43f85a64e55dd86d231ab3d61522214 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5455211 Reviewed-by: Junichi Uekawa <uekawa@chromium.org> Commit-Queue: Frederick Mayle <fmayle@google.com> Reviewed-by: Ryan Neph <ryanneph@google.com>
-rw-r--r--base/src/mmap.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/base/src/mmap.rs b/base/src/mmap.rs
index fd53fa8af..8095135eb 100644
--- a/base/src/mmap.rs
+++ b/base/src/mmap.rs
@@ -36,7 +36,7 @@ static CACHELINE_SIZE: OnceLock<usize> = OnceLock::new();
fn get_cacheline_size_once() -> usize {
let mut assume_reason: &str = "unknown";
cfg_if::cfg_if! {
- if #[cfg(any(target_os = "android", target_os = "linux"))] {
+ if #[cfg(all(any(target_os = "android", target_os = "linux"), not(target_env = "musl")))] {
// SAFETY:
// Safe because we check the return value for errors or unsupported requests
let linesize = unsafe { libc::sysconf(libc::_SC_LEVEL1_DCACHE_LINESIZE) };