summaryrefslogtreecommitdiff
path: root/util/crossgcc/patches/gmp-6.3.0_generic-build.patch
blob: a05635f1d150c1597a54e6975c40d993aa1e95eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Ensure that GMP is built for a generic CPU on x86

While GMP supports fat builds on x86 that adapt to the CPU's
capabilities, by default it builds for the CPU of the builder.
Running that binary on an older CPU then can fail.
--- gmp-6.2.0/config.guess~	2020-09-02 19:23:01.817510842 +0200
+++ gmp-6.2.0/config.guess	2020-09-02 19:24:55.742325907 +0200
@@ -1029,6 +1029,12 @@
        virtualisers allow guests to set a broken state.  */
     suffix = "noavx";

+  if (cpuid_64bit) {
+    modelstr="x86_64";
+  } else {
+    modelstr="pentium";
+  }
+  suffix="";
   printf ("%s%s", modelstr, suffix);
   return 0;
 }