Mesa (7.10): gallivm: Tell LLVM to not assume a 16-byte aligned stack on x86.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Sun Jun 12 01:14:50 PDT 2011


Module: Mesa
Branch: 7.10
Commit: c1da25aede0a012e7592b55fb4c3c422ff38cf67
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c1da25aede0a012e7592b55fb4c3c422ff38cf67

Author: José Fonseca <jfonseca at vmware.com>
Date:   Wed May 18 18:00:55 2011 +0100

gallivm: Tell LLVM to not assume a 16-byte aligned stack on x86.

Fixes fdo 36738.

---

 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index 46dd00d..81b9234 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -133,6 +133,19 @@ lp_set_target_options(void)
 #endif
 #endif
 
+   /*
+    * LLVM revision 123367 switched the default stack alignment to 16 bytes on
+    * Linux (and several other Unices in later revisions), to match recent gcc
+    * versions.
+    *
+    * However our drivers can be loaded by old binary applications, still
+    * maintaining a 4 bytes stack alignment.  Therefore we must tell LLVM here
+    * to only assume a 4 bytes alignment for backwards compatibility.
+    */
+#if defined(PIPE_ARCH_X86)
+   llvm::StackAlignment = 4;
+#endif
+
 #if defined(DEBUG) || defined(PROFILE)
    llvm::NoFramePointerElim = true;
 #endif



More information about the mesa-commit mailing list