summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac11
-rw-r--r--lib/raidfile/RaidFileWrite.cpp3
2 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 4239b821..2c375a6f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,6 +10,17 @@ touch install-sh
AC_CANONICAL_SYSTEM
test -s install-sh || rm install-sh
+
+### Temporary hacks
+AC_ARG_ENABLE(
+ [ppc-workaround],
+ [AC_HELP_STRING([--enable-ppc-workaround],
+ [Enable a workaround for a compiler bug in GCC on PPC platforms (raidfile tests fail).])])
+if test "x$enable_ppc_workaround" = "xyes"; then
+ AC_DEFINE([HAVE_PPC_WORKAROUND], 1, [Define to 1 to workaround a GCC compiler bug on PPC])
+fi
+
+
### Checks for programs.
AC_LANG([C++])
diff --git a/lib/raidfile/RaidFileWrite.cpp b/lib/raidfile/RaidFileWrite.cpp
index 8341943d..c9963f05 100644
--- a/lib/raidfile/RaidFileWrite.cpp
+++ b/lib/raidfile/RaidFileWrite.cpp
@@ -462,6 +462,9 @@ void RaidFileWrite::TransformToRaidStorage()
ASSERT(sizeof(RaidFileRead::FileSizeType) >= sizeof(off_t));
int sizePos = (blockSize/sizeof(unsigned int)) - 2;
RaidFileRead::FileSizeType sw = box_hton64(writeFileStat.st_size);
+#ifdef HAVE_PPC_WORKAROUND
+ static RaidFileRead::FileSizeType ppcWorkaround = sw;
+#endif
unsigned int *psize = (unsigned int *)(&sw);
pparity[sizePos+0] = pstripe1[sizePos+0] ^ psize[0];
pparity[sizePos+1] = pstripe1[sizePos+1] ^ psize[1];