From 517d2b963f35abbca8ccc364141bc5f2b4e92974 Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Mon, 6 Sep 2021 21:01:18 +0200 Subject: [PATCH] llvm_12: fix cross-compilation Cross-compilation is broken because the method of finding ncurses has changed, causing the build for the 'build system' to fail with a linking error due to ncurses being for the 'host system' (where you're compiling for). This patch disables ncurses, which is not a very neat solution, but will do until someone takes this upstream and gets it fixed properly. Closes https://github.com/NixOS/nixpkgs/issues/127946. Error that's seen before applying this: /nix/store/hash-binutils-2.35.1/bin/ld: /nix/store/hash-ncurses-6.2-aarch64-unknown-linux-gnu/lib/libtinfo.so: error adding symbols: file in wrong format --- pkgs/development/compilers/llvm/12/llvm/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/llvm/12/llvm/default.nix b/pkgs/development/compilers/llvm/12/llvm/default.nix index 7ac5031c36bb..30a1a7a16df8 100644 --- a/pkgs/development/compilers/llvm/12/llvm/default.nix +++ b/pkgs/development/compilers/llvm/12/llvm/default.nix @@ -54,7 +54,8 @@ in stdenv.mkDerivation (rec { buildInputs = [ libxml2 libffi ] ++ optional enablePFM libpfm; # exegesis - propagatedBuildInputs = [ ncurses zlib ]; + propagatedBuildInputs = optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ ncurses ] + ++ [ zlib ]; patches = [ ./gnu-install-dirs.patch