From 25444ab74e068ffdba5d00817d7eb0daff096839 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sun, 5 Oct 2014 20:24:32 -0400 Subject: [PATCH] Update mpfr patch and configure options Remove configure option --enable-shared --- stage0/hv-install-2 | 1 - ...fixes-3.patch => mpfr-3.1.2-fixes-4.patch} | 308 +++++++++++++++++- stage1/hv-install-2 | 2 +- .../patches/common/mpfr-3.1.2-fixes-4.patch | 1 + stage2/hv-install-1 | 2 +- .../patches/common/mpfr-3.1.2-fixes-3.patch | 1 - .../patches/common/mpfr-3.1.2-fixes-4.patch | 1 + 7 files changed, 310 insertions(+), 6 deletions(-) rename stage0/patches/common/{mpfr-3.1.2-fixes-3.patch => mpfr-3.1.2-fixes-4.patch} (82%) create mode 120000 stage1/patches/common/mpfr-3.1.2-fixes-4.patch delete mode 120000 stage2/patches/common/mpfr-3.1.2-fixes-3.patch create mode 120000 stage2/patches/common/mpfr-3.1.2-fixes-4.patch diff --git a/stage0/hv-install-2 b/stage0/hv-install-2 index cc69d32..7b7f32e 100755 --- a/stage0/hv-install-2 +++ b/stage0/hv-install-2 @@ -23,7 +23,6 @@ ipkg ${GMP} "\ export LDFLAGS="-Wl,-rpath,/cross-tools/lib" ipkg ${MPFR} "\ - --enable-shared \ --disable-static \ --with-gmp=/cross-tools" diff --git a/stage0/patches/common/mpfr-3.1.2-fixes-3.patch b/stage0/patches/common/mpfr-3.1.2-fixes-4.patch similarity index 82% rename from stage0/patches/common/mpfr-3.1.2-fixes-3.patch rename to stage0/patches/common/mpfr-3.1.2-fixes-4.patch index 6a93309..e35c474 100644 --- a/stage0/patches/common/mpfr-3.1.2-fixes-3.patch +++ b/stage0/patches/common/mpfr-3.1.2-fixes-4.patch @@ -1,9 +1,9 @@ Submitted By: William Harrington (kb0iic at cross-lfs dot org) -Date: 2014-05-09 +Date: 2014-07-21 Initial Package Version: 3.1.2 Origin: Upstream Upstream Status: Applied -Description: Contains all upstream patches of mpfr current to patch level 8. +Description: Contains all upstream patches of mpfr current to patch level 10. diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES --- mpfr-3.1.2-a/PATCHES 2013-09-26 10:52:52.000000000 +0000 @@ -1278,3 +1278,307 @@ diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c - return "3.1.2-p7"; + return "3.1.2-p8"; } +diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES +--- mpfr-3.1.2-a/PATCHES 2014-06-30 15:15:25.533266905 +0000 ++++ mpfr-3.1.2-b/PATCHES 2014-06-30 15:15:25.617269178 +0000 +@@ -0,0 +1 @@ ++div-overflow +diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION +--- mpfr-3.1.2-a/VERSION 2014-06-30 15:15:25.529266797 +0000 ++++ mpfr-3.1.2-b/VERSION 2014-06-30 15:15:25.617269178 +0000 +@@ -1 +1 @@ +-3.1.2-p8 ++3.1.2-p9 +diff -Naurd mpfr-3.1.2-a/src/div.c mpfr-3.1.2-b/src/div.c +--- mpfr-3.1.2-a/src/div.c 2013-03-13 15:37:33.000000000 +0000 ++++ mpfr-3.1.2-b/src/div.c 2014-06-30 15:15:25.585268312 +0000 +@@ -750,7 +750,9 @@ + truncate_check_qh: + if (qh) + { +- qexp ++; ++ if (MPFR_LIKELY (qexp < MPFR_EXP_MAX)) ++ qexp ++; ++ /* else qexp is now incorrect, but one will still get an overflow */ + q0p[q0size - 1] = MPFR_LIMB_HIGHBIT; + } + goto truncate; +@@ -765,7 +767,9 @@ + inex = 1; /* always here */ + if (mpn_add_1 (q0p, q0p, q0size, MPFR_LIMB_ONE << sh)) + { +- qexp ++; ++ if (MPFR_LIKELY (qexp < MPFR_EXP_MAX)) ++ qexp ++; ++ /* else qexp is now incorrect, but one will still get an overflow */ + q0p[q0size - 1] = MPFR_LIMB_HIGHBIT; + } + +diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h +--- mpfr-3.1.2-a/src/mpfr.h 2014-06-30 15:15:25.533266905 +0000 ++++ mpfr-3.1.2-b/src/mpfr.h 2014-06-30 15:15:25.613269070 +0000 +@@ -27,7 +27,7 @@ + #define MPFR_VERSION_MAJOR 3 + #define MPFR_VERSION_MINOR 1 + #define MPFR_VERSION_PATCHLEVEL 2 +-#define MPFR_VERSION_STRING "3.1.2-p8" ++#define MPFR_VERSION_STRING "3.1.2-p9" + + /* Macros dealing with MPFR VERSION */ + #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c)) +diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c +--- mpfr-3.1.2-a/src/version.c 2014-06-30 15:15:25.533266905 +0000 ++++ mpfr-3.1.2-b/src/version.c 2014-06-30 15:15:25.613269070 +0000 +@@ -25,5 +25,5 @@ + const char * + mpfr_get_version (void) + { +- return "3.1.2-p8"; ++ return "3.1.2-p9"; + } +diff -Naurd mpfr-3.1.2-a/tests/tdiv.c mpfr-3.1.2-b/tests/tdiv.c +--- mpfr-3.1.2-a/tests/tdiv.c 2013-03-13 15:37:44.000000000 +0000 ++++ mpfr-3.1.2-b/tests/tdiv.c 2014-06-30 15:15:25.585268312 +0000 +@@ -1104,6 +1104,96 @@ + #define RAND_FUNCTION(x) mpfr_random2(x, MPFR_LIMB_SIZE (x), randlimb () % 100, RANDS) + #include "tgeneric.c" + ++static void ++test_extreme (void) ++{ ++ mpfr_t x, y, z; ++ mpfr_exp_t emin, emax; ++ mpfr_prec_t p[4] = { 8, 32, 64, 256 }; ++ int xi, yi, zi, j, r; ++ unsigned int flags, ex_flags; ++ ++ emin = mpfr_get_emin (); ++ emax = mpfr_get_emax (); ++ ++ mpfr_set_emin (MPFR_EMIN_MIN); ++ mpfr_set_emax (MPFR_EMAX_MAX); ++ ++ for (xi = 0; xi < 4; xi++) ++ { ++ mpfr_init2 (x, p[xi]); ++ mpfr_setmax (x, MPFR_EMAX_MAX); ++ MPFR_ASSERTN (mpfr_check (x)); ++ for (yi = 0; yi < 4; yi++) ++ { ++ mpfr_init2 (y, p[yi]); ++ mpfr_setmin (y, MPFR_EMIN_MIN); ++ for (j = 0; j < 2; j++) ++ { ++ MPFR_ASSERTN (mpfr_check (y)); ++ for (zi = 0; zi < 4; zi++) ++ { ++ mpfr_init2 (z, p[zi]); ++ RND_LOOP (r) ++ { ++ mpfr_clear_flags (); ++ mpfr_div (z, x, y, (mpfr_rnd_t) r); ++ flags = __gmpfr_flags; ++ MPFR_ASSERTN (mpfr_check (z)); ++ ex_flags = MPFR_FLAGS_OVERFLOW | MPFR_FLAGS_INEXACT; ++ if (flags != ex_flags) ++ { ++ printf ("Bad flags in test_extreme on z = a/b" ++ " with %s and\n", ++ mpfr_print_rnd_mode ((mpfr_rnd_t) r)); ++ printf ("a = "); ++ mpfr_dump (x); ++ printf ("b = "); ++ mpfr_dump (y); ++ printf ("Expected flags:"); ++ flags_out (ex_flags); ++ printf ("Got flags: "); ++ flags_out (flags); ++ printf ("z = "); ++ mpfr_dump (z); ++ exit (1); ++ } ++ mpfr_clear_flags (); ++ mpfr_div (z, y, x, (mpfr_rnd_t) r); ++ flags = __gmpfr_flags; ++ MPFR_ASSERTN (mpfr_check (z)); ++ ex_flags = MPFR_FLAGS_UNDERFLOW | MPFR_FLAGS_INEXACT; ++ if (flags != ex_flags) ++ { ++ printf ("Bad flags in test_extreme on z = a/b" ++ " with %s and\n", ++ mpfr_print_rnd_mode ((mpfr_rnd_t) r)); ++ printf ("a = "); ++ mpfr_dump (y); ++ printf ("b = "); ++ mpfr_dump (x); ++ printf ("Expected flags:"); ++ flags_out (ex_flags); ++ printf ("Got flags: "); ++ flags_out (flags); ++ printf ("z = "); ++ mpfr_dump (z); ++ exit (1); ++ } ++ } ++ mpfr_clear (z); ++ } /* zi */ ++ mpfr_nextabove (y); ++ } /* j */ ++ mpfr_clear (y); ++ } /* yi */ ++ mpfr_clear (x); ++ } /* xi */ ++ ++ set_emin (emin); ++ set_emax (emax); ++} ++ + int + main (int argc, char *argv[]) + { +@@ -1130,6 +1220,7 @@ + test_20070603 (); + test_20070628 (); + test_generic (2, 800, 50); ++ test_extreme (); + + tests_end_mpfr (); + return 0; +diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES +--- mpfr-3.1.2-a/PATCHES 2014-06-30 15:17:53.337268149 +0000 ++++ mpfr-3.1.2-b/PATCHES 2014-06-30 15:17:53.417270314 +0000 +@@ -0,0 +1 @@ ++vasprintf +diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION +--- mpfr-3.1.2-a/VERSION 2014-06-30 15:17:53.337268149 +0000 ++++ mpfr-3.1.2-b/VERSION 2014-06-30 15:17:53.413270206 +0000 +@@ -1 +1 @@ +-3.1.2-p9 ++3.1.2-p10 +diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h +--- mpfr-3.1.2-a/src/mpfr.h 2014-06-30 15:17:53.337268149 +0000 ++++ mpfr-3.1.2-b/src/mpfr.h 2014-06-30 15:17:53.413270206 +0000 +@@ -27,7 +27,7 @@ + #define MPFR_VERSION_MAJOR 3 + #define MPFR_VERSION_MINOR 1 + #define MPFR_VERSION_PATCHLEVEL 2 +-#define MPFR_VERSION_STRING "3.1.2-p9" ++#define MPFR_VERSION_STRING "3.1.2-p10" + + /* Macros dealing with MPFR VERSION */ + #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c)) +diff -Naurd mpfr-3.1.2-a/src/vasprintf.c mpfr-3.1.2-b/src/vasprintf.c +--- mpfr-3.1.2-a/src/vasprintf.c 2013-11-15 00:51:49.267334408 +0000 ++++ mpfr-3.1.2-b/src/vasprintf.c 2014-06-30 15:17:53.377269231 +0000 +@@ -884,14 +884,18 @@ + first digit, we want the exponent for radix two and the decimal + point AFTER the first digit. */ + { +- MPFR_ASSERTN (exp > MPFR_EMIN_MIN /4); /* possible overflow */ ++ /* An integer overflow is normally not possible since MPFR_EXP_MIN ++ is twice as large as MPFR_EMIN_MIN. */ ++ MPFR_ASSERTN (exp > (MPFR_EXP_MIN + 3) / 4); + exp = (exp - 1) * 4; + } + else + /* EXP is the exponent for decimal point BEFORE the first digit, we + want the exponent for decimal point AFTER the first digit. */ + { +- MPFR_ASSERTN (exp > MPFR_EMIN_MIN); /* possible overflow */ ++ /* An integer overflow is normally not possible since MPFR_EXP_MIN ++ is twice as large as MPFR_EMIN_MIN. */ ++ MPFR_ASSERTN (exp > MPFR_EXP_MIN); + --exp; + } + } +diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c +--- mpfr-3.1.2-a/src/version.c 2014-06-30 15:17:53.337268149 +0000 ++++ mpfr-3.1.2-b/src/version.c 2014-06-30 15:17:53.413270206 +0000 +@@ -25,5 +25,5 @@ + const char * + mpfr_get_version (void) + { +- return "3.1.2-p9"; ++ return "3.1.2-p10"; + } +diff -Naurd mpfr-3.1.2-a/tests/tsprintf.c mpfr-3.1.2-b/tests/tsprintf.c +--- mpfr-3.1.2-a/tests/tsprintf.c 2013-11-15 00:51:49.267334408 +0000 ++++ mpfr-3.1.2-b/tests/tsprintf.c 2014-06-30 15:17:53.377269231 +0000 +@@ -1184,6 +1184,69 @@ + check_emax_aux (MPFR_EMAX_MAX); + } + ++static void ++check_emin_aux (mpfr_exp_t e) ++{ ++ mpfr_t x; ++ char *s1, s2[256]; ++ int i; ++ mpfr_exp_t emin; ++ mpz_t ee; ++ ++ MPFR_ASSERTN (e >= LONG_MIN); ++ emin = mpfr_get_emin (); ++ set_emin (e); ++ ++ mpfr_init2 (x, 16); ++ mpz_init (ee); ++ ++ mpfr_setmin (x, e); ++ mpz_set_si (ee, e); ++ mpz_sub_ui (ee, ee, 1); ++ ++ i = mpfr_asprintf (&s1, "%Ra", x); ++ MPFR_ASSERTN (i > 0); ++ ++ gmp_snprintf (s2, 256, "0x1p%Zd", ee); ++ ++ if (strcmp (s1, s2) != 0) ++ { ++ printf ("Error in check_emin_aux for emin = %ld\n", (long) e); ++ printf ("Expected %s\n", s2); ++ printf ("Got %s\n", s1); ++ exit (1); ++ } ++ ++ mpfr_free_str (s1); ++ ++ i = mpfr_asprintf (&s1, "%Rb", x); ++ MPFR_ASSERTN (i > 0); ++ ++ gmp_snprintf (s2, 256, "1p%Zd", ee); ++ ++ if (strcmp (s1, s2) != 0) ++ { ++ printf ("Error in check_emin_aux for emin = %ld\n", (long) e); ++ printf ("Expected %s\n", s2); ++ printf ("Got %s\n", s1); ++ exit (1); ++ } ++ ++ mpfr_free_str (s1); ++ ++ mpfr_clear (x); ++ mpz_clear (ee); ++ set_emin (emin); ++} ++ ++static void ++check_emin (void) ++{ ++ check_emin_aux (-15); ++ check_emin_aux (mpfr_get_emin ()); ++ check_emin_aux (MPFR_EMIN_MIN); ++} ++ + int + main (int argc, char **argv) + { +@@ -1203,6 +1266,7 @@ + decimal (); + mixed (); + check_emax (); ++ check_emin (); + + #if defined(HAVE_LOCALE_H) && defined(HAVE_SETLOCALE) + locale_da_DK (); diff --git a/stage1/hv-install-2 b/stage1/hv-install-2 index d3e961a..467109d 100755 --- a/stage1/hv-install-2 +++ b/stage1/hv-install-2 @@ -9,7 +9,7 @@ init_log_file # Building temporary system ipkg ${GMP} "--enable-cxx" -ipkg ${MPFR} "--enable-shared" +ipkg ${MPFR} ipkg ${MPC} ipkg ${ISL} ipkg ${CLOOG} "\ diff --git a/stage1/patches/common/mpfr-3.1.2-fixes-4.patch b/stage1/patches/common/mpfr-3.1.2-fixes-4.patch new file mode 120000 index 0000000..295e9c1 --- /dev/null +++ b/stage1/patches/common/mpfr-3.1.2-fixes-4.patch @@ -0,0 +1 @@ +../../../stage0/patches/common/mpfr-3.1.2-fixes-4.patch \ No newline at end of file diff --git a/stage2/hv-install-1 b/stage2/hv-install-1 index b1d2ca2..8d2aebd 100755 --- a/stage2/hv-install-1 +++ b/stage2/hv-install-1 @@ -20,7 +20,7 @@ export CXX="g++ -isystem /usr/include" export LDFLAGS="-Wl,-rpath-link,/lib" ipkg ${GMP} "--enable-cxx" -ipkg ${MPFR} "--enable-shared --with-gmp=/usr" +ipkg ${MPFR} "--with-gmp=/usr" ipkg ${MPC} ipkg ${ISL} ipkg ${CLOOG} "--with-isl=system" diff --git a/stage2/patches/common/mpfr-3.1.2-fixes-3.patch b/stage2/patches/common/mpfr-3.1.2-fixes-3.patch deleted file mode 120000 index f58c659..0000000 --- a/stage2/patches/common/mpfr-3.1.2-fixes-3.patch +++ /dev/null @@ -1 +0,0 @@ -../../../stage0/patches/common/mpfr-3.1.2-fixes-3.patch \ No newline at end of file diff --git a/stage2/patches/common/mpfr-3.1.2-fixes-4.patch b/stage2/patches/common/mpfr-3.1.2-fixes-4.patch new file mode 120000 index 0000000..295e9c1 --- /dev/null +++ b/stage2/patches/common/mpfr-3.1.2-fixes-4.patch @@ -0,0 +1 @@ +../../../stage0/patches/common/mpfr-3.1.2-fixes-4.patch \ No newline at end of file -- 2.20.1