- Fix build on sparc64

Approved by:	Maintainer, miwi (mentor)
This commit is contained in:
Pietro Cerutti 2008-03-07 13:25:51 +00:00
parent 009dcfa86c
commit 109767af8a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=208576
2 changed files with 109 additions and 14 deletions

View File

@ -29,8 +29,9 @@ CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
GUILE_VER= 1.8
PLIST_SUB= GUILE_VER=${GUILE_VER}
REINPLACE_FILES= libguile/gc.c libguile/mallocs.c \
libguile/ports.c libguile/smob.c
REINPLACE_FILES= libguile/smob.c libguile/filesys.c libguile/gc.c \
libguile/mallocs.c libguile/eval.c libguile/gc-malloc.c \
libguile/ports.c libguile/gc-mark.c libguile/gc_os_dep.c
INFO= goops guile-tut guile r5rs
@ -45,6 +46,5 @@ post-patch:
${REINPLACE_CMD} -e 's|<malloc\.h>|<stdlib.h>|g' ${REINPLACE_FILES}
@${REINPLACE_CMD} -e 's|%%X11BASE%%|${X11BASE}|g ; \
s|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/libguile/load.c
@${REINPLACE_CMD} -e 's^sparc-\*-\*^sparc-*-*|sparc64-*-*^' ${WRKSRC}/configure
.include <bsd.port.post.mk>

View File

@ -1,21 +1,19 @@
--- libguile/gc_os_dep.c 2008-02-23 18:14:28.087264270 -0600
+++ libguile/gc_os_dep.c 2008-02-23 18:22:25.194095724 -0600
@@ -115,6 +115,14 @@
--- libguile/gc_os_dep.c.orig 2008-02-16 19:50:24.000000000 +0100
+++ libguile/gc_os_dep.c 2008-03-06 16:21:40.000000000 +0100
@@ -115,6 +115,12 @@
# define NETBSD
# define mach_type_known
# endif
+# if defined(__FreeBSD__) && defined(__sparc__)
+# define SPARC
+# define FREEBSD
+# include <machine/frame.h>
+# define ALIGNMENT 8
+# define CPP_WORDSZ 64
+# define ALIGN_DOUBLE
+# define mach_type_known
+# endif
# if defined(__NetBSD__) && defined(__powerpc__)
# define POWERPC
# define NETBSD
@@ -249,7 +257,21 @@
@@ -249,7 +255,21 @@
# define ARM32
# define mach_type_known
# endif
@ -38,7 +36,24 @@
# define ALPHA
# if !defined(LINUX) && !defined (NETBSD)
# define OSF1 /* a.k.a Digital Unix */
@@ -1159,6 +1181,13 @@
@@ -701,8 +721,6 @@
# ifdef SPARC
# define MACH_TYPE "SPARC"
-# define ALIGNMENT 4 /* Required by hardware */
-# define ALIGN_DOUBLE
extern int etext;
# ifdef SUNOS5
# define OS_TYPE "SUNOS5"
@@ -750,7 +768,6 @@
# define DYNAMIC_LOADING
# endif
# ifdef DRSNX
-# define CPP_WORDSZ 32
# define OS_TYPE "DRSNX"
extern char * GC_SysVGetDataStart();
extern int etext;
@@ -1159,6 +1176,13 @@
# endif
# endif
@ -52,16 +67,24 @@
# ifdef IA64
# define MACH_TYPE "IA64"
# define ALIGN_DOUBLE
@@ -1504,7 +1533,7 @@
@@ -1504,8 +1528,15 @@
# include <setjmp.h>
#endif
-#ifdef FREEBSD
+#if defined(FREEBSD) && defined(I386)
# include <machine/trap.h>
+# define ALIGNMENT 4
+# define CPP_WORDSZ 32
+#endif
+
+#if defined(FREEBSD) && defined(SPARC)
+# define ALIGNMENT 8
+# define ALIGN_DOUBLE
#endif
@@ -1537,7 +1566,7 @@
#ifdef AMIGA
@@ -1537,7 +1568,7 @@
#endif
#ifdef SUNOS5SIGS
@ -70,4 +93,76 @@
# undef setjmp
# undef longjmp
# define setjmp(env) sigsetjmp(env, 1)
Only in guile-1.8.4/libguile: gc_os_dep.c.orig
@@ -1716,11 +1747,13 @@
/* static */ jmp_buf GC_jmp_buf;
/*ARGSUSED*/
+#if !(defined(FREEBSD) && defined(SPARC))
static void GC_fault_handler(sig)
int sig;
{
longjmp(GC_jmp_buf, 1);
}
+#endif
# ifdef __STDC__
typedef void (*handler)(int);
@@ -1728,6 +1761,7 @@
typedef void (*handler)();
# endif
+#if !(defined(FREEBSD) && defined(SPARC))
# if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1)
static struct sigaction old_segv_act;
# if defined(_sigargs) || defined(HPUX) /* !Irix6.x */
@@ -1736,7 +1770,9 @@
# else
static handler old_segv_handler, old_bus_handler;
# endif
+#endif
+#if !(defined(FREEBSD) && defined(SPARC))
static void GC_setup_temporary_fault_handler()
{
# if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1)
@@ -1773,7 +1809,9 @@
# endif
# endif
}
+#endif
+#if !(defined(FREEBSD) && defined(SPARC))
static void GC_reset_fault_handler()
{
# if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1)
@@ -1789,8 +1827,10 @@
# endif
# endif
}
+#endif
/* Single argument version, robust against whole program analysis. */
+#if !(defined(FREEBSD) && defined(SPARC))
static void
GC_noop1(x)
word x;
@@ -1798,9 +1838,11 @@
static VOLATILE word sink;
sink = x;
}
+#endif
/* Return the first nonaddressible location > p (up) or */
/* the smallest location q s.t. [q,p] is addressible (!up). */
+#if !(defined(FREEBSD) && defined(SPARC))
static ptr_t GC_find_limit(p, up)
ptr_t p;
GC_bool up;
@@ -1831,6 +1873,7 @@
}
return(result);
}
+#endif
# endif