summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authortege <tege@gmplib.org>2005-05-02 01:14:23 +0200
committertege <tege@gmplib.org>2005-05-02 01:14:23 +0200
commitddd32aa22fd5489e9897908453437f77a2ff9e04 (patch)
tree0d99b259012ba9a96db26147e2beead65a9247c8 /acinclude.m4
parent0cf14f20c1c1fac5549835f9c658674f07141005 (diff)
downloadgmp-ddd32aa22fd5489e9897908453437f77a2ff9e04.tar.gz
(GMP_ASM_POWERPC_PIC_ALWAYS): Handle darwin's assembly syntax.
(long long reliability test 1): New GMP_PROG_CC_WORKS_PART test. (long long reliability test 2): New GMP_PROG_CC_WORKS_PART test.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m435
1 files changed, 35 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 1cfece81e..c8719b2e3 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -584,6 +584,36 @@ int f ()
}
])
+GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 1],
+[/* The following provokes a segfault in the compiler on powerpc-apple-darwin.
+ Extracted from tests/mpn/t-iord_u.c. Causes Apple's gcc 3.3 build 1640 and
+ 1666 to segfault with e.g., -O2 -mpowerpc64. */
+
+#ifdef __GNUC__
+typedef unsigned long long t1;typedef t1*t2;
+__inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
+{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
+f(){static const struct{t1 n;t1 src[9];t1 want[9];}d[]={{1,{0},{1}},};t1 got[9];int i;
+for(i=0;i<1;i++){if(e(got,got,9,d[i].n)==0)h();g(i,d[i].src,d[i].n,got,d[i].want,9);if(d[i].n)h();}}
+h(){}g(){}
+#else
+int dummy;
+#endif
+])
+
+GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 2],
+[/* The following provokes an internal compiler error on powerpc-apple-darwin.
+ Extracted from mpz/cfdiv_q_2exp.c. Causes Apple's gcc 3.3 build 1640 and
+ 1666 to get an ICE with -O1 -mpowerpc64. */
+
+#ifdef __GNUC__
+f(int u){int i;long long x;x=u?~0:0;if(x)for(i=0;i<9;i++);x&=g();if(x)g();}
+g(){}
+#else
+int dummy;
+#endif
+])
+
GMP_PROG_CC_WORKS_PART_MAIN([$1], [mpn_lshift_com optimization],
[/* The following is mis-compiled by HP ia-64 cc version
cc: HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]
@@ -2849,6 +2879,8 @@ dnl Libtool does this by taking "*-*-aix* | *-*-darwin* | *-*-rhapsody*" to
dnl mean PIC always, but it seems more reliable to grep the compiler
dnl output.
dnl
+dnl The next paragraph is untrue for Tiger. Was it ever true? For tiger,
+dnl "cc -fast" makes non-PIC the default (and the binaries do run).
dnl On Darwin "cc -static" is non-PIC with syntax "ha16(_foo)", but that's
dnl apparently only for use in the kernel, which we're not attempting to
dnl target at the moment, so don't look for that.
@@ -2871,6 +2903,9 @@ if AC_TRY_EVAL(gmp_compile); then
if grep 'foo@ha' conftest.s >/dev/null 2>&AC_FD_CC; then
gmp_cv_asm_powerpc_pic=no
fi
+ if grep 'ha16(_foo)' conftest.s >/dev/null 2>&AC_FD_CC; then
+ gmp_cv_asm_powerpc_pic=no
+ fi
fi
rm -f conftest*
])