about summary refs log tree commit diff
path: root/llvm_mode/afl-llvm-lto-instrumentation.so.cc
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-04-09 10:36:28 +0200
committerGitHub <noreply@github.com>2020-04-09 10:36:28 +0200
commit45e569845e2f4e3023cb46d93c0638034e6df424 (patch)
treed7c3ddb60b43641c37bdb3d259b55724876ce06f /llvm_mode/afl-llvm-lto-instrumentation.so.cc
parentb55421d4a119fd26a253fe114fb39ec685de4c57 (diff)
downloadafl++-45e569845e2f4e3023cb46d93c0638034e6df424.tar.gz
LTO llvm11 (#302)
* new LTO mode for llvm 11

* remove unneeded afl-ld and env vars
Diffstat (limited to 'llvm_mode/afl-llvm-lto-instrumentation.so.cc')
-rw-r--r--llvm_mode/afl-llvm-lto-instrumentation.so.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm_mode/afl-llvm-lto-instrumentation.so.cc b/llvm_mode/afl-llvm-lto-instrumentation.so.cc
index 4bc16f17..2a9b17b2 100644
--- a/llvm_mode/afl-llvm-lto-instrumentation.so.cc
+++ b/llvm_mode/afl-llvm-lto-instrumentation.so.cc
@@ -378,7 +378,8 @@ bool AFLLTOPass::runOnModule(Module &M) {
         M, Int32Ty, true, GlobalValue::ExternalLinkage, 0, "__afl_final_loc", 0,
         GlobalVariable::GeneralDynamicTLSModel, 0, false);
     ConstantInt *const_loc = ConstantInt::get(Int32Ty, afl_global_id);
-    AFLFinalLoc->setAlignment(4);
+    MaybeAlign   Align = MaybeAlign(4);
+    AFLFinalLoc->setAlignment(Align);
     AFLFinalLoc->setInitializer(const_loc);
 
   }
@@ -423,5 +424,5 @@ static RegisterPass<AFLLTOPass> X("afl-lto", "afl++ LTO instrumentation pass",
                                   false, false);
 
 static RegisterStandardPasses RegisterAFLLTOPass(
-    PassManagerBuilder::EP_OptimizerLast, registerAFLLTOPass);
+    PassManagerBuilder::EP_FullLinkTimeOptimizationLast, registerAFLLTOPass);