diff --git a/ports/llvm-15/0024-remove-elf_relocation-checks.patch b/ports/llvm-15/0024-remove-elf_relocation-checks.patch deleted file mode 100644 index 204f34dd..00000000 --- a/ports/llvm-15/0024-remove-elf_relocation-checks.patch +++ /dev/null @@ -1,119 +0,0 @@ -diff --git a/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h b/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h -index c434b45077a3..a4ccfd28fa65 100644 ---- a/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h -+++ b/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h -@@ -57,6 +57,10 @@ class RuntimeDyldImpl; - - class RuntimeDyld { - public: -+ -+ // Should there be a hard failure on a relocation or just soft failure? -+ static bool ShouldFailOnRelocationErrors; -+ - // Change the address associated with a section when resolving relocations. - // Any relocations already associated with the symbol will be re-resolved. - void reassignSectionAddress(unsigned SectionID, uint64_t Addr); -diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp -index 3f38d26869d4..ccf0d531f0d5 100644 ---- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp -+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp -@@ -1479,4 +1479,6 @@ void jitLinkForORC( - std::move(O), std::move(Info)); - } - -+bool RuntimeDyld::ShouldFailOnRelocationErrors = true; -+ - } // end namespace llvm -diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp -index f92618afdff6..777efb3445e5 100644 ---- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp -+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp -@@ -21,6 +21,7 @@ - #include "llvm/Object/ObjectFile.h" - #include "llvm/Support/Endian.h" - #include "llvm/Support/MemoryBuffer.h" -+#include "llvm/Support/raw_ostream.h" - - using namespace llvm; - using namespace llvm::object; -@@ -28,6 +29,17 @@ using namespace llvm::support::endian; - - #define DEBUG_TYPE "dyld" - -+static void report_reallocation_error(uint32_t ty) { -+ std::string message; -+ llvm::raw_string_ostream ss(message); -+ ss << "Relocation type not implemented yet: " << ty << "!\n"; -+ if (RuntimeDyld::ShouldFailOnRelocationErrors) { -+ report_fatal_error(message.c_str()); -+ } else { -+ dbgs() << message; -+ } -+} -+ - static void or32le(void *P, int32_t V) { write32le(P, read32le(P) | V); } - - static void or32AArch64Imm(void *L, uint64_t Imm) { -@@ -262,7 +274,7 @@ void RuntimeDyldELF::resolveX86_64Relocation(const SectionEntry &Section, - uint64_t SymOffset) { - switch (Type) { - default: -- report_fatal_error("Relocation type not implemented yet!"); -+ report_reallocation_error(Type); - break; - case ELF::R_X86_64_NONE: - break; -@@ -397,7 +409,7 @@ void RuntimeDyldELF::resolveX86Relocation(const SectionEntry &Section, - default: - // There are other relocation types, but it appears these are the - // only ones currently used by the LLVM ELF object writer -- report_fatal_error("Relocation type not implemented yet!"); -+ report_reallocation_error(Type); - break; - } - } -@@ -420,7 +432,7 @@ void RuntimeDyldELF::resolveAArch64Relocation(const SectionEntry &Section, - - switch (Type) { - default: -- report_fatal_error("Relocation type not implemented yet!"); -+ report_reallocation_error(Type); - break; - case ELF::R_AARCH64_NONE: - break; -@@ -807,7 +819,7 @@ void RuntimeDyldELF::resolvePPC32Relocation(const SectionEntry &Section, - uint8_t *LocalAddress = Section.getAddressWithOffset(Offset); - switch (Type) { - default: -- report_fatal_error("Relocation type not implemented yet!"); -+ report_reallocation_error(Type); - break; - case ELF::R_PPC_ADDR16_LO: - writeInt16BE(LocalAddress, applyPPClo(Value + Addend)); -@@ -827,7 +839,7 @@ void RuntimeDyldELF::resolvePPC64Relocation(const SectionEntry &Section, - uint8_t *LocalAddress = Section.getAddressWithOffset(Offset); - switch (Type) { - default: -- report_fatal_error("Relocation type not implemented yet!"); -+ report_reallocation_error(Type); - break; - case ELF::R_PPC64_ADDR16: - writeInt16BE(LocalAddress, applyPPClo(Value + Addend)); -@@ -921,7 +933,7 @@ void RuntimeDyldELF::resolveSystemZRelocation(const SectionEntry &Section, - uint8_t *LocalAddress = Section.getAddressWithOffset(Offset); - switch (Type) { - default: -- report_fatal_error("Relocation type not implemented yet!"); -+ report_reallocation_error(Type); - break; - case ELF::R_390_PC16DBL: - case ELF::R_390_PLT16DBL: { -@@ -976,7 +988,7 @@ void RuntimeDyldELF::resolveBPFRelocation(const SectionEntry &Section, - - switch (Type) { - default: -- report_fatal_error("Relocation type not implemented yet!"); -+ report_reallocation_error(Type); - break; - case ELF::R_BPF_NONE: - case ELF::R_BPF_64_64: diff --git a/ports/llvm-15/portfile.cmake b/ports/llvm-15/portfile.cmake index e9380842..df9dd12b 100644 --- a/ports/llvm-15/portfile.cmake +++ b/ports/llvm-15/portfile.cmake @@ -19,7 +19,6 @@ vcpkg_from_github( 0020-fix-FindZ3.cmake.patch 0021-fix-find_dependency.patch 0023-clang-sys-include-dir-path.patch - 0024-remove-elf_relocation-checks.patch 0026-fix-prefix-path-calc.patch ) diff --git a/ports/llvm-15/vcpkg.json b/ports/llvm-15/vcpkg.json index 6d56efe6..b321f1d3 100644 --- a/ports/llvm-15/vcpkg.json +++ b/ports/llvm-15/vcpkg.json @@ -1,7 +1,7 @@ { "name": "llvm-15", "version": "15.0.6", - "port-version": 1, + "port-version": 2, "description": "The LLVM Compiler Infrastructure.", "homepage": "https://llvm.org", "license": "Apache-2.0",