diff --git a/pkgs/development/compilers/llvm/7/llvm.nix b/pkgs/development/compilers/llvm/7/llvm.nix index 50643f233225..0eb946a0a837 100644 --- a/pkgs/development/compilers/llvm/7/llvm.nix +++ b/pkgs/development/compilers/llvm/7/llvm.nix @@ -1,5 +1,6 @@ { stdenv , fetch +, fetchpatch , cmake , python , libffi @@ -46,6 +47,14 @@ in stdenv.mkDerivation (rec { propagatedBuildInputs = [ ncurses zlib ]; + patches = [ + # https://bugs.llvm.org/show_bug.cgi?id=39427 + (fetchpatch { + url = "https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/raw/5a7d283d4e00bc4822c7b0226e593c344c8f6050/debian/patches/pr39427-misscompile.diff"; + sha256 = "03mpydsaw0xvcp7kb4sgjzcl5v22620r5z78kv3mz5wp7sn76fg5"; + }) + ]; + postPatch = optionalString stdenv.isDarwin '' substituteInPlace cmake/modules/AddLLVM.cmake \ --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \