pub trait CompilerWrapper: ToolWrapper {
// Required methods
fn add_cc_arg<S>(&mut self, arg: S) -> &mut Self
where S: AsRef<str>;
fn add_link_arg<S>(&mut self, arg: S) -> &mut Self
where S: AsRef<str>;
fn link_staticlib<S>(&mut self, dir: &Path, name: S) -> &mut Self
where S: AsRef<str>;
// Provided methods
fn add_cc_args<S>(&mut self, args: &[S]) -> &mut Self
where S: AsRef<str> { ... }
fn add_link_args<S>(&mut self, args: &[S]) -> &mut Self
where S: AsRef<str> { ... }
fn link_libpython(&mut self) -> Result<&mut Self, String> { ... }
}
Expand description
Wrap a compiler hijacking its arguments
Required Methods§
Sourcefn add_cc_arg<S>(&mut self, arg: S) -> &mut Self
fn add_cc_arg<S>(&mut self, arg: S) -> &mut Self
Add a compiler argument only when compiling
Sourcefn add_link_arg<S>(&mut self, arg: S) -> &mut Self
fn add_link_arg<S>(&mut self, arg: S) -> &mut Self
Add a compiler argument only when linking
Sourcefn link_staticlib<S>(&mut self, dir: &Path, name: S) -> &mut Self
fn link_staticlib<S>(&mut self, dir: &Path, name: S) -> &mut Self
Link static C lib
Provided Methods§
Sourcefn add_cc_args<S>(&mut self, args: &[S]) -> &mut Self
fn add_cc_args<S>(&mut self, args: &[S]) -> &mut Self
Add compiler arguments only when compiling
Sourcefn add_link_args<S>(&mut self, args: &[S]) -> &mut Self
fn add_link_args<S>(&mut self, args: &[S]) -> &mut Self
Add compiler arguments only when linking
Sourcefn link_libpython(&mut self) -> Result<&mut Self, String>
fn link_libpython(&mut self) -> Result<&mut Self, String>
Finds the current python3
version and adds -lpython3.<version>
as linker argument.
Useful for fuzzers that need libpython, such as nautilus
-based fuzzers.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.