lto and llvm14-dev
MODIFY
docs/Changelog.md
docs/Changelog.md
@@ -24,7 +24,7 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
afl-showmap and other tools.
- afl-cc:
- fix for shared linking on MacOS
- - llvm and LTO mode verified to work with new llvm 14-dev
+ - llvm and LTO mode modified to work with new llvm 14-dev (again)
- added the very good grammar mutator "GramaTron" to the
custom_mutators
- added optimin, a faster and better corpus minimizer by

MODIFY
instrumentation/SanitizerCoveragePCGUARD.so.cc
instrumentation/SanitizerCoveragePCGUARD.so.cc
@@ -881,8 +881,6 @@ void ModuleSanitizerCoverage::InjectCoverageForIndirectCalls(
Function &F, ArrayRef<Instruction *> IndirCalls) {
if (IndirCalls.empty()) return;
- assert(Options.TracePC || Options.TracePCGuard ||
- Options.Inline8bitCounters /*|| Options.InlineBoolFlag*/);
for (auto I : IndirCalls) {
IRBuilder<> IRB(I);

MODIFY
instrumentation/afl-llvm-lto-instrumentation.so.cc
instrumentation/afl-llvm-lto-instrumentation.so.cc
@@ -244,7 +244,11 @@ bool AFLLTOPass::runOnModule(Module &M) {
// the instrument file list check
AttributeList Attrs = F.getAttributes();
+#if LLVM_VERSION_MAJOR < 14
if (Attrs.hasAttribute(-1, StringRef("skipinstrument"))) {
+#else
+ if (Attrs.hasFnAttr(StringRef("skipinstrument"))) {
+#endif
if (debug)
fprintf(stderr,

MODIFY
instrumentation/afl-llvm-lto-instrumentlist.so.cc
instrumentation/afl-llvm-lto-instrumentlist.so.cc
@@ -116,10 +116,15 @@ bool AFLcheckIfInstrument::runOnModule(Module &M) {
auto & Ctx = F.getContext();
AttributeList Attrs = F.getAttributes();
+#if LLVM_VERSION_MAJOR < 14
AttrBuilder NewAttrs;
NewAttrs.addAttribute("skipinstrument");
F.setAttributes(
Attrs.addAttributes(Ctx, AttributeList::FunctionIndex, NewAttrs));
+#else
+ AttributeList NewAttrs = Attrs.addFnAttribute(Ctx, "skipinstrument");
+ F.setAttributes(NewAttrs);
+#endif
}

lto and llvm14-dev