[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CVS-060720 compilation failure on Solaris 10, patch
From: |
Claes Wallin |
Subject: |
Re: CVS-060720 compilation failure on Solaris 10, patch |
Date: |
Thu, 20 Jul 2006 14:29:14 +0200 |
User-agent: |
Thunderbird 1.5.0.4 (Macintosh/20060516) |
Claes Wallin wrote:
> Updated patch coming up. Thanks again for your guidance.
And here it is.
/c
2006-07-20 Claes Wallin <address@hidden>
Make guile compile om Solaris 10.
* configure.in:
Demand C99 for math functions.
Check for pthread_getattr_np, which only (?) exists on
glibc platforms.
* libguile/threads.c:
include <string.h> (FD_ZERO on Solaris needs this)
(get_thread_stack_base): Don't try to compile this function
if pthread_getattr_np doesn't exist.
* libguile/eval.c:
* libguile/filesys.c:
Updated alloca section to latest autoconf standards.
* libguile/posix.c:
Declare sethostname on __sun__.
* libguile/pthreads-threads.h:
Add missing brackets around PTHREAD_ONCE_INIT on __sun__.
Some platforms (like Solaris 10) lack the pthread functions to
get at stack attributes based on thread id. These platforms
can't support scm_init_guile. Changing tests to using
scm_boot_guile() to enable testing on these platforms.
* test-suite/standalone/test-conversion.c:
* test-suite/standalone/test-gh.c:
* test-suite/standalone/test-list.c:
* test-suite/standalone/test-num2integral.c:
* test-suite/standalone/test-round.c:
(main): Changed usage of scm_init_guile to scm_boot_guile.
* test-suite/standalone/test-conversion.c:
* test-suite/standalone/test-num2integral.c:
(main): Moved tests to tests() for use with scm_boot_guile().
(tests): New function
* test-suite/standalone/test-list.c:
Make test_scm_list() conform to scm_boot_guile() main_func
parameter. scm_boot_guile() should really be taking
void (*main_func)(void *closure, int argc, char **argv),
but save that for another patch.
* test-suite/standalone/test-require-extension:
"!" not understood by /bin/sh on Solaris 10
diff -ur ../guile-core/configure.in ./configure.in
--- ../guile-core/configure.in 2006-06-18 01:15:59.000000000 +0200
+++ ./configure.in 2006-07-20 06:16:34.000000000 +0200
@@ -59,6 +59,7 @@
AC_PROG_INSTALL
AC_PROG_CC
+AC_PROG_CC_C99
AC_PROG_CPP
AC_PROG_AWK
@@ -66,8 +67,6 @@
AC_ISC_POSIX
AC_MINIX
-AM_PROG_CC_STDC
-
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_CHECK_LIB([ltdl], [lt_dlinit], ,
@@ -1006,7 +1006,7 @@
old_CFLAGS="$CFLAGS"
CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
- AC_CHECK_FUNCS(pthread_attr_getstack)
+ AC_CHECK_FUNCS([[pthread_attr_getstack pthread_getattr_np]])
CFLAGS="$old_CFLAGS"
# On Solaris, sched_yield lives in -lrt.
diff -ur ../guile-core/libguile/eval.c ./libguile/eval.c
--- ../guile-core/libguile/eval.c 2006-06-18 01:05:03.000000000 +0200
+++ ./libguile/eval.c 2006-07-20 12:49:17.000000000 +0200
@@ -40,19 +40,24 @@
/* AIX requires this to be the first thing in the file. The #pragma
directive is indented so pre-ANSI compilers will ignore it, rather
than choke on it. */
-#ifndef __GNUC__
-# if HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
-# pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-# endif
-# endif
+
+#if HAVE_ALLOCA_H
+# include <alloca.h>
+#elif defined __GNUC__
+# define alloca __builtin_alloca
+#elif defined _AIX
+# define alloca __alloca
+#elif defined _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+#else
+# include <stddef.h>
+# ifdef __cplusplus
+extern "C"
# endif
+void *alloca (size_t);
#endif
+
#if HAVE_MALLOC_H
#include <malloc.h> /* alloca on mingw */
#endif
diff -ur ../guile-core/libguile/filesys.c ./libguile/filesys.c
--- ../guile-core/libguile/filesys.c 2006-06-18 01:05:03.000000000 +0200
+++ ./libguile/filesys.c 2006-07-20 12:50:00.000000000 +0200
@@ -32,19 +32,24 @@
/* AIX requires this to be the first thing in the file. The #pragma
directive is indented so pre-ANSI compilers will ignore it, rather
than choke on it. */
-#ifndef __GNUC__
-# if HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
-# pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-# endif
-# endif
+
+#if HAVE_ALLOCA_H
+# include <alloca.h>
+#elif defined __GNUC__
+# define alloca __builtin_alloca
+#elif defined _AIX
+# define alloca __alloca
+#elif defined _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+#else
+# include <stddef.h>
+# ifdef __cplusplus
+extern "C"
# endif
+void *alloca (size_t);
#endif
+
#if HAVE_MALLOC_H
#include <malloc.h> /* alloca on mingw, though its not used on that system */
#endif
diff -ur ../guile-core/libguile/posix.c ./libguile/posix.c
--- ../guile-core/libguile/posix.c 2006-06-18 01:05:03.000000000 +0200
+++ ./libguile/posix.c 2006-07-20 05:23:30.000000000 +0200
@@ -65,6 +65,10 @@
#endif
#endif
+#ifdef __sun__
+int sethostname(char *name, int namelen);
+#endif
+
#ifdef LIBC_H_WITH_UNISTD_H
#include <libc.h>
#endif
diff -ur ../guile-core/libguile/pthread-threads.h ./libguile/pthread-threads.h
--- ../guile-core/libguile/pthread-threads.h 2006-04-17 02:05:40.000000000
+0200
+++ ./libguile/pthread-threads.h 2006-07-20 05:20:11.000000000 +0200
@@ -66,9 +66,15 @@
/* Onces
*/
#define scm_i_pthread_once_t pthread_once_t
-#define SCM_I_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
#define scm_i_pthread_once pthread_once
+#ifdef __sun__
+/* workaround for broken Solaris 10 headers */
+#define SCM_I_PTHREAD_ONCE_INIT { PTHREAD_ONCE_INIT }
+#else /* !__sun__ */
+#define SCM_I_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
+#endif /* !__sun__ */
+
/* Thread specific storage
*/
#define scm_i_pthread_key_t pthread_key_t
diff -ur ../guile-core/libguile/threads.c ./libguile/threads.c
--- ../guile-core/libguile/threads.c 2006-04-17 02:05:42.000000000 +0200
+++ ./libguile/threads.c 2006-07-20 14:15:59.000000000 +0200
@@ -30,6 +30,9 @@
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
+#if HAVE_STRING_H && defined(__sun__) /* On Solaris 10, FD_ZERO uses memset */
+#include <string.h>
+#endif
#include "libguile/validate.h"
#include "libguile/root.h"
@@ -567,6 +570,7 @@
#if SCM_USE_PTHREAD_THREADS
#ifdef HAVE_PTHREAD_ATTR_GETSTACK
+#ifdef HAVE_PTHREAD_GETATTR_NP
#define HAVE_GET_THREAD_STACK_BASE
@@ -600,6 +604,7 @@
}
}
+#endif /* HAVE_PTHREAD_GETATTR_NP */
#endif /* HAVE_PTHREAD_ATTR_GETSTACK */
#else /* !SCM_USE_PTHREAD_THREADS */
diff -ur ../guile-core/test-suite/standalone/test-conversion.c
./test-suite/standalone/test-conversion.c
--- ../guile-core/test-suite/standalone/test-conversion.c 2006-04-17
01:27:13.000000000 +0200
+++ ./test-suite/standalone/test-conversion.c 2006-07-20 13:50:21.000000000
+0200
@@ -1010,10 +1010,9 @@
test_11 ("(string #\\f #\\nul)", NULL, 1, 0);
}
-int
-main (int argc, char *argv[])
+static void
+tests ()
{
- scm_init_guile();
test_is_signed_integer ();
test_is_unsigned_integer ();
test_to_signed_integer ();
@@ -1024,5 +1023,11 @@
test_from_double ();
test_to_double ();
test_locale_strings ();
+}
+
+int
+main (int argc, char *argv[])
+{
+ scm_boot_guile(argc, argv, tests, NULL);
return 0;
}
diff -ur ../guile-core/test-suite/standalone/test-gh.c
./test-suite/standalone/test-gh.c
--- ../guile-core/test-suite/standalone/test-gh.c 2006-04-17
01:27:13.000000000 +0200
+++ ./test-suite/standalone/test-gh.c 2006-07-20 04:34:28.000000000 +0200
@@ -70,8 +70,7 @@
int
main (int argc, char *argv[])
{
- scm_init_guile ();
- test_gh_set_substr ();
+ scm_boot_guile(argc, argv, test_gh_set_substr, NULL);
return 0;
}
diff -ur ../guile-core/test-suite/standalone/test-list.c
./test-suite/standalone/test-list.c
--- ../guile-core/test-suite/standalone/test-list.c 2006-02-04
00:34:48.000000000 +0100
+++ ./test-suite/standalone/test-list.c 2006-07-20 04:42:12.000000000 +0200
@@ -26,7 +26,7 @@
/* pretty trivial, but ensure this entrypoint exists, since it was
documented in Guile 1.6 and earlier */
static void
-test_scm_list (void)
+test_scm_list ()
{
{
if (! scm_is_eq (SCM_EOL, scm_list (SCM_EOL)))
@@ -49,7 +49,6 @@
int
main (int argc, char **argv)
{
- scm_init_guile();
- test_scm_list ();
+ scm_boot_guile(argc, argv, test_scm_list, NULL);
return 0;
}
diff -ur ../guile-core/test-suite/standalone/test-num2integral.c
./test-suite/standalone/test-num2integral.c
--- ../guile-core/test-suite/standalone/test-num2integral.c 2006-04-17
01:27:13.000000000 +0200
+++ ./test-suite/standalone/test-num2integral.c 2006-07-20 13:36:51.000000000
+0200
@@ -141,12 +141,17 @@
#endif /* SCM_SIZEOF_LONG_LONG != 0 */
}
-int
-main (int argc, char *argv[])
+static void
+tests ()
{
- scm_init_guile();
test_long_long ();
test_ulong_long ();
+}
+
+int
+main (int argc, char *argv[])
+{
+ scm_boot_guile(argc, argv, tests, NULL);
return 0;
}
diff -ur ../guile-core/test-suite/standalone/test-require-extension
./test-suite/standalone/test-require-extension
--- ../guile-core/test-suite/standalone/test-require-extension 2005-02-12
07:15:07.000000000 +0100
+++ ./test-suite/standalone/test-require-extension 2006-07-20
04:52:27.000000000 +0200
@@ -2,9 +2,9 @@
set -e
-! guile -c '(require-extension 7)' 2> /dev/null
-! guile -c '(require-extension (blarg))' 2> /dev/null
-! guile -c '(require-extension (srfi "foo"))' 2> /dev/null
+guile -c '(require-extension 7)' 2> /dev/null && exit 2
+guile -c '(require-extension (blarg))' 2> /dev/null && exit 2
+guile -c '(require-extension (srfi "foo"))' 2> /dev/null && exit 2
guile -c '(require-extension (srfi 1)) (exit (procedure? take-right))'
guile -c '(require-extension (srfi))'
diff -ur ../guile-core/test-suite/standalone/test-round.c
./test-suite/standalone/test-round.c
--- ../guile-core/test-suite/standalone/test-round.c 2006-04-17
01:27:13.000000000 +0200
+++ ./test-suite/standalone/test-round.c 2006-07-20 04:39:56.000000000
+0200
@@ -116,7 +116,6 @@
int
main (int argc, char *argv[])
{
- scm_init_guile();
- test_scm_c_round ();
+ scm_boot_guile(argc, argv, test_scm_c_round, NULL);
return 0;
}
signature.asc
Description: OpenPGP digital signature
- CVS-060720 compilation failure on Solaris 10, patch, Claes Wallin, 2006/07/19
- Re: CVS-060720 compilation failure on Solaris 10, patch, Ludovic Courtès, 2006/07/20
- Re: CVS-060720 compilation failure on Solaris 10, patch, Claes Wallin, 2006/07/20
- Re: CVS-060720 compilation failure on Solaris 10, patch,
Claes Wallin <=
- Re: CVS-060720 compilation failure on Solaris 10, patch, Kevin Ryde, 2006/07/20
- Re: CVS-060720 compilation failure on Solaris 10, patch, Claes Wallin, 2006/07/21
- Re: CVS-060720 compilation failure on Solaris 10, patch, Kevin Ryde, 2006/07/23
- Re: CVS-060720 compilation failure on Solaris 10, patch, Claes Wallin, 2006/07/24
- Re: CVS-060720 compilation failure on Solaris 10, patch, Claes Wallin, 2006/07/24
- Re: CVS-060720 compilation failure on Solaris 10, patch, Kevin Ryde, 2006/07/20
- Re: CVS-060720 compilation failure on Solaris 10, patch, Claes Wallin, 2006/07/21
- Re: CVS-060720 compilation failure on Solaris 10, patch, Kevin Ryde, 2006/07/23
- Re: CVS-060720 compilation failure on Solaris 10, patch, Claes Wallin, 2006/07/24
- Re: CVS-060720 compilation failure on Solaris 10, patch, Kevin Ryde, 2006/07/24