In metaconfig.git, the branch master has been updated <http://perl5.git.perl.org/metaconfig.git/commitdiff/8eccc332dd3ed9af591200708f8e8529affda472?hp=97a316c09bad04091f8720bf581c728debd1ca28>
- Log ----------------------------------------------------------------- commit 8eccc332dd3ed9af591200708f8e8529affda472 Author: Andy Dougherty <[email protected]> Date: Mon Sep 10 07:45:26 2012 -0400 Fix alignment for darwin with -Dusemorebits. By default, the darwin build assumes a "multiarchitecture" build. Configure has a hardwired default of '8' for alignbytes (and then proceeds to ignore it with another hard-wired '8' in config.h). That '8' was supposed to be a safe value, in case perl was built on one architecture but run on another with a stricter constraint. With darwin and -Dusemorebits, however, the alignment should be on 16-byte boundaries. We don't want to penalize all darwin builds for this unlikely configuration, but we do want to allow it. This patch causes Configure to compute alignbytes even for multiarch builds, but if the result is less than 8, it sets it to 8 (which preserves the previous behavior). If, however, alignbytes is 16, Configure won't decrease it. Then, this patch also fixes the bits that end up in config_h.SH so that it uses the value determined by Configure instead of the previous hardwired value. ----------------------------------------------------------------------- Summary of changes: U/compline/alignbytes.U | 23 +++++++++++++++-------- 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/U/compline/alignbytes.U b/U/compline/alignbytes.U index e5edbea..8fb2cc8 100644 --- a/U/compline/alignbytes.U +++ b/U/compline/alignbytes.U @@ -31,22 +31,18 @@ ?C:MEM_ALIGNBYTES (ALIGNBYTES): ?C: This symbol contains the number of bytes required to align a ?C: double, or a long double when applicable. Usual values are 2, -?C: 4 and 8. The default is eight, for safety. +?C: 4 and 8. The default is eight, for safety. For cross-compiling +?C: or multiarch support, Configure will set a minimum of 8. ?C:. -?H:?%<:#if defined(USE_CROSS_COMPILE) || defined(MULTIARCH) -?H:?%<:# define MEM_ALIGNBYTES 8 -?H:?%<:#else ?H:?%<:#define MEM_ALIGNBYTES $alignbytes -?H:?%<:#endif ?H:. ?F:!try : check for alignment requirements echo " " -case "$usecrosscompile$multiarch" in +case "$usecrosscompile" in *$define*) $cat <<EOM -You seem to be either cross-compiling or doing a multiarchitecture build, -skipping the memory alignment check. +You seem to be cross-compiling. Skipping the memory alignment check. EOM case "$alignbytes" in @@ -84,6 +80,17 @@ EOCP dflt='8' echo "(I can't seem to compile the test program...)" fi + case "$multiarch" in + *$define*) + : The usual safe value is 8, but Darwin with -Duselongdouble + : needs 16. Hence, we will take 8 as a minimum, but allow + : Configure to pick a larger value if needed. + if $test "$dflt" -lt 8; then + dflt='8' + echo "Setting alignment to 8 for multiarch support.">&4 + fi + ;; + esac ;; *) dflt="$alignbytes" ;; -- perl5 metaconfig repository
