From b318ebee9719cb03b380746260663aa9ec466a46 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Fri, 30 Mar 2012 10:09:08 -0500 Subject: [PATCH] mesa: Add stock Mesa diffs for mainline mesa * rtasm symbol collision fix. There is older Mesa rtasm code, and newer Gallium3D rtasm code. There are colliding symbols only seen when you link Mesa and Gallium into the same shared library. This diff makes Mesa use the Gallium3D rtasm code. * Mesa target architecture fix. This ensures the generated Mesa binaries work under Pentium or higher processors. Fix for #8318 --- 3rdparty/mesa/Mesa-8.1devel-archfix.diff | 27 ++++++++++++++ 3rdparty/mesa/Mesa-8.1devel-rtasmfix.diff | 44 +++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 3rdparty/mesa/Mesa-8.1devel-archfix.diff create mode 100644 3rdparty/mesa/Mesa-8.1devel-rtasmfix.diff diff --git a/3rdparty/mesa/Mesa-8.1devel-archfix.diff b/3rdparty/mesa/Mesa-8.1devel-archfix.diff new file mode 100644 index 0000000000..b9586025d6 --- /dev/null +++ b/3rdparty/mesa/Mesa-8.1devel-archfix.diff @@ -0,0 +1,27 @@ +diff --git a/scons/gallium.py b/scons/gallium.py +index 2fa80db..b99e753 100755 +--- a/scons/gallium.py ++++ b/scons/gallium.py +@@ -327,7 +327,7 @@ def generate(env): + #'-march=pentium4', + ] + if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2') \ +- and (platform != 'windows' or env['build'] == 'debug' or True): ++ and platform not in ['windows', 'haiku']: + # NOTE: We need to ensure stack is realigned given that we + # produce shared objects, and have no control over the stack + # alignment policy of the application. Therefore we need +@@ -343,6 +343,13 @@ def generate(env): + '-mmmx', '-msse', '-msse2', # enable SIMD intrinsics + #'-mfpmath=sse', + ] ++ if platform in ['haiku']: ++ ccflags += [ ++ '-mstackrealign', # ensure stack is aligned ++ '-march=i586', # Haiku target is Pentium ++ '-mtune=i686', # Use i686 where we can ++ '-mmmx', # Use mmx math where we can ++ ] + if platform in ['windows', 'darwin']: + # Workaround http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216 + ccflags += ['-fno-common'] diff --git a/3rdparty/mesa/Mesa-8.1devel-rtasmfix.diff b/3rdparty/mesa/Mesa-8.1devel-rtasmfix.diff new file mode 100644 index 0000000000..27bd42302d --- /dev/null +++ b/3rdparty/mesa/Mesa-8.1devel-rtasmfix.diff @@ -0,0 +1,44 @@ +diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak +index c746b8a..09dc5f5 100644 +--- a/src/mesa/sources.mak ++++ b/src/mesa/sources.mak +@@ -276,7 +276,6 @@ ASM_C_SOURCES = \ + x86/x86_xform.c \ + x86/3dnow.c \ + x86/sse.c \ +- x86/rtasm/x86sse.c \ + sparc/sparc.c \ + x86-64/x86-64.c + +diff --git a/src/mesa/tnl/t_vertex_sse.c b/src/mesa/tnl/t_vertex_sse.c +index e0141c3..1afaf78 100644 +--- a/src/mesa/tnl/t_vertex_sse.c ++++ b/src/mesa/tnl/t_vertex_sse.c +@@ -36,7 +36,7 @@ + + #if defined(USE_SSE_ASM) + +-#include "x86/rtasm/x86sse.h" ++#include "rtasm/rtasm_x86sse.h" + #include "x86/common_x86_asm.h" + + +@@ -356,7 +356,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) + struct x86_reg vp0 = x86_make_reg(file_XMM, 1); + struct x86_reg vp1 = x86_make_reg(file_XMM, 2); + struct x86_reg temp2 = x86_make_reg(file_XMM, 3); +- GLubyte *fixup, *label; ++ GLuint fixup, label; + + /* Push a few regs? + */ +@@ -658,7 +658,8 @@ void _tnl_generate_sse_emit( struct gl_context *ctx ) + p.identity = x86_make_reg(file_XMM, 6); + p.chan0 = x86_make_reg(file_XMM, 7); + +- if (!x86_init_func_size(&p.func, MAX_SSE_CODE_SIZE)) { ++ x86_init_func_size(&p.func, MAX_SSE_CODE_SIZE); ++ if (p.func.caps == 0) { + vtx->emit = NULL; + return; + }