From 5eef01621942931f3d97fb01084ed663c2b1b85f Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Tue, 25 Apr 2023 13:18:53 +0100 Subject: [PATCH] Add fix for llvm/llvm-project#61402 This addresses an issue that is triggered by Numba 0.57 - see https://github.com/numba/numba/issues/8738 Cherry-Picked-By: H. Vetinari --- recipe/meta.yaml | 1 + ...-pass-through-QEMU_LD_PREFIX-SDKROOT.patch | 2 +- .../patches/0002-Always-copy-on-windows.patch | 2 +- ...-vectorizer-and-extends-SVML-support.patch | 2 +- ...imeDyldELF-Clear-GOTOffsetMap-when-r.patch | 31 +++++++++++++++++++ 5 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 recipe/patches/0004-RuntimeDyld-RuntimeDyldELF-Clear-GOTOffsetMap-when-r.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 78764e10..f022e6b0 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -13,6 +13,7 @@ source: - patches/0001-pass-through-QEMU_LD_PREFIX-SDKROOT.patch - patches/0002-Always-copy-on-windows.patch - patches/0003-Fixes-vectorizer-and-extends-SVML-support.patch + - patches/0004-RuntimeDyld-RuntimeDyldELF-Clear-GOTOffsetMap-when-r.patch build: number: 2 diff --git a/recipe/patches/0001-pass-through-QEMU_LD_PREFIX-SDKROOT.patch b/recipe/patches/0001-pass-through-QEMU_LD_PREFIX-SDKROOT.patch index d05bc5e5..6c10955c 100644 --- a/recipe/patches/0001-pass-through-QEMU_LD_PREFIX-SDKROOT.patch +++ b/recipe/patches/0001-pass-through-QEMU_LD_PREFIX-SDKROOT.patch @@ -1,7 +1,7 @@ From e1ad26b0a967a41b000373af7c25b5ab62b87d4d Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 4 Aug 2020 21:06:30 -0500 -Subject: [PATCH 1/3] pass through QEMU_LD_PREFIX & SDKROOT +Subject: [PATCH 1/4] pass through QEMU_LD_PREFIX & SDKROOT --- llvm/utils/lit/lit/TestingConfig.py | 2 +- diff --git a/recipe/patches/0002-Always-copy-on-windows.patch b/recipe/patches/0002-Always-copy-on-windows.patch index 286d4938..5c4b3d21 100644 --- a/recipe/patches/0002-Always-copy-on-windows.patch +++ b/recipe/patches/0002-Always-copy-on-windows.patch @@ -1,7 +1,7 @@ From 3369987c6c4d085692e9a8de8df3e689ba0b453a Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 8 Nov 2022 13:34:20 -0600 -Subject: [PATCH 2/3] Always copy on windows +Subject: [PATCH 2/4] Always copy on windows The conda package build machine may have permissions to create symlinks, but conda doesn't handle symlinks on windows diff --git a/recipe/patches/0003-Fixes-vectorizer-and-extends-SVML-support.patch b/recipe/patches/0003-Fixes-vectorizer-and-extends-SVML-support.patch index 3338153f..dd8f38cd 100644 --- a/recipe/patches/0003-Fixes-vectorizer-and-extends-SVML-support.patch +++ b/recipe/patches/0003-Fixes-vectorizer-and-extends-SVML-support.patch @@ -1,7 +1,7 @@ From be23454d9f55ad069d65aaf9d94c8816a544c5a0 Mon Sep 17 00:00:00 2001 From: Ivan Butygin Date: Sun, 24 Jul 2022 20:31:29 +0200 -Subject: [PATCH 3/3] Fixes vectorizer and extends SVML support +Subject: [PATCH 3/4] Fixes vectorizer and extends SVML support Patch was updated to fix SVML calling convention issues uncovered by llvm 10. In previous versions of patch SVML calling convention was selected based on diff --git a/recipe/patches/0004-RuntimeDyld-RuntimeDyldELF-Clear-GOTOffsetMap-when-r.patch b/recipe/patches/0004-RuntimeDyld-RuntimeDyldELF-Clear-GOTOffsetMap-when-r.patch new file mode 100644 index 00000000..160c8418 --- /dev/null +++ b/recipe/patches/0004-RuntimeDyld-RuntimeDyldELF-Clear-GOTOffsetMap-when-r.patch @@ -0,0 +1,31 @@ +From 76ff6a6c9851c3ad20dc427d4b2eb684edf3c828 Mon Sep 17 00:00:00 2001 +From: Graham Markall +Date: Mon, 3 Apr 2023 11:15:36 -0700 +Subject: [PATCH 4/4] [RuntimeDyld] RuntimeDyldELF: Clear GOTOffsetMap when + resetting GOT section. + +When the GOT section ID is reset, the GOTOffsetMap must also be cleared, +otherwise spurious matches can be located when handling GOT relocations +in subsequently-linked objects. + +Fixes Issue #61402 - see https://github.com/llvm/llvm-project/issues/61402. + +Reviewed By: lhames + +Differential Revision: https://reviews.llvm.org/D146938 +--- + llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp +index f92618afdf..eb3c27a940 100644 +--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp ++++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp +@@ -2345,6 +2345,7 @@ Error RuntimeDyldELF::finalizeLoad(const ObjectFile &Obj, + } + } + ++ GOTOffsetMap.clear(); + GOTSectionID = 0; + CurrentGOTIndex = 0; +