[Box Backup-dev] COMMIT r414 - in box/trunk: . lib/raidfile
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Sat Feb 11 02:42:54 GMT 2006
Author: martin
Date: 2006-02-11 02:42:50 +0000 (Sat, 11 Feb 2006)
New Revision: 414
Modified:
box/trunk/configure.ac
box/trunk/lib/raidfile/RaidFileWrite.cpp
Log:
Added workaround option for GCC on the PPC platform. This is a manually invoked option because I do not know under what circumstances (eg. versions etc) the problem occurs.
If the raidfile test fails in release mode but passes in debug mode then try this option and see if it fixes it.
Modified: box/trunk/configure.ac
===================================================================
--- box/trunk/configure.ac 2006-02-11 02:28:52 UTC (rev 413)
+++ box/trunk/configure.ac 2006-02-11 02:42:50 UTC (rev 414)
@@ -10,6 +10,17 @@
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++])
Modified: box/trunk/lib/raidfile/RaidFileWrite.cpp
===================================================================
--- box/trunk/lib/raidfile/RaidFileWrite.cpp 2006-02-11 02:28:52 UTC (rev 413)
+++ box/trunk/lib/raidfile/RaidFileWrite.cpp 2006-02-11 02:42:50 UTC (rev 414)
@@ -462,6 +462,9 @@
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];
More information about the Boxbackup-dev
mailing list