[PATCH] acinclude.m4: fix __builtin_alloca availability test
Yann Droneaud
yann at droneaud.fr
Fri Dec 4 10:34:04 CET 2009
Le jeudi 03 décembre 2009 à 21:48 +0100, Torbjorn Granlund a écrit :
> Yann Droneaud <yann at droneaud.fr> writes:
>
> # HG changeset patch
> # User Yann Droneaud <yann at droneaud.fr>
> # Date 1259853333 18000
> # Node ID 3081e11883a3f2169a893e4f224d046f1f8ac93f
> # Parent 5f710b3ff8457795a4e376281561c1aeeee1d3d4
> acinclude.m4: fix __builtin_alloca availability test
>
> Use GMP_PROG_CC_WORKS_PART() instead of GMP_PROG_CC_WORKS_PART_TEST()
> otherwise main() is not declared and the test program failed to link
>
> diff -r 5f710b3ff845 -r 3081e11883a3 acinclude.m4
> --- a/acinclude.m4 Thu Dec 03 15:00:04 2009 +0100
> +++ b/acinclude.m4 Thu Dec 03 10:15:33 2009 -0500
> @@ -548,7 +548,7 @@
>
> # __builtin_alloca is not available everywhere, check it exists before
> # seeing that it works
> -GMP_PROG_CC_WORKS_PART_TEST([$1],[__builtin_alloca availability],
> +GMP_PROG_CC_WORKS_PART([$1],[__builtin_alloca availability],
> [int k; int foo () { __builtin_alloca (k); }],
> [GMP_PROG_CC_WORKS_PART([$1], [alloca array],
> [/* The following provokes an internal compiler error from Itanium HP-UX cc
>
> This confuses me.
>
> There is a main generated for this test, please see the generated
> configure.
>
Seems not:
"
# __builtin_alloca is not available everywhere, check it exists before
# seeing that it works
if test "$gmp_prog_cc_works" = yes; then
# remove anything that might look like compiler output to our "||"
expression
rm -f conftest* a.out b.out a.exe a_out.exe
cat >conftest.c <<EOF
int k; int foo () { __builtin_alloca (k); }
EOF
echo "Test compile: __builtin_alloca availability" >&5
gmp_compile="$cc $cflags $cppflags conftest.c >&5"
"
So it will always fail at link time.
Regards.
--
Yann Droneaud
More information about the gmp-devel
mailing list