mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-12-05 20:30:12 +00:00
llvmPackages.flang: fix build
Fix the build by only applying the use-xflang-in-diagnostics patch on llvm <= 22
This commit is contained in:
@@ -488,16 +488,13 @@ makeScopeWithSplicing' {
|
||||
# are only needed up to LLVM 21 because upstream merged equivalent
|
||||
# behaviour into LLVM 22.
|
||||
flangDriverPatches =
|
||||
lib.optionals (lib.versionAtLeast metadata.release_version "20") [
|
||||
(metadata.getVersionFile "flang/use-xflang-in-diagnostics.patch")
|
||||
]
|
||||
++
|
||||
lib.optionals
|
||||
(lib.versionAtLeast metadata.release_version "20" && lib.versionOlder metadata.release_version "22")
|
||||
[
|
||||
(metadata.getVersionFile "flang/warn-on-fbuiltin-and-fno-builtin.patch")
|
||||
(metadata.getVersionFile "flang/accept-and-ignore-some-gfortran-optimization-flags.patch")
|
||||
];
|
||||
lib.optionals
|
||||
(lib.versionAtLeast metadata.release_version "20" && lib.versionOlder metadata.release_version "22")
|
||||
[
|
||||
(metadata.getVersionFile "flang/warn-on-fbuiltin-and-fno-builtin.patch")
|
||||
(metadata.getVersionFile "flang/accept-and-ignore-some-gfortran-optimization-flags.patch")
|
||||
(metadata.getVersionFile "flang/use-xflang-in-diagnostics.patch")
|
||||
];
|
||||
flangLibclang =
|
||||
if flangDriverPatches == [ ] then
|
||||
self.libclang
|
||||
|
||||
@@ -43,6 +43,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
cp -r ${monorepoSrc}/llvm/utils "$out/llvm"
|
||||
cp -r ${monorepoSrc}/third-party "$out"
|
||||
|
||||
mkdir -p "$out/libc"
|
||||
cp -r ${monorepoSrc}/libc/shared "$out/libc"
|
||||
|
||||
cp -r ${monorepoSrc}/${finalAttrs.pname} "$out"
|
||||
cp -r ${monorepoSrc}/flang "$out"
|
||||
cp -r ${monorepoSrc}/runtimes "$out"
|
||||
|
||||
@@ -247,6 +247,7 @@
|
||||
"flang/use-xflang-in-diagnostics.patch" = [
|
||||
{
|
||||
after = "20";
|
||||
before = "22";
|
||||
path = ../21;
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user