Ticket #11896: mpir-2.1.3.p4-p5.diff

File mpir-2.1.3.p4-p5.diff, 2.6 KB (added by leif, 11 years ago)

Diff between the p4 (from #8664) and the p5 spkg. For reference / review only.

  • .hgtags

    diff --git a/.hgtags b/.hgtags
    a b  
    66c7bccdf78798ca44893d002b5dc5ffd0d1995406 mpir-2.1.3.p3
    771ef781ef316a238a9fc4f28b19d0f2426a5196c0 mpir-2.1.3.p3
    888e43565fafb7d3211b4d91de7312744cfc34bf09 mpir-2.1.3.p4
     957a991f5baeeaa9c19d1367ebac8dd071e554b78 mpir-2.1.3.p5
  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    4343
    4444== Changelog ==
    4545
     46=== mpir-2.1.3.p5 (Leif Leonhardy, October 5th, 2011) ===
     47 * #11896: Set ABI=32 on 32-bit (Linux) systems that run on 64-bit
     48   processors since otherwise the build might fail with a bunch of
     49   assembler errors when MPIR selects the wrong (64-bit) ABI.
     50   (Reported upstream, but no response yet.)
     51
    4652=== mpir-2.1.3.p4 (Leif Leonhardy, July 19th, 2011) ===
    4753 * #8664: Upgrade Sage's MPIR spkg to version 2.1.3
    4854 * Do not delete old GMP/MPIR shared libraries as Sage's versions of libraries
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    135135SAGE_CONF_OPTS=""
    136136
    137137
     138if [ -z "$CFLAG64" ]; then
     139    CFLAG64="-m64" # Only used in this script, no need to export it.
     140fi
     141
     142
    138143if [ "$SAGE_DEBUG" = yes ]; then
    139144    # Disable optimization, add debug symbols:
    140145    required_cflags="$required_cflags -g -O0"
     
    205210                    "supported on this CPU architecture."
    206211                # XXX exit 1 ?
    207212            esac
     213        fi
     214
     215        # MPIR fails to build on 32-bit operating systems running on
     216        # 64-bit CPUs if CFLAGS happen to contain '-m32' and ABI is
     217        # *not* set, so we set it here if necessary:
     218        # (Cf. http://groups.google.com/group/mpir-devel/browse_thread/thread/46ccdc5dfc3485cd#)
     219        # Note: This code snippet could in principle be moved out of the
     220        #       Linux branch, but since we already set ABI for other
     221        #       OSs above (and print an according message), it's here.
     222        if [ -z "$ABI" ]; then
     223            echo "int main(){return 0;}" > foo.c
     224            # Build a 64-bit executable:
     225            # (Usually succeeds, unless e.g. a 32-bit CPU is explicitly selected by CFLAGS.)
     226            $CC $CFLAGS $CFLAG64 -o foo foo.c 2>/dev/null
     227            if ! ./foo 2>/dev/null; then
     228                # We're on a 32-bit OS which cannot run 64-bit executables.
     229                echo "Building a 32-bit version of MPIR"
     230                ABI=32
     231            else
     232                # Setting ABI=64 shouldn't be necessary, but shouldn't hurt either.
     233                echo "Building a 64-bit version of MPIR"
     234                ABI=64
     235            fi
     236            rm -f foo foo.c
    208237        fi;;
    209238    CYGWIN)
    210239        # Nothing special performed (yet).