From 46e7a566f1897468d86133db8d3d021e0c9a3f5e Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 18 Aug 2018 23:01:50 -0400 Subject: [PATCH 1/2] update AArch64 code model patch for 6.0.1 --- deps/llvm.mk | 4 ++ ...lvm-D27629-AArch64-large_model_6.0.1.patch | 53 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 deps/patches/llvm-D27629-AArch64-large_model_6.0.1.patch diff --git a/deps/llvm.mk b/deps/llvm.mk index ec584b39e357c..e3c9f6c5823a1 100644 --- a/deps/llvm.mk +++ b/deps/llvm.mk @@ -385,7 +385,11 @@ LLVM_PATCH_PREV := $$(LLVM_SRC_DIR)/$1.patch-applied endef ifeq ($(LLVM_VER_SHORT),6.0) +ifeq ($(LLVM_VER_PATCH), 0) $(eval $(call LLVM_PATCH,llvm-D27629-AArch64-large_model_4.0)) +else +$(eval $(call LLVM_PATCH,llvm-D27629-AArch64-large_model_6.0.1)) +endif $(eval $(call LLVM_PATCH,llvm-D34078-vectorize-fdiv)) $(eval $(call LLVM_PATCH,llvm-6.0-NVPTX-addrspaces)) # NVPTX $(eval $(call LLVM_PATCH,llvm-D42262-jumpthreading-not-i1)) # remove for 7.0 diff --git a/deps/patches/llvm-D27629-AArch64-large_model_6.0.1.patch b/deps/patches/llvm-D27629-AArch64-large_model_6.0.1.patch new file mode 100644 index 0000000000000..89beefdd157e5 --- /dev/null +++ b/deps/patches/llvm-D27629-AArch64-large_model_6.0.1.patch @@ -0,0 +1,53 @@ +From f76abe65e6d07fea5e838c4f8c9a9421c16debb0 Mon Sep 17 00:00:00 2001 +From: Valentin Churavy +Date: Thu, 5 Jul 2018 12:37:50 -0400 +Subject: [PATCH] Fix unwind info relocation with large code model on AArch64 + +--- + lib/MC/MCObjectFileInfo.cpp | 2 ++ + .../AArch64/ELF_ARM64_large-relocations.s | 20 +++++++++++++++++++ + 2 files changed, 22 insertions(+) + create mode 100644 test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_large-relocations.s + +diff --git a/lib/MC/MCObjectFileInfo.cpp b/lib/MC/MCObjectFileInfo.cpp +index 328f000f37c..938b35f20d1 100644 +--- a/lib/MC/MCObjectFileInfo.cpp ++++ b/lib/MC/MCObjectFileInfo.cpp +@@ -291,6 +291,8 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T, bool Large) { + break; + case Triple::ppc64: + case Triple::ppc64le: ++ case Triple::aarch64: ++ case Triple::aarch64_be: + case Triple::x86_64: + FDECFIEncoding = dwarf::DW_EH_PE_pcrel | + (Large ? dwarf::DW_EH_PE_sdata8 : dwarf::DW_EH_PE_sdata4); +diff --git a/test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_large-relocations.s b/test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_large-relocations.s +new file mode 100644 +index 00000000000..66f28dabd79 +--- /dev/null ++++ b/test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_large-relocations.s +@@ -0,0 +1,20 @@ ++# RUN: llvm-mc -triple=arm64-none-linux-gnu -large-code-model -filetype=obj -o %T/large-reloc.o %s ++# RUN: llvm-rtdyld -triple=arm64-none-linux-gnu -verify -map-section large-reloc.o,.eh_frame=0x10000 -map-section large-reloc.o,.text=0xffff000000000000 -check=%s %T/large-reloc.o ++# RUN-BE: llvm-mc -triple=aarch64_be-none-linux-gnu -large-code-model -filetype=obj -o %T/be-large-reloc.o %s ++# RUN-BE: llvm-rtdyld -triple=aarch64_be-none-linux-gnu -verify -map-section be-large-reloc.o,.eh_frame=0x10000 -map-section be-large-reloc.o,.text=0xffff000000000000 -check=%s %T/be-large-reloc.o ++ ++ .text ++ .globl g ++ .p2align 2 ++ .type g,@function ++g: ++ .cfi_startproc ++ mov x0, xzr ++ ret ++ .Lfunc_end0: ++ .size g, .Lfunc_end0-g ++ .cfi_endproc ++ ++# Skip the CIE and load the 8 bytes PC begin pointer. ++# Assuming the CIE and the FDE length are both 4 bytes. ++# rtdyld-check: *{8}(section_addr(large-reloc.o, .eh_frame) + (*{4}(section_addr(large-reloc.o, .eh_frame))) + 0xc) = g - (section_addr(large-reloc.o, .eh_frame) + (*{4}(section_addr(large-reloc.o, .eh_frame))) + 0xc) +-- +2.18.0 + From 8ba726e44e1739f3cd16677f685ef4d298d4dc28 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 18 Aug 2018 17:53:07 -0400 Subject: [PATCH 2/2] upgrade to LLVM 6.0.1 --- deps/Versions.make | 4 ++-- deps/checksums/llvm-6.0.0.src.tar.xz/md5 | 1 - deps/checksums/llvm-6.0.0.src.tar.xz/sha512 | 1 - deps/checksums/llvm-6.0.1.src.tar.xz/md5 | 1 + deps/checksums/llvm-6.0.1.src.tar.xz/sha512 | 1 + 5 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 deps/checksums/llvm-6.0.0.src.tar.xz/md5 delete mode 100644 deps/checksums/llvm-6.0.0.src.tar.xz/sha512 create mode 100644 deps/checksums/llvm-6.0.1.src.tar.xz/md5 create mode 100644 deps/checksums/llvm-6.0.1.src.tar.xz/sha512 diff --git a/deps/Versions.make b/deps/Versions.make index fa58087b065f7..f40fd4d84c8f8 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -1,5 +1,5 @@ -LLVM_VER = 6.0.0 -LLVM_BB_REL = 6 +LLVM_VER = 6.0.1 +LLVM_BB_REL = 1 PCRE_VER = 10.30 DSFMT_VER = 2.2.3 LAPACK_VER = 3.5.0 diff --git a/deps/checksums/llvm-6.0.0.src.tar.xz/md5 b/deps/checksums/llvm-6.0.0.src.tar.xz/md5 deleted file mode 100644 index f2f552adb296b..0000000000000 --- a/deps/checksums/llvm-6.0.0.src.tar.xz/md5 +++ /dev/null @@ -1 +0,0 @@ -788a11a35fa62eb008019b37187d09d2 diff --git a/deps/checksums/llvm-6.0.0.src.tar.xz/sha512 b/deps/checksums/llvm-6.0.0.src.tar.xz/sha512 deleted file mode 100644 index 5d40c04e3e347..0000000000000 --- a/deps/checksums/llvm-6.0.0.src.tar.xz/sha512 +++ /dev/null @@ -1 +0,0 @@ -a71fdd5ddc46f01327ad891cfcc198febdbe10769c57f14d8a4fb7d514621ee4080e1a641200d3353c16a16731d390270499ec6cd3dc98fadc570f3eb6b52b8c diff --git a/deps/checksums/llvm-6.0.1.src.tar.xz/md5 b/deps/checksums/llvm-6.0.1.src.tar.xz/md5 new file mode 100644 index 0000000000000..0c7151e84b867 --- /dev/null +++ b/deps/checksums/llvm-6.0.1.src.tar.xz/md5 @@ -0,0 +1 @@ +c88c98709300ce2c285391f387fecce0 diff --git a/deps/checksums/llvm-6.0.1.src.tar.xz/sha512 b/deps/checksums/llvm-6.0.1.src.tar.xz/sha512 new file mode 100644 index 0000000000000..2e0ff6e648c08 --- /dev/null +++ b/deps/checksums/llvm-6.0.1.src.tar.xz/sha512 @@ -0,0 +1 @@ +cbbb00eb99cfeb4aff623ee1a5ba075e7b5a76fc00c5f9f539ff28c108598f5708a0369d5bd92683def5a20c2fe60cab7827b42d628dbfcc79b57e0e91b84dd9