void-packages/srcpkgs/pari/patches/float32.patch

49 lines
1.2 KiB
Diff

Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
Date: Fri Oct 14 17:00:46 2022 -0300
Revert "x86 (32bit): force -mpc64 on compilers that supports it."
This reverts commit ca61b6391cf95ac8af15669236e2ec5839d2ad91.
This causes problems with floating point precision on i686:
```
$ cat exp40.c
#include <math.h>
#include <stdio.h>
int main() {
volatile int a=40; /* do not optimize away the call to exp(a) */
printf("%f\n", exp(a));
}
$ cc -Wall exp40.c -lm && ./a.out
235385266837020000.000000
$ cc -Wall exp40.c -lm -mpc64 && ./a.out
235385266837020448.000000
```
Note that when pari is built using -mpc64, just *linking* with -lpari
causes the problem!!!
```
$ cc -Wall exp40.c -lm -lpari && ./a.out
235385266837020448.000000
```
diff --git a/config/get_cc b/config/get_cc
index 3cfaa88bb7..2d61d3871f 100644
--- a/config/get_cc
+++ b/config/get_cc
@@ -110,13 +110,6 @@ if test -n "$__gnuc__"; then
# Specific optimisations for some architectures
case "$arch" in
sparcv8*) cflags=-mv8;;
- i?86)
- cmd="$CC $CFLAGS $extraflag -mpc64 -fno-strict-aliasing -o $exe gnu.c"
- . log_cmd
- if test -s $exe; then
- cflags="-mpc64"
- fi
- . cleanup_exe;;
esac
# problems on some architectures
case "$osname" in