Fix for LLVM-15 (#3215)

This commit is contained in:
lazymio 2025-05-12 21:54:43 +08:00 committed by GitHub
parent 522e00eda0
commit df9b5b7e3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 0 deletions

View File

@ -427,6 +427,7 @@ pub const LIBAFL_CC_LLVM_VERSION: Option<usize> = None;
if cfg!(unix) { if cfg!(unix) {
cxxflags.push(String::from("-shared")); cxxflags.push(String::from("-shared"));
cxxflags.push(String::from("-fPIC")); cxxflags.push(String::from("-fPIC"));
cxxflags.push(String::from("-std=c++17")); // std::nullopt_t requires this
} }
if cfg!(windows) { if cfg!(windows) {
cxxflags.push(String::from("-fuse-ld=lld")); cxxflags.push(String::from("-fuse-ld=lld"));

View File

@ -10,7 +10,11 @@
#define HAVE_VECTOR_INTRINSICS 1 #define HAVE_VECTOR_INTRINSICS 1
#include <optional> #include <optional>
#if LLVM_VERSION_MAJOR >= 16
// None constant being deprecated for LLVM-16, it is recommended
// to use the std::nullopt_t type instead. (#1010)
constexpr std::nullopt_t None = std::nullopt; constexpr std::nullopt_t None = std::nullopt;
#endif
// all llvm includes and friends // all llvm includes and friends
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"

View File

@ -283,6 +283,8 @@ PreservedAnalyses AFLCoverage::run(Module &M, ModuleAnalysisManager &MAM) {
} }
break; break;
} }
default:
break;
} }
} }
/* Make up cur_loc */ /* Make up cur_loc */