From 61b348f0c6b934ff944c684277c351ba3aa23bb7 Mon Sep 17 00:00:00 2001 From: Rahul Butani Date: Fri, 24 Mar 2023 09:01:36 -0500 Subject: [PATCH] llvmPackages_git.openmp: apply #197674 (fix cross compile) this was backported to `llvmPackages_15` in 81ef82a029dfe2b67bf4fd306725ed3e3ed42a2c --- pkgs/development/compilers/llvm/git/default.nix | 3 ++- pkgs/development/compilers/llvm/git/openmp/default.nix | 5 ++++- pkgs/top-level/aliases.nix | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/llvm/git/default.nix b/pkgs/development/compilers/llvm/git/default.nix index 27fdea9d4553e7e..937a845a3a5fe4d 100644 --- a/pkgs/development/compilers/llvm/git/default.nix +++ b/pkgs/development/compilers/llvm/git/default.nix @@ -3,6 +3,7 @@ , libxml2, python3, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross +, targetLlvm # This is the default binutils, but with *this* version of LLD rather # than the default LLVM verion's, if LLD is the choice. We use these for # the `useLLVM` bootstrapping below. @@ -296,7 +297,7 @@ let }; openmp = callPackage ./openmp { - inherit llvm_meta; + inherit llvm_meta targetLlvm; }; }); diff --git a/pkgs/development/compilers/llvm/git/openmp/default.nix b/pkgs/development/compilers/llvm/git/openmp/default.nix index f22101e9cade9aa..52aeb4bd9800f8f 100644 --- a/pkgs/development/compilers/llvm/git/openmp/default.nix +++ b/pkgs/development/compilers/llvm/git/openmp/default.nix @@ -6,6 +6,7 @@ , cmake , ninja , llvm +, targetLlvm , lit , clang-unwrapped , perl @@ -34,7 +35,9 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; nativeBuildInputs = [ cmake ninja perl pkg-config lit ]; - buildInputs = [ llvm ]; + buildInputs = [ + (if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm) + ]; # Unsup:Pass:XFail:Fail # 26:267:16:8 diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 0c927419f42e4a6..6baf171153c47f0 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1847,6 +1847,7 @@ mapAliases ({ inherit (stdenvAdapters) overrideCC; buildLlvmTools = buildPackages.llvmPackages_git.tools; targetLlvmLibraries = targetPackages.llvmPackages_git.libraries or llvmPackages_git.libraries; + targetLlvm = targetPackages.llvmPackages_git.llvm or llvmPackages_git.llvm; }); # Added 2022-01-28