diff --git a/pkgs/development/compilers/llvm/20/llvm/orcjit.patch b/pkgs/development/compilers/llvm/20/llvm/orcjit.patch deleted file mode 100644 index c08e3f80d73b..000000000000 --- a/pkgs/development/compilers/llvm/20/llvm/orcjit.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 03d6f704d07aa3650a2f59be6f7802a8735460c3 Mon Sep 17 00:00:00 2001 -From: Lang Hames -Date: Wed, 29 Jan 2025 03:58:29 +0000 -Subject: [PATCH] [ORC][LLI] Remove redundant eh-frame registration plugin - construction from lli. - -As of d0052ebbe2e the setUpGenericLLVMIRPlatform function will automatically -add an instance of the EHFrameRegistrationPlugin (for LLJIT instances whose -object linking layers are ObjectLinkingLayers, not RTDyldObjectLinkingLayers). - -This commit removes the redundant plugin creation in the object linking -layer constructor function in lli.cpp to prevent duplicate registration of -eh-frames, which is likely the cause of recent bot failures, e.g. -https://lab.llvm.org/buildbot/#/builders/108/builds/8685. - -(cherry picked from commit 9052b37ab1aa67a039b34356f37236fecc42bac2) ---- - llvm/tools/lli/lli.cpp | 14 ++++---------- - 1 file changed, 4 insertions(+), 10 deletions(-) - -diff --git a/llvm/tools/lli/lli.cpp b/tools/lli/lli.cpp -index 448660a539a0b0..19246f03941673 100644 ---- a/llvm/tools/lli/lli.cpp -+++ b/tools/lli/lli.cpp -@@ -27,9 +27,7 @@ - #include "llvm/ExecutionEngine/Orc/AbsoluteSymbols.h" - #include "llvm/ExecutionEngine/Orc/DebugUtils.h" - #include "llvm/ExecutionEngine/Orc/Debugging/DebuggerSupport.h" --#include "llvm/ExecutionEngine/Orc/EHFrameRegistrationPlugin.h" - #include "llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h" --#include "llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h" - #include "llvm/ExecutionEngine/Orc/EPCGenericRTDyldMemoryManager.h" - #include "llvm/ExecutionEngine/Orc/ExecutionUtils.h" - #include "llvm/ExecutionEngine/Orc/IRPartitionLayer.h" -@@ -1033,14 +1031,10 @@ int runOrcJIT(const char *ProgName) { - Builder.getJITTargetMachineBuilder() - ->setRelocationModel(Reloc::PIC_) - .setCodeModel(CodeModel::Small); -- Builder.setObjectLinkingLayerCreator([&P](orc::ExecutionSession &ES, -- const Triple &TT) { -- auto L = std::make_unique(ES); -- if (P != LLJITPlatform::ExecutorNative) -- L->addPlugin(std::make_unique( -- ES, ExitOnErr(orc::EPCEHFrameRegistrar::Create(ES)))); -- return L; -- }); -+ Builder.setObjectLinkingLayerCreator( -+ [&](orc::ExecutionSession &ES, const Triple &TT) { -+ return std::make_unique(ES); -+ }); - } - - auto J = ExitOnErr(Builder.create()); diff --git a/pkgs/development/compilers/llvm/common/default.nix b/pkgs/development/compilers/llvm/common/default.nix index 3b657ce5bb3f..116d7c6406e4 100644 --- a/pkgs/development/compilers/llvm/common/default.nix +++ b/pkgs/development/compilers/llvm/common/default.nix @@ -501,10 +501,16 @@ let }) ] ++ - lib.optional (lib.versions.major metadata.release_version == "20") - # Fix OrcJIT - # PR: https://github.com/llvm/llvm-project/pull/125431 - (metadata.getVersionFile "llvm/orcjit.patch"); + lib.optional (lib.versionAtLeast metadata.release_version "20") + # Fix OrcJIT tests with page sizes > 16k + # PR: https://github.com/llvm/llvm-project/pull/127115 + ( + fetchpatch { + url = "https://github.com/llvm/llvm-project/commit/415607e10b56d0e6c4661ff1ec5b9b46bf433cba.patch"; + stripLen = 1; + hash = "sha256-vBbuduJB+NnNE9qtR93k64XKrwvc7w3vowjL/aT+iEA="; + } + ); pollyPatches = [ (metadata.getVersionFile "llvm/gnu-install-dirs-polly.patch") ] ++ lib.optional (lib.versionAtLeast metadata.release_version "15") diff --git a/pkgs/development/compilers/llvm/common/libc/default.nix b/pkgs/development/compilers/llvm/common/libc/default.nix index 900c884c72b4..f57239b7a978 100644 --- a/pkgs/development/compilers/llvm/common/libc/default.nix +++ b/pkgs/development/compilers/llvm/common/libc/default.nix @@ -14,7 +14,6 @@ ninja, isFullBuild ? true, linuxHeaders, - fetchpatch, }: let pname = "libc"; @@ -28,26 +27,12 @@ let ''); in stdenv.mkDerivation (finalAttrs: { - inherit pname version; + inherit pname version patches; src = src'; sourceRoot = "${finalAttrs.src.name}/runtimes"; - patches = - lib.optional (lib.versions.major version == "20") - # Removes invalid token from the LLVM version being placed in the namespace. - # Can be removed when LLVM 20 bumps to rc2. - # PR: https://github.com/llvm/llvm-project/pull/126284 - ( - fetchpatch { - url = "https://github.com/llvm/llvm-project/commit/3a3a3230d171e11842a9940b6da0f72022b1c5b3.patch"; - stripLen = 1; - hash = "sha256-QiU1cWp+027ZZNVdvfGVwbIoRd9jqtSbftGsmaW1gig="; - } - ) - ++ patches; - nativeBuildInputs = [ cmake diff --git a/pkgs/development/compilers/llvm/default.nix b/pkgs/development/compilers/llvm/default.nix index f2ac815b4b2c..68730c5c96d9 100644 --- a/pkgs/development/compilers/llvm/default.nix +++ b/pkgs/development/compilers/llvm/default.nix @@ -30,7 +30,7 @@ let "17.0.6".officialRelease.sha256 = "sha256-8MEDLLhocshmxoEBRSKlJ/GzJ8nfuzQ8qn0X/vLA+ag="; "18.1.8".officialRelease.sha256 = "sha256-iiZKMRo/WxJaBXct9GdAcAT3cz9d9pnAcO1mmR6oPNE="; "19.1.7".officialRelease.sha256 = "sha256-cZAB5vZjeTsXt9QHbP5xluWNQnAHByHtHnAhVDV0E6I="; - "20.1.0-rc1".officialRelease.sha256 = "sha256-yOczbperlR20+iLoao9g0CR+Ml2mjTCx1cqP/9WOhME="; + "20.1.0-rc2".officialRelease.sha256 = "sha256-lBx+MWfYBM6XSJozacALMGlo0DUUWqnsBQyO8lDljSo="; "21.0.0-git".gitRelease = { rev = "c9f1d2cbf18990311ea1287cc154e3784a10a3b0"; rev-version = "21.0.0-unstable-2025-02-10";