From d51340f27f2e411a18e9fe775bc9e3150244c4e3 Mon Sep 17 00:00:00 2001 From: William Roe Date: Sun, 2 Aug 2020 16:20:42 +0100 Subject: [PATCH] zig: fix build It looks like https://github.com/NixOS/nixpkgs/pull/88248 broke the build for zig. The error you get when building zig on the current master branch is: ``` Scanning dependencies of target zig_build_libstage2 : CommandLine Error: Option 'polly' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options make[2]: *** [CMakeFiles/zig_build_libstage2.dir/build.make:77: CMakeFiles/zig_build_libstage2] Error 1 make[1]: *** [CMakeFiles/Makefile2:252: CMakeFiles/zig_build_libstage2.dir/all] Error 2 make: *** [Makefile:150: all] Error 2 ``` The patch that added polly into some build args was likely necessary only for LLVM 10.0.0 and when that was updated to 10.0.1 it stopped working or became unnecessary. With this patch removed, zig builds fine and passes the tests. --- pkgs/development/compilers/zig/default.nix | 7 ------- pkgs/development/compilers/zig/llvm10_polly.patch | 10 ---------- 2 files changed, 17 deletions(-) delete mode 100644 pkgs/development/compilers/zig/llvm10_polly.patch diff --git a/pkgs/development/compilers/zig/default.nix b/pkgs/development/compilers/zig/default.nix index 20ce0b5ff5e..6a1e5b9e76e 100644 --- a/pkgs/development/compilers/zig/default.nix +++ b/pkgs/development/compilers/zig/default.nix @@ -20,13 +20,6 @@ llvmPackages.stdenv.mkDerivation rec { zlib ]; - patches = [ - (substituteAll { - src = ./llvm10_polly.patch; - llvm_extras = "-Wl,${llvmPackages.llvm}/lib/LLVMPolly.so"; - }) - ]; - preBuild = '' export HOME=$TMPDIR; ''; diff --git a/pkgs/development/compilers/zig/llvm10_polly.patch b/pkgs/development/compilers/zig/llvm10_polly.patch deleted file mode 100644 index 72449c35d91..00000000000 --- a/pkgs/development/compilers/zig/llvm10_polly.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 97608cddf..e451c0711 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -369,4 +369,5 @@ target_link_libraries(zig_cpp LINK_PUBLIC - ${CLANG_LIBRARIES} - ${LLD_LIBRARIES} - ${LLVM_LIBRARIES} -+ @llvm_extras@ - )