patches/gmp/4.3.1/110-unbounded-alloc.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Sep 12 23:51:25 2010 +0200 (2010-09-12)
changeset 2123 ff2181adbd28
permissions -rw-r--r--
cc/gcc: disable complibs if not selected

Force gcc to not link with some companion libraries when
there are not needed (because selected-out).

There is no option to tell gcc *not* to build the Graphite and/or
LTO stuff. They *will* be built if gcc finds the suitable companion
libraries. If we do not provide them, but the host has them, then
gcc *will* find them, and link with them.

Consider the following:
- host has suitable PPL and CLooG (eg. Debian Squeeze)
- user wants to build gcc>=4.4
- user de-selects GRAPHITE
- gcc will find the hosts PPL and CLooG, and will use them
- the user moves the toolchain to an older host that does
not have them (eg. Debian Lenny)
- the toolchain fails, when it was properly setup not to

So, explicitly tell gcc *not* to use unneeded companion libs.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@1440
     1
diff --git a/mpn/generic/toom44_mul.c b/mpn/generic/toom44_mul.c
yann@1440
     2
--- a/mpn/generic/toom44_mul.c
yann@1440
     3
+++ b/mpn/generic/toom44_mul.c
yann@1440
     4
@@ -116,17 +116,16 @@
yann@1440
     5
 
yann@1440
     6
   TMP_MARK;
yann@1440
     7
 
yann@1440
     8
-  as1  = TMP_SALLOC_LIMBS (n + 1);
yann@1440
     9
-  asm1 = TMP_SALLOC_LIMBS (n + 1);
yann@1440
    10
-  as2  = TMP_SALLOC_LIMBS (n + 1);
yann@1440
    11
-  ash  = TMP_SALLOC_LIMBS (n + 1);
yann@1440
    12
-  asmh = TMP_SALLOC_LIMBS (n + 1);
yann@1440
    13
-
yann@1440
    14
-  bs1  = TMP_SALLOC_LIMBS (n + 1);
yann@1440
    15
-  bsm1 = TMP_SALLOC_LIMBS (n + 1);
yann@1440
    16
-  bs2  = TMP_SALLOC_LIMBS (n + 1);
yann@1440
    17
-  bsh  = TMP_SALLOC_LIMBS (n + 1);
yann@1440
    18
-  bsmh = TMP_SALLOC_LIMBS (n + 1);
yann@1440
    19
+  as1  = TMP_ALLOC_LIMBS (10 * n + 10);
yann@1440
    20
+  asm1 = as1  + n + 1;
yann@1440
    21
+  as2  = asm1 + n + 1;
yann@1440
    22
+  ash  = as2  + n + 1;
yann@1440
    23
+  asmh = ash  + n + 1;
yann@1440
    24
+  bs1  = asmh + n + 1;
yann@1440
    25
+  bsm1 = bs1  + n + 1;
yann@1440
    26
+  bs2  = bsm1 + n + 1;
yann@1440
    27
+  bsh  = bs2  + n + 1;
yann@1440
    28
+  bsmh = bsh  + n + 1;
yann@1440
    29
 
yann@1440
    30
   gp = pp;
yann@1440
    31
   hp = pp + n + 1;