[PATCH]: Fix GLX crashes on RISC cpus.
David Miller
davem at davemloft.net
Thu Dec 27 16:36:27 PST 2007
From: Jaymz Julian <jaymz at artificial-stupidity.net>
Date: Thu, 27 Dec 2007 22:35:34 +1100
> It's not random (it rotates the result in a specific way), but that's not the
> point - you can easily check for this bevaviour by doing something like:
>
> (warning: written into email client :-p. Bonus points if you modify
> it to check endian at the same time)
Actually we can't implement this as a run-time check, I just tried.
The problem is that we can't handle cross-compilation cases properly.
Having a default for things that enable or disable features because of
a lack of a run-time check during cross-compilation is one thing, but
having to make a choice which might result in emitting incorrect code
is not OK.
One could argue that we could add the cpu-type check in the
cross-compilation case, but if we need the hard-coded cpu list for
correctness in all cases anyways, there is no point to the run-time
check at all.
Therefore, I think the original patch is the way to go, explicitly
adding cases per cpu type to xserver/configure.ac
Could someone please therefore check my patch in? Here it is again
for reference. Thanks!
[GL]: Add GLX compile flags lost in modular X server changes.
RISC chips that trap on unaligned loads and stores need to
define __GLX_ALIGN64. This used to get added to the cflags
in the old *.cf files but it no longer does in the modular
X server.
Also, Alpha needs to pass -mieee to the compiler as well.
This is a simple backport of a patch that debian, and probably other
distributions, have been applying forever. To the best of my
knowledge the patch was written by Jurij Smakov. See debian bug
number #388125.
I just checked and this has been rotting for more than a year in
freedesktop bugzilla as #8392.
Signed-off-by: David S. Miller <davem at davemloft.net>
---
GL/glx/Makefile.am | 3 ++-
configure.ac | 10 ++++++++++
hw/dmx/glxProxy/Makefile.am | 1 +
3 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/GL/glx/Makefile.am b/GL/glx/Makefile.am
index 8eda153..4cf56e8 100644
--- a/GL/glx/Makefile.am
+++ b/GL/glx/Makefile.am
@@ -14,7 +14,8 @@ AM_CFLAGS = \
-I at MESA_SOURCE@/src/mesa/glapi \
-I at MESA_SOURCE@/src/mesa/main \
-DXFree86Server \
- @GLX_DEFINES@
+ @GLX_DEFINES@ \
+ @GLX_ARCH_DEFINES@
# none yet
#sdk_HEADERS =
diff --git a/configure.ac b/configure.ac
index 0b718c9..0742040 100644
--- a/configure.ac
+++ b/configure.ac
@@ -304,6 +304,7 @@ case $host_cpu in
*freebsd*) SYS_LIBS=-lio ;;
*netbsd*) AC_DEFINE(USE_ALPHA_PIO, 1, [NetBSD PIO alpha IO]) ;;
esac
+ GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee"
;;
arm*)
ARM_VIDEO=yes
@@ -333,6 +334,7 @@ case $host_cpu in
xorg_loader_sparcmuldiv="yes"
SPARC64_VIDEO=yes
BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c"
+ GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
;;
x86_64*|amd64*)
use_x86_asm="yes"
@@ -347,8 +349,16 @@ case $host_cpu in
SYS_LIBS=-lamd64
;;
esac
+ GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
+ ;;
+ ia64*)
+ GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
+ ;;
+ s390*)
+ GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
;;
esac
+AC_SUBST(GLX_ARCH_DEFINES)
dnl BSD *_video.c selection
AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes])
diff --git a/hw/dmx/glxProxy/Makefile.am b/hw/dmx/glxProxy/Makefile.am
index 1fbc8d7..f995498 100644
--- a/hw/dmx/glxProxy/Makefile.am
+++ b/hw/dmx/glxProxy/Makefile.am
@@ -32,6 +32,7 @@ libglxproxy_a_SOURCES = compsize.c \
unpack.h
AM_CFLAGS = \
+ @GLX_ARCH_DEFINES@ \
$(DIX_CFLAGS) \
-I$(top_srcdir)/hw/dmx \
-I$(top_srcdir)/include \
More information about the xorg
mailing list