obfuscator-llvm / obfuscator

3.89k stars 1.17k forks source link

Compilations error fix #178

Open Lexterl33t opened 8 months ago

Lexterl33t commented 8 months ago

As I've seen a number of problems with compilations recently, I've come up with a solution that works for me.

examples of patches I've made to the llvm version

Patch 1:

diff --git a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
index 8647db56c..4a631e00b 100755
--- a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
+++ b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
@@ -687,7 +687,7 @@ private:

   uint32_t getTrampolineSize() const { return RemoteTrampolineSize; }

-  Expected<std::vector<char>> readMem(char *Dst, JITTargetAddress Src,
+  Expected<std::vector<unsigned char>> readMem(char *Dst, JITTargetAddress Src,
                                       uint64_t Size) {
     // Check for an 'out-of-band' error, e.g. from an MM destructor.
     if (ExistingError)

Patch 2:

diff --git a/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index 402521713..40a73ef74 100755
--- a/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -6271,7 +6271,7 @@ void CGOpenMPRuntime::emitTargetDataCalls(
   // Generate the code for the opening of the data environment. Capture all the
   // arguments of the runtime call by reference because they are used in the
   // closing of the region.
-  auto &&BeginThenGen = [&D, &CGF, Device, &Info, &CodeGen, &NoPrivAction](
+  auto &&BeginThenGen = [&D, Device, &Info, &CodeGen, &NoPrivAction](
       CodeGenFunction &CGF, PrePostActionTy &) {
     // Fill up the arrays with all the mapped variables.
     MappableExprsHandler::MapBaseValuesArrayTy BasePointers;
@@ -6318,7 +6318,7 @@ void CGOpenMPRuntime::emitTargetDataCalls(
   };

   // Generate code for the closing of the data region.
-  auto &&EndThenGen = [&CGF, Device, &Info](CodeGenFunction &CGF,
+  auto &&EndThenGen = [Device, &Info](CodeGenFunction &CGF,
                                             PrePostActionTy &) {
     assert(Info.isValid() && "Invalid data environment closing arguments.");

@@ -6397,7 +6397,7 @@ void CGOpenMPRuntime::emitTargetDataStandAloneCall(
          "Expecting either target enter, exit data, or update directives.");

   // Generate the code for the opening of the data environment.
-  auto &&ThenGen = [&D, &CGF, Device](CodeGenFunction &CGF, PrePostActionTy &) {
+  auto &&ThenGen = [&D, Device](CodeGenFunction &CGF, PrePostActionTy &) {
     // Fill up the arrays with all the mapped variables.
     MappableExprsHandler::MapBaseValuesArrayTy BasePointers;
     MappableExprsHandler::MapValuesArrayTy Pointers;

Patch 3:

diff --git a/tools/llvm-xray/xray-extract.cc b/tools/llvm-xray/xray-extract.cc
index ecd535114..2f39dd048 100755
--- a/tools/llvm-xray/xray-extract.cc
+++ b/tools/llvm-xray/xray-extract.cc
@@ -15,6 +15,7 @@

 #include <type_traits>
 #include <utility>
+#include <stdint.h>

 #include "xray-extract.h"

diff --git a/tools/llvm-xray/xray-extract.h b/tools/llvm-xray/xray-extract.h
index 91e4db368..9191f9ff2 100755
--- a/tools/llvm-xray/xray-extract.h
+++ b/tools/llvm-xray/xray-extract.h
@@ -19,6 +19,7 @@
 #include <map>
 #include <string>
 #include <unordered_map>
+#include <stdint.h>

 #include "xray-sleds.h"
 #include "llvm/Support/Error.h"
TRIKKSS commented 8 months ago

it works for me thank you !