From 698ebb6b35236b054e81ff86e0d9045448444a6b Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Sun, 13 Aug 2023 11:14:30 +0100 Subject: [PATCH] libafl_bolts: fix musl build (#1421) despite being present in the headers, getcontext is not implemented in musl libc, most likely due to the fact it s a deprecated interface. The only way around is having the third party libucontext apk package installed. --- libafl_bolts/build.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libafl_bolts/build.rs b/libafl_bolts/build.rs index c4fe7f650f..0ed1270dc4 100644 --- a/libafl_bolts/build.rs +++ b/libafl_bolts/build.rs @@ -2,9 +2,13 @@ fn main() { println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rustc-cfg=nightly"); + #[cfg(target_env = "musl")] + println!("cargo:rustc-link-lib=ucontext"); } #[rustversion::not(nightly)] fn main() { println!("cargo:rerun-if-changed=build.rs"); + #[cfg(target_env = "musl")] + println!("cargo:rustc-link-lib=ucontext"); }