Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openmp: fix cross compile #197674

Merged
merged 1 commit into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/10/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, libxml2, python3, isl, fetchurl, 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.
Expand Down Expand Up @@ -259,7 +260,7 @@ let
};

openmp = callPackage ./openmp {
inherit llvm_meta;
inherit llvm_meta targetLlvm;
};
});

Expand Down
5 changes: 4 additions & 1 deletion pkgs/development/compilers/llvm/10/openmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, fetch
, cmake
, llvm
, targetLlvm
, perl
, version
}:
Expand All @@ -15,7 +16,9 @@ stdenv.mkDerivation rec {
src = fetch pname "0i4bn84lkpm5w3qkpvwm5z6jdj8fynp7d3bcasa1xyq4is6757yi";

nativeBuildInputs = [ cmake perl ];
buildInputs = [ llvm ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Commenting only on this one particular instance, but obviously applies to all.)

When buildPlatform == hostPlatform is there a meaningful difference between llvm and targetLlvm? In other words, could we always use targetLlvm here?

If this is done only to avoid rebuilds, I'd personally prefer rebuilds to long term code complexity / "technical debt".

Copy link
Member Author

@squalus squalus Oct 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's why: if I simply use targetLlvm, then pkgsCross.aarch64-multiplatform.buildPackages.llvmPackages_14.openmp will result in a failed build. The "build" version of the llvm libraries is included instead of the expected "host" version. I admit I'm not sure why this is the case. There may be a better way to model this.

];

meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/11/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, libxml2, python3, isl, fetchurl, 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.
Expand Down Expand Up @@ -274,7 +275,7 @@ let
};

openmp = callPackage ./openmp {
inherit llvm_meta;
inherit llvm_meta targetLlvm;
};
});

Expand Down
5 changes: 4 additions & 1 deletion pkgs/development/compilers/llvm/11/openmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
, fetchpatch
, cmake
, llvm
, targetLlvm
, perl
, version
}:
Expand All @@ -25,7 +26,9 @@ stdenv.mkDerivation rec {
];

nativeBuildInputs = [ cmake perl ];
buildInputs = [ llvm ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];

meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/12/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, libxml2, python3, isl, fetchurl, 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.
Expand Down Expand Up @@ -267,7 +268,7 @@ let
};

openmp = callPackage ./openmp {
inherit llvm_meta;
inherit llvm_meta targetLlvm;
};
});

Expand Down
5 changes: 4 additions & 1 deletion pkgs/development/compilers/llvm/12/openmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, fetch
, cmake
, llvm
, targetLlvm
, perl
, version
}:
Expand All @@ -15,7 +16,9 @@ stdenv.mkDerivation rec {
src = fetch pname "14dh0r6h2xh747ffgnsl4z08h0ri04azi9vf79cbz7ma1r27kzk0";

nativeBuildInputs = [ cmake perl ];
buildInputs = [ llvm ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];

meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/13/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, libxml2, python3, isl, 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.
Expand Down Expand Up @@ -276,7 +277,7 @@ let
};

openmp = callPackage ./openmp {
inherit llvm_meta;
inherit llvm_meta targetLlvm;
};
});

Expand Down
5 changes: 4 additions & 1 deletion pkgs/development/compilers/llvm/13/openmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, src
, cmake
, llvm
, targetLlvm
, perl
, version
}:
Expand All @@ -16,7 +17,9 @@ stdenv.mkDerivation rec {
sourceRoot = "source/${pname}";

nativeBuildInputs = [ cmake perl ];
buildInputs = [ llvm ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];

cmakeFlags = [
"-DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=OFF" # Building the AMDGCN device RTL currently fails
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/14/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, libxml2, python3, isl, 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.
Expand Down Expand Up @@ -273,7 +274,7 @@ let
};

openmp = callPackage ./openmp {
inherit llvm_meta;
inherit llvm_meta targetLlvm;
};
});

Expand Down
5 changes: 4 additions & 1 deletion pkgs/development/compilers/llvm/14/openmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
, runCommand
, cmake
, llvm
, targetLlvm
, lit
, clang-unwrapped
, perl
Expand Down Expand Up @@ -32,7 +33,9 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" ];

