macos fixes
This commit is contained in:
parent
8056cbe5cb
commit
e479b4fa24
@ -21,12 +21,12 @@ pub fn main() {
|
||||
// silence the compiler wrapper output, needed for some configure scripts.
|
||||
.silence(true)
|
||||
.from_args(&args)
|
||||
.expect("Failed to parse the command line".into())
|
||||
.expect("Failed to parse the command line")
|
||||
.link_staticlib(&dir, "fuzzbench")
|
||||
.add_arg("-fsanitize-coverage=trace-pc-guard,trace-cmp")
|
||||
.add_pass(LLVMPasses::CmpLogRtn)
|
||||
.run()
|
||||
.expect("Failed to run the wrapped compiler".into())
|
||||
.expect("Failed to run the wrapped compiler")
|
||||
{
|
||||
std::process::exit(code);
|
||||
}
|
||||
|
@ -21,12 +21,12 @@ pub fn main() {
|
||||
// silence the compiler wrapper output, needed for some configure scripts.
|
||||
.silence(true)
|
||||
.from_args(&args)
|
||||
.expect("Failed to parse the command line".into())
|
||||
.expect("Failed to parse the command line")
|
||||
.link_staticlib(&dir, "generic_inmemory")
|
||||
.add_arg("-fsanitize-coverage=trace-pc-guard,trace-cmp")
|
||||
.add_pass(LLVMPasses::CmpLogRtn)
|
||||
.run()
|
||||
.expect("Failed to run the wrapped compiler".into())
|
||||
.expect("Failed to run the wrapped compiler")
|
||||
{
|
||||
std::process::exit(code);
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ pub fn main() {
|
||||
// silence the compiler wrapper output, needed for some configure scripts.
|
||||
.silence(true)
|
||||
.from_args(&args)
|
||||
.expect("Failed to parse the command line".into())
|
||||
.expect("Failed to parse the command line")
|
||||
.link_staticlib(&dir, "libfuzzer_libmozjpeg")
|
||||
.add_arg("-fsanitize-coverage=trace-pc-guard,trace-cmp")
|
||||
.run()
|
||||
.expect("Failed to run the wrapped compiler".into())
|
||||
.expect("Failed to run the wrapped compiler")
|
||||
{
|
||||
std::process::exit(code);
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ pub fn main() {
|
||||
// silence the compiler wrapper output, needed for some configure scripts.
|
||||
.silence(true)
|
||||
.from_args(&args)
|
||||
.expect("Failed to parse the command line".into())
|
||||
.expect("Failed to parse the command line")
|
||||
.link_staticlib(&dir, "libfuzzer_libpng")
|
||||
.add_arg("-fsanitize-coverage=trace-pc-guard")
|
||||
.run()
|
||||
.expect("Failed to run the wrapped compiler".into())
|
||||
.expect("Failed to run the wrapped compiler")
|
||||
{
|
||||
std::process::exit(code);
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ pub fn main() {
|
||||
// silence the compiler wrapper output, needed for some configure scripts.
|
||||
.silence(true)
|
||||
.from_args(&args)
|
||||
.expect("Failed to parse the command line".into())
|
||||
.expect("Failed to parse the command line")
|
||||
.link_staticlib(&dir, "libfuzzer_libpng")
|
||||
.add_arg("-fsanitize-coverage=trace-pc-guard")
|
||||
.run()
|
||||
.expect("Failed to run the wrapped compiler".into())
|
||||
.expect("Failed to run the wrapped compiler")
|
||||
{
|
||||
std::process::exit(code);
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ pub fn main() {
|
||||
// silence the compiler wrapper output, needed for some configure scripts.
|
||||
.silence(true)
|
||||
.from_args(&args)
|
||||
.expect("Failed to parse the command line".into())
|
||||
.expect("Failed to parse the command line")
|
||||
.link_staticlib(&dir, "libfuzzer_libpng")
|
||||
.add_arg("-fsanitize-coverage=trace-pc-guard")
|
||||
.run()
|
||||
.expect("Failed to run the wrapped compiler".into())
|
||||
.expect("Failed to run the wrapped compiler")
|
||||
{
|
||||
std::process::exit(code);
|
||||
}
|
||||
|
@ -73,6 +73,9 @@
|
||||
#define CHECK_WEAK_FN(Name) (Name != NULL)
|
||||
#endif // _MSC_VER
|
||||
|
||||
#define EXT_FUNC_DEF(NAME, RETURN_TYPE, FUNC_SIG, WARN) \
|
||||
EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN)
|
||||
|
||||
#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \
|
||||
RETURN_TYPE (*NAME##Def) FUNC_SIG = NULL; \
|
||||
EXTERNAL_FUNC(NAME, NAME##Def) RETURN_TYPE NAME FUNC_SIG
|
||||
@ -80,9 +83,16 @@
|
||||
|
||||
#if defined(__APPLE__)
|
||||
// TODO: Find a proper way to deal with weak fns on Apple!
|
||||
#define EXT_FUNC_DEF(NAME, RETURN_TYPE, FUNC_SIG, WARN) \
|
||||
EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) { return 0; }
|
||||
|
||||
#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \
|
||||
RETURN_TYPE NAME FUNC_SIG __attribute__((weak_import)) { return 0; }
|
||||
RETURN_TYPE NAME FUNC_SIG __attribute__((weak_import))
|
||||
#else
|
||||
|
||||
#define EXT_FUNC_DEF(NAME, RETURN_TYPE, FUNC_SIG, WARN) \
|
||||
EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN)
|
||||
|
||||
// Declare these symbols as weak to allow them to be optionally defined.
|
||||
#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \
|
||||
__attribute__((weak, visibility("default"))) RETURN_TYPE NAME FUNC_SIG
|
||||
|
@ -3,16 +3,16 @@
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
EXT_FUNC(LLVMFuzzerInitialize, int, (int *argc, char ***argv), false);
|
||||
EXT_FUNC(LLVMFuzzerCustomMutator, size_t,
|
||||
EXT_FUNC_DEF(LLVMFuzzerInitialize, int, (int *argc, char ***argv), false);
|
||||
EXT_FUNC_DEF(LLVMFuzzerCustomMutator, size_t,
|
||||
(uint8_t *Data, size_t Size, size_t MaxSize, unsigned int Seed),
|
||||
false);
|
||||
EXT_FUNC(LLVMFuzzerCustomCrossOver, size_t,
|
||||
EXT_FUNC_DEF(LLVMFuzzerCustomCrossOver, size_t,
|
||||
(const uint8_t *Data1, size_t Size1,
|
||||
const uint8_t *Data2, size_t Size2,
|
||||
uint8_t *Out, size_t MaxOutSize, unsigned int Seed),
|
||||
false);
|
||||
EXT_FUNC(LLVMFuzzerTestOneInput, int, (uint8_t *Data, size_t Size), false);
|
||||
EXT_FUNC_DEF(LLVMFuzzerTestOneInput, int, (uint8_t *Data, size_t Size), false);
|
||||
|
||||
void libafl_main();
|
||||
EXT_FUNC(main, int, (int argc, char** argv), false) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user