commit 7167f24fc993ae6f1a3a5ee9800ed2fa9fdc6874
Author: Georg Koppen <g.koppen(a)jondos.de>
Date: Mon Nov 11 14:01:15 2013 +0100
rebased patch 931043 to avoid breaking 64bit cross-compiled builds due to wrong va_list handling
---
configure.in | 69 +++++++++++++++------------------------------------
js/src/configure.in | 68 +++++++++++++++-----------------------------------
2 files changed, 40 insertions(+), 97 deletions(-)
diff --git a/configure.in b/configure.in
index ddc813a..7569b26 100644
--- a/configure.in
+++ b/configure.in
@@ -3416,13 +3416,10 @@ AC_LANG_C
dnl **********************
dnl *** va_copy checks ***
-dnl **********************
-dnl we currently check for all three va_copy possibilities, so we get
-dnl all results in config.log for bug reports.
-AC_MSG_CHECKING(for an implementation of va_copy())
-AC_CACHE_VAL(ac_cv_va_copy,[
- AC_TRY_RUN([
- #include <stdarg.h>
+AC_CACHE_CHECK([for an implementation of va_copy()],
+ ac_cv_va_copy,
+ [AC_TRY_COMPILE([#include <stdarg.h>
+ #include <stdlib.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
@@ -3430,37 +3427,16 @@ AC_CACHE_VAL(ac_cv_va_copy,[
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
exit (1);
va_end (args1); va_end (args2);
- }
- int main() { f (0, 42); return 0; }],
- ac_cv_va_copy=yes,
- ac_cv_va_copy=no,
- ac_cv_va_copy=no
- )
-])
-AC_MSG_RESULT($ac_cv_va_copy)
-AC_MSG_CHECKING(for an implementation of __va_copy())
-AC_CACHE_VAL(ac_cv___va_copy,[
- AC_TRY_RUN([
- #include <stdarg.h>
- void f (int i, ...) {
- va_list args1, args2;
- va_start (args1, i);
- __va_copy (args2, args1);
- if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
- exit (1);
- va_end (args1); va_end (args2);
- }
- int main() { f (0, 42); return 0; }],
- ac_cv___va_copy=yes,
- ac_cv___va_copy=no,
- ac_cv___va_copy=no
- )
-])
-AC_MSG_RESULT($ac_cv___va_copy)
-AC_MSG_CHECKING(whether va_lists can be copied by value)
-AC_CACHE_VAL(ac_cv_va_val_copy,[
- AC_TRY_RUN([
- #include <stdarg.h>
+ }],
+ [f(0, 42); return 0],
+ [ac_cv_va_copy=yes],
+ [ac_cv_va_copy=no]
+ )]
+)
+AC_CACHE_CHECK([whether va_list can be copied by value],
+ ac_cv_va_val_copy,
+ [AC_TRY_COMPILE([#include <stdarg.h>
+ #include <stdlib.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
@@ -3468,25 +3444,20 @@ AC_CACHE_VAL(ac_cv_va_val_copy,[
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
exit (1);
va_end (args1); va_end (args2);
- }
- int main() { f (0, 42); return 0; }],
- ac_cv_va_val_copy=yes,
- ac_cv_va_val_copy=no,
- ac_cv_va_val_copy=yes
- )
-])
+ }],
+ [f(0, 42); return 0],
+ [ac_cv_va_val_copy=yes],
+ [ac_cv_va_val_copy=no],
+ )]
+)
if test "x$ac_cv_va_copy" = "xyes"; then
AC_DEFINE(VA_COPY, va_copy)
AC_DEFINE(HAVE_VA_COPY)
-elif test "x$ac_cv___va_copy" = "xyes"; then
- AC_DEFINE(VA_COPY, __va_copy)
- AC_DEFINE(HAVE_VA_COPY)
fi
if test "x$ac_cv_va_val_copy" = "xno"; then
AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
fi
-AC_MSG_RESULT($ac_cv_va_val_copy)
dnl ===================================================================
dnl ========================================================
diff --git a/js/src/configure.in b/js/src/configure.in
index 183b9de..46a076c 100644
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -2778,12 +2778,10 @@ AC_LANG_C
dnl **********************
dnl *** va_copy checks ***
dnl **********************
-dnl we currently check for all three va_copy possibilities, so we get
-dnl all results in config.log for bug reports.
-AC_MSG_CHECKING(for an implementation of va_copy())
-AC_CACHE_VAL(ac_cv_va_copy,[
- AC_TRY_RUN([
- #include <stdarg.h>
+AC_CACHE_CHECK([for an implementation of va_copy()],
+ ac_cv_va_copy,
+ [AC_TRY_COMPILE([#include <stdarg.h>
+ #include <stdlib.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
@@ -2791,37 +2789,16 @@ AC_CACHE_VAL(ac_cv_va_copy,[
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
exit (1);
va_end (args1); va_end (args2);
- }
- int main() { f (0, 42); return 0; }],
- ac_cv_va_copy=yes,
- ac_cv_va_copy=no,
- ac_cv_va_copy=no
- )
-])
-AC_MSG_RESULT($ac_cv_va_copy)
-AC_MSG_CHECKING(for an implementation of __va_copy())
-AC_CACHE_VAL(ac_cv___va_copy,[
- AC_TRY_RUN([
- #include <stdarg.h>
- void f (int i, ...) {
- va_list args1, args2;
- va_start (args1, i);
- __va_copy (args2, args1);
- if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
- exit (1);
- va_end (args1); va_end (args2);
- }
- int main() { f (0, 42); return 0; }],
- ac_cv___va_copy=yes,
- ac_cv___va_copy=no,
- ac_cv___va_copy=no
- )
-])
-AC_MSG_RESULT($ac_cv___va_copy)
-AC_MSG_CHECKING(whether va_lists can be copied by value)
-AC_CACHE_VAL(ac_cv_va_val_copy,[
- AC_TRY_RUN([
- #include <stdarg.h>
+ }],
+ [f(0, 42); return 0],
+ [ac_cv_va_copy=yes],
+ [ac_cv_va_copy=no]
+ )]
+)
+AC_CACHE_CHECK([whether va_list can be copied by value],
+ ac_cv_va_val_copy,
+ [AC_TRY_COMPILE([#include <stdarg.h>
+ #include <stdlib.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
@@ -2829,25 +2806,20 @@ AC_CACHE_VAL(ac_cv_va_val_copy,[
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
exit (1);
va_end (args1); va_end (args2);
- }
- int main() { f (0, 42); return 0; }],
- ac_cv_va_val_copy=yes,
- ac_cv_va_val_copy=no,
- ac_cv_va_val_copy=yes
- )
-])
+ }],
+ [f(0, 42); return 0],
+ [ac_cv_va_val_copy=yes],
+ [ac_cv_va_val_copy=no],
+ )]
+)
if test "x$ac_cv_va_copy" = "xyes"; then
AC_DEFINE(VA_COPY, va_copy)
AC_DEFINE(HAVE_VA_COPY)
-elif test "x$ac_cv___va_copy" = "xyes"; then
- AC_DEFINE(VA_COPY, __va_copy)
- AC_DEFINE(HAVE_VA_COPY)
fi
if test "x$ac_cv_va_val_copy" = "xno"; then
AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
fi
-AC_MSG_RESULT($ac_cv_va_val_copy)
dnl ===================================================================
dnl ========================================================