diff --git a/pkgs/development/compilers/llvm/4/fix-gcc9.patch b/pkgs/development/compilers/llvm/4/fix-gcc9.patch new file mode 100644 index 00000000000..8ea5ca97085 --- /dev/null +++ b/pkgs/development/compilers/llvm/4/fix-gcc9.patch @@ -0,0 +1,33 @@ +diff --git a/lib/Target/Mips/MipsFastISel.cpp b/lib/Target/Mips/MipsFastISel.cpp +index f79cb0e6..c6279046 100644 +--- a/lib/Target/Mips/MipsFastISel.cpp ++++ b/lib/Target/Mips/MipsFastISel.cpp +@@ -32,6 +32,7 @@ + #include "llvm/MC/MCSymbol.h" + #include "llvm/Target/TargetInstrInfo.h" + #include "llvm/Support/Debug.h" ++#include + + #define DEBUG_TYPE "mips-fastisel" + +@@ -1268,13 +1269,13 @@ bool MipsFastISel::fastLowerArguments() { + return false; + } + +- const ArrayRef GPR32ArgRegs = {Mips::A0, Mips::A1, Mips::A2, +- Mips::A3}; +- const ArrayRef FGR32ArgRegs = {Mips::F12, Mips::F14}; +- const ArrayRef AFGR64ArgRegs = {Mips::D6, Mips::D7}; +- ArrayRef::iterator NextGPR32 = GPR32ArgRegs.begin(); +- ArrayRef::iterator NextFGR32 = FGR32ArgRegs.begin(); +- ArrayRef::iterator NextAFGR64 = AFGR64ArgRegs.begin(); ++ std::array GPR32ArgRegs = {{Mips::A0, Mips::A1, Mips::A2, ++ Mips::A3}}; ++ std::array FGR32ArgRegs = {{Mips::F12, Mips::F14}}; ++ std::array AFGR64ArgRegs = {{Mips::D6, Mips::D7}}; ++ auto NextGPR32 = GPR32ArgRegs.begin(); ++ auto NextFGR32 = FGR32ArgRegs.begin(); ++ auto NextAFGR64 = AFGR64ArgRegs.begin(); + + struct AllocatedReg { + const TargetRegisterClass *RC; diff --git a/pkgs/development/compilers/llvm/4/llvm.nix b/pkgs/development/compilers/llvm/4/llvm.nix index ac5dcbe6b94..c443303f373 100644 --- a/pkgs/development/compilers/llvm/4/llvm.nix +++ b/pkgs/development/compilers/llvm/4/llvm.nix @@ -52,6 +52,13 @@ stdenv.mkDerivation ({ url = "https://bugzilla.redhat.com/attachment.cgi?id=1389687"; sha256 = "0ga2123aclq3x9w72d0rm0az12m8c1i4r1106vh701hf4cghgbch"; }) + ./fix-gcc9.patch + (fetchpatch { + name = "llvm4-avoid-undefined-behavior-in-unittest.patch"; + url = "https://aur.archlinux.org/cgit/aur.git/plain/D32089-Avoid-undefined-behavior-in-unittest.patch?h=llvm40&id=f459b0bad8aa3b94bc2733d79d176071a32846a6"; + sha256 = "0x5q6a8lk6xg4ns4qh75fxvvmfnifwvyrq17ck85q8c0753i1irf"; + extraPrefix = ""; + }) ]; # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks