This commit is contained in:
Dongjia "toka" Zhang 2023-05-17 15:22:49 +02:00 committed by GitHub
parent 66127d8492
commit 3fd5671909
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -381,6 +381,13 @@ impl CompilerWrapper for ClangWrapper {
self.linking self.linking
} }
fn filter(&self, args: &mut Vec<String>) {
let blacklist = ["-Werror=unused-command-line-argument"];
for item in blacklist {
args.retain(|x| x.clone() != item);
}
}
fn silence(&mut self, value: bool) -> &'_ mut Self { fn silence(&mut self, value: bool) -> &'_ mut Self {
self.is_silent = value; self.is_silent = value;
self self

View File

@ -157,6 +157,9 @@ pub trait CompilerWrapper {
/// Get if in linking mode /// Get if in linking mode
fn is_linking(&self) -> bool; fn is_linking(&self) -> bool;
/// Filter out argumets
fn filter(&self, _args: &mut Vec<String>) {}
/// Silences `libafl_cc` output /// Silences `libafl_cc` output
fn silence(&mut self, value: bool) -> &'_ mut Self; fn silence(&mut self, value: bool) -> &'_ mut Self;
@ -165,7 +168,8 @@ pub trait CompilerWrapper {
/// Run the compiler /// Run the compiler
fn run(&mut self) -> Result<Option<i32>, Error> { fn run(&mut self) -> Result<Option<i32>, Error> {
let args = self.command()?; let mut args = self.command()?;
self.filter(&mut args);
if !self.is_silent() { if !self.is_silent() {
dbg!(args.clone()); dbg!(args.clone());