llvm-polly,clang-polly: Add llvm/clang variants w/polly support (#55065)

* llvm: build w/polly in-tree, optionally

Don't enable by default yet, defer rebuilds.

* top-level: llvm-polly, clang-polly

* bit hacky re:overrides
* need to explicitly set cmake flags for clang to link in polly
This commit is contained in:
Will Dietz 2019-02-25 15:20:52 -06:00 committed by GitHub
parent 148e0f6de8
commit ed60483257
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 0 deletions

View file

@ -1,6 +1,7 @@
{ stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python
, fixDarwinDylibNames
, enableManpages ? false
, enablePolly ? false # TODO: get this info from llvm (passthru?)
}:
let
@ -30,6 +31,9 @@ let
"-DSPHINX_OUTPUT_MAN=ON"
"-DSPHINX_OUTPUT_HTML=OFF"
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
] ++ stdenv.lib.optionals enablePolly [
"-DWITH_POLLY=ON"
"-DLINK_POLLY_INTO_TOOLS=ON"
];
patches = [ ./purity.patch ];

View file

@ -29,10 +29,16 @@ let
in {
llvm = callPackage ./llvm.nix { };
llvm-polly = callPackage ./llvm.nix { enablePolly = true; };
clang-unwrapped = callPackage ./clang {
inherit clang-tools-extra_src;
};
clang-polly-unwrapped = callPackage ./clang {
inherit clang-tools-extra_src;
llvm = tools.llvm-polly;
enablePolly = true;
};
llvm-manpages = lowPrio (tools.llvm.override {
enableManpages = true;

View file

@ -16,12 +16,14 @@
, enableManpages ? false
, enableSharedLibraries ? true
, enablePFM ? !stdenv.isDarwin
, enablePolly ? false
}:
let
inherit (stdenv.lib) optional optionals optionalString;
src = fetch "llvm" "16s196wqzdw4pmri15hadzqgdi926zln3an2viwyq0kini6zr3d3";
polly_src = fetch "polly" "0wgvayfilgb530bq51l7szxfb13l24nnrmyji2f6ncq95a24dw8v";
# Used when creating a version-suffixed symlink of libLLVM.dylib
shortVersion = with stdenv.lib;
@ -34,6 +36,9 @@ in stdenv.mkDerivation (rec {
unpackFile ${src}
mv llvm-${version}* llvm
sourceRoot=$PWD/llvm
'' + optionalString enablePolly ''
unpackFile ${polly_src}
mv polly-* $sourceRoot/tools/polly
'';
outputs = [ "out" "python" ]

View file

@ -6684,6 +6684,8 @@ in
useMacosReexportHack = true;
};
};
llvm-polly = llvmPackages_7.llvm-polly;
clang-polly = clang_7.override { cc = llvmPackages_7.clang-polly-unwrapped; };
clang_7 = llvmPackages_7.clang;
clang_6 = llvmPackages_6.clang;