nativeBuildInputs = [ cmake perl pkg-config lit ];
buildInputs = [ llvm ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];

# Unsup:Pass:XFail:Fail
# 26:267:16:8
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/5/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith
, buildLlvmTools # tools, but from the previous stage, for cross
, targetLlvmLibraries # libraries, but from the next stage, for cross
, targetLlvm
}:

let
Expand Down Expand Up @@ -121,7 +122,7 @@ let
};

openmp = callPackage ./openmp {
inherit llvm_meta;
inherit llvm_meta targetLlvm;
};
});

Expand Down
5 changes: 4 additions & 1 deletion pkgs/development/compilers/llvm/5/openmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, fetch
, cmake
, llvm
, targetLlvm
, perl
, version
}:
Expand All @@ -15,7 +16,9 @@ stdenv.mkDerivation {
src = fetch "openmp" "0p2n52676wlq6y9q99n5pivq6pvvda1p994r69fxj206ahn59jir";

nativeBuildInputs = [ cmake perl ];
buildInputs = [ llvm ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];

meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/6/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith
, buildLlvmTools # tools, but from the previous stage, for cross
, targetLlvmLibraries # libraries, but from the next stage, for cross
, targetLlvm
}:

let
Expand Down Expand Up @@ -122,7 +123,7 @@ let
};

openmp = callPackage ./openmp {
inherit llvm_meta;
inherit llvm_meta targetLlvm;
};
});

Expand Down
5 changes: 4 additions & 1 deletion pkgs/development/compilers/llvm/6/openmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, fetch
, cmake
, llvm
, targetLlvm
, perl
, version
}:
Expand All @@ -15,7 +16,9 @@ stdenv.mkDerivation {
src = fetch "openmp" "0nhwfba9c351r16zgyjyfwdayr98nairky3c2f0b2lc360mwmbv6";

nativeBuildInputs = [ cmake perl ];
buildInputs = [ llvm ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];

meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/7/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, libxml2, python3, isl, fetchurl, 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.
Expand Down Expand Up @@ -268,7 +269,7 @@ let
};

openmp = callPackage ./openmp {
inherit llvm_meta;
inherit llvm_meta targetLlvm;
};
});

Expand Down
5 changes: 4 additions & 1 deletion pkgs/development/compilers/llvm/7/openmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, fetch
, cmake
, llvm
, targetLlvm
, perl
, version
}:
Expand All @@ -15,7 +16,9 @@ stdenv.mkDerivation {
src = fetch "openmp" "1dg53wzsci2kra8lh1y0chh60h2l8h1by93br5spzvzlxshkmrqy";

nativeBuildInputs = [ cmake perl ];
buildInputs = [ llvm ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];

meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, libxml2, python3, isl, fetchurl, 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.
Expand Down Expand Up @@ -267,7 +268,7 @@ let
};

openmp = callPackage ./openmp {
inherit llvm_meta;
inherit llvm_meta targetLlvm;
};
});

Expand Down
5 changes: 4 additions & 1 deletion pkgs/development/compilers/llvm/8/openmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, fetch
, cmake
, llvm
, targetLlvm
, perl
, version
}:
Expand All @@ -15,7 +16,9 @@ stdenv.mkDerivation {
src = fetch "openmp" "0b3jlxhqbpyd1nqkpxjfggm5d9va5qpyf7d4i5y7n4a1mlydv19y";

nativeBuildInputs = [ cmake perl ];
buildInputs = [ llvm ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];

meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/9/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, libxml2, python3, isl, fetchurl, 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.
Expand Down Expand Up @@ -267,7 +268,7 @@ let
};

openmp = callPackage ./openmp {
inherit llvm_meta;
inherit llvm_meta targetLlvm;
};
});

Expand Down
5 changes: 4 additions & 1 deletion pkgs/development/compilers/llvm/9/openmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, fetch
, cmake
, llvm
, targetLlvm
, perl
, version
}:
Expand All @@ -15,7 +16,9 @@ stdenv.mkDerivation rec {
src = fetch pname "1knafnpp0f7hylx8q20lkd6g1sf0flly572dayc5d5kghh7hd52w";

nativeBuildInputs = [ cmake perl ];
buildInputs = [ llvm ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];

meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
Expand Down
Loading