alignment hack to work around boehm-gc breakage in darwin15
Jack Howarth
howarth.at.macports at gmail.com
Sun Oct 11 15:45:17 PDT 2015
Jeremy,
The Trak reporting system is down so I am posting this to the
mailing list instead. I have puzzled out a hack to work around the
boehm-gc regressions and resulting gcj breakage in darwin15 from the
recompilation of the libunwind.dylib with Apple Clang 7.0. The
attached patch reduces the alignment from 8 to 2 on x86_64 64-bit and
from 4 to 2 on i386 32-bit. Note that the alignment could have been
reduced to 1 but this would have produced additional performance
reductions in speed. Also an alignment of 4 for the x86_64 64-bit code
still fails the boehm-gc test suite. The gcc 5.2.0 compiler built on
darwin15 shows no regressions in the libjava test suite with this
patch proving that a functional gcj is restored for darwin15. Also
this change shows no regression in the resulting build on darwin13 as
well.
Jack
ps I still strongly suspect that the Apple Clang 7.0 compiler is
actually improperly optimizing libunwind and this issue really should
be explored by Apple to make sure additional software beyond
boehm-gc/gcj isn't impacted.
-------------- next part --------------
--- boehm-gc/include/private/gcconfig.h.orig 2015-10-11 17:19:25.000000000 -0400
+++ boehm-gc/include/private/gcconfig.h 2015-10-11 15:41:26.000000000 -0400
@@ -1041,10 +1041,10 @@
# define MACH_TYPE "I386"
# if defined(__LP64__) || defined(_WIN64)
# define CPP_WORDSZ 64
-# define ALIGNMENT 8
+# define ALIGNMENT 2
# else
# define CPP_WORDSZ 32
-# define ALIGNMENT 4
+# define ALIGNMENT 2
/* Appears to hold for all "32 bit" compilers */
/* except Borland. The -a4 option fixes */
/* Borland. */
@@ -2005,10 +2005,10 @@
# ifdef X86_64
# define MACH_TYPE "X86_64"
# ifdef __ILP32__
-# define ALIGNMENT 4
+# define ALIGNMENT 2
# define CPP_WORDSZ 32
# else
-# define ALIGNMENT 8
+# define ALIGNMENT 2
# define CPP_WORDSZ 64
# endif
# ifndef HBLKSIZE
More information about the macports-dev
mailing list