mesa: Patch to fix build with llvm 3.5

This commit is contained in:
Jerome Duval
2015-03-21 18:32:36 +00:00
parent 3234ef61ff
commit 570419bb72

View File

@@ -1,4 +1,4 @@
From 30dc688e9fa2dbaa3855d99d2463e115b18bb05f Mon Sep 17 00:00:00 2001
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
@@ -31,3 +31,87 @@ index 1712a87..9c0717c 100644
--
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