From a0bfc0e62448df26e514b41de89aced988a6ab53 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Fri, 22 Aug 2014 20:42:37 +0200
Subject: Fix for strings.h


diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index f939fe8..6629904 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <assert.h>
 
 #include "ast.h"
diff --git a/src/hgl/GLRendererRoster.cpp b/src/hgl/GLRendererRoster.cpp
index 1712a87..9c0717c 100644
--- a/src/hgl/GLRendererRoster.cpp
+++ b/src/hgl/GLRendererRoster.cpp
@@ -23,6 +23,7 @@
 
 #include <new>
 #include <string.h>
+#include <strings.h>
 
 
 extern "C" status_t _kern_get_safemode_option(const char* parameter,
-- 
1.8.3.4


From edead798024ba52ea21c841ae9613e27754ea0e6 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 21 Mar 2015 18:19:16 +0000
Subject: Fixed build with llvm 3.5


diff --git a/scons/gallium.py b/scons/gallium.py
index 9796c78..1edd3ba 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -329,6 +329,7 @@ def generate(env):
         # Work around aliasing bugs - developers should comment this out
         ccflags += ['-fno-strict-aliasing']
         ccflags += ['-g']
+        cxxflags += ['-std=c++11']
         if env['build'] in ('checked', 'profile'):
             # See http://code.google.com/p/jrfonseca/wiki/Gprof2Dot#Which_options_should_I_pass_to_gcc_when_compiling_for_profiling?
             ccflags += [
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
index 1c886ea..b51fdf1 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
@@ -56,10 +56,16 @@
 #include <llvm/MC/MCRegisterInfo.h>
 #endif /* HAVE_LLVM >= 0x0301 */
 
-#if HAVE_LLVM >= 0x0303
+#if HAVE_LLVM >= 0x0305
+#define OwningPtr std::unique_ptr
+#elif HAVE_LLVM >= 0x0303
 #include <llvm/ADT/OwningPtr.h>
 #endif
 
+#if HAVE_LLVM >= 0x0305
+#include <llvm/MC/MCContext.h>
+#endif
+
 #include "util/u_math.h"
 #include "util/u_debug.h"
 
@@ -226,17 +232,6 @@ disassemble(const void* func, llvm::raw_ostream & Out)
    }
 
 #if HAVE_LLVM >= 0x0300
-   const MCSubtargetInfo *STI = T->createMCSubtargetInfo(Triple, sys::getHostCPUName(), "");
-   OwningPtr<const MCDisassembler> DisAsm(T->createMCDisassembler(*STI));
-#else 
-   OwningPtr<const MCDisassembler> DisAsm(T->createMCDisassembler());
-#endif 
-   if (!DisAsm) {
-      Out << "error: no disassembler for target " << Triple << "\n";
-      return 0;
-   }
-
-#if HAVE_LLVM >= 0x0300
    unsigned int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
 #else
    int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
@@ -256,6 +251,21 @@ disassemble(const void* func, llvm::raw_ostream & Out)
    }
 #endif
 
+#if HAVE_LLVM >= 0x0305
+   OwningPtr<const MCSubtargetInfo> STI(T->createMCSubtargetInfo(Triple, sys::getHostCPUName(), ""));
+   OwningPtr<MCContext> MCCtx(new MCContext(AsmInfo.get(), MRI.get(), 0));
+   OwningPtr<const MCDisassembler> DisAsm(T->createMCDisassembler(*STI, *MCCtx));
+#elif HAVE_LLVM >= 0x0300
+   const MCSubtargetInfo *STI = T->createMCSubtargetInfo(Triple, sys::getHostCPUName(), "");
+   OwningPtr<const MCDisassembler> DisAsm(T->createMCDisassembler(*STI));
+#else 
+   OwningPtr<const MCDisassembler> DisAsm(T->createMCDisassembler());
+#endif 
+   if (!DisAsm) {
+      Out << "error: no disassembler for target " << Triple << "\n";
+      return 0;
+   }
+
 #if HAVE_LLVM >= 0x0301
    OwningPtr<MCInstPrinter> Printer(
          T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI));
-- 
1.8.3.4

