nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

-17
-7
pkgs/development/compilers/zig/default.nix
··· 20 20 zlib 21 21 ]; 22 22 23 - patches = [ 24 - (substituteAll { 25 - src = ./llvm10_polly.patch; 26 - llvm_extras = "-Wl,${llvmPackages.llvm}/lib/LLVMPolly.so"; 27 - }) 28 - ]; 29 - 30 23 preBuild = '' 31 24 export HOME=$TMPDIR; 32 25 '';
-10
pkgs/development/compilers/zig/llvm10_polly.patch
··· 1 - diff --git a/CMakeLists.txt b/CMakeLists.txt 2 - index 97608cddf..e451c0711 100644 3 - --- a/CMakeLists.txt 4 - +++ b/CMakeLists.txt 5 - @@ -369,4 +369,5 @@ target_link_libraries(zig_cpp LINK_PUBLIC 6 - ${CLANG_LIBRARIES} 7 - ${LLD_LIBRARIES} 8 - ${LLVM_LIBRARIES} 9 - + @llvm_extras@ 10 - )