- Unbreak racket after the last header changes. Spotted by sthen@.

- Add minimal support for powerpc (broken). Tested on Jan Stary's macppc. Thanks!
- The additional changes are a WIP for the next version.
- Enable the assembler code again in gmplonglong for i386 and amd64.
This commit is contained in:
juanfra 2014-07-15 00:13:16 +00:00
parent e3dfc3fde1
commit cce3420c13
4 changed files with 352 additions and 21 deletions

View File

@ -1,15 +1,16 @@
# $OpenBSD: Makefile,v 1.14 2014/06/22 10:59:37 juanfra Exp $
# $OpenBSD: Makefile,v 1.15 2014/07/15 00:13:16 juanfra Exp $
BROKEN-hppa = segfault while racket compiles XFORMS (at xsrc)
BROKEN-mips64el = sigbus while racket compiles XFORMS (at xsrc)
BROKEN-powerpc = racket builds but does not pass the tests (with or without JIT)
SHARED_ONLY = Yes
ONLY_FOR_ARCHS = i386 amd64 hppa mips64el
ONLY_FOR_ARCHS = i386 amd64 hppa mips64el powerpc
COMMENT = multi-paradigm programming language
V = 6.0.1
REVISION = 0
REVISION = 1
PKGNAME = racket-$V
DISTNAME = racket-$V-src-builtpkgs

View File

@ -0,0 +1,298 @@
$OpenBSD: patch-src_racket_gc_include_private_gcconfig_h,v 1.1 2014/07/15 00:13:16 juanfra Exp $
--- src/racket/gc/include/private/gcconfig.h.orig Thu Apr 17 21:58:42 2014
+++ src/racket/gc/include/private/gcconfig.h Sat Jul 12 22:18:27 2014
@@ -815,19 +815,14 @@
# ifdef OPENBSD
# define OS_TYPE "OPENBSD"
# define ALIGNMENT 4
-# ifdef GC_OPENBSD_THREADS
-# define UTHREAD_SP_OFFSET 268
-# else
-# include <sys/param.h>
-# include <uvm/uvm_extern.h>
-# define STACKBOTTOM USRSTACK
-# endif
+# include <machine/vmparam.h> /* define USRSTACK */
+# define STACKBOTTOM USRSTACK
extern int __data_start[];
# define DATASTART ((ptr_t)(__data_start))
extern char _end[];
# define DATAEND ((ptr_t)(&_end))
# define DYNAMIC_LOADING
-# endif
+# endif /* OPENBSD */
# ifdef FREEBSD
# define ALIGNMENT 4
# define OS_TYPE "FREEBSD"
@@ -995,19 +990,14 @@
# endif
# ifdef OPENBSD
# define OS_TYPE "OPENBSD"
-# ifdef GC_OPENBSD_THREADS
-# define UTHREAD_SP_OFFSET 232
-# else
-# include <sys/param.h>
-# include <uvm/uvm_extern.h>
-# define STACKBOTTOM USRSTACK
-# endif
+# include <machine/vmparam.h> /* define USRSTACK */
+# define STACKBOTTOM USRSTACK
extern int __data_start[];
# define DATASTART ((ptr_t)(__data_start))
extern char _end[];
# define DATAEND ((ptr_t)(&_end))
# define DYNAMIC_LOADING
-# endif
+# endif /* OPENBSD */
# ifdef NETBSD
# define OS_TYPE "NETBSD"
# define HEURISTIC2
@@ -1251,20 +1241,15 @@
/* This may not be right. */
# endif
# ifdef OPENBSD
-# define OS_TYPE "OPENBSD"
-# ifdef GC_OPENBSD_THREADS
-# define UTHREAD_SP_OFFSET 176
-# else
-# include <sys/param.h>
-# include <uvm/uvm_extern.h>
-# define STACKBOTTOM USRSTACK
-# endif
- extern int __data_start[];
-# define DATASTART ((ptr_t)(__data_start))
- extern char _end[];
-# define DATAEND ((ptr_t)(&_end))
-# define DYNAMIC_LOADING
-# endif
+# define OS_TYPE "OPENBSD"
+# include <machine/vmparam.h> /* define USRSTACK */
+# define STACKBOTTOM USRSTACK
+ extern int __data_start[];
+# define DATASTART ((ptr_t)(__data_start))
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# endif /* OPENBSD */
# ifdef FREEBSD
# define OS_TYPE "FREEBSD"
# ifndef GC_FREEBSD_THREADS
@@ -1470,21 +1455,17 @@
# endif /* _ELF_ */
# endif
# ifdef OPENBSD
-# define OS_TYPE "OPENBSD"
-# define ALIGNMENT 4
-# ifdef GC_OPENBSD_THREADS
-# define UTHREAD_SP_OFFSET 808
-# else
-# include <sys/param.h>
-# include <uvm/uvm_extern.h>
-# define STACKBOTTOM USRSTACK
-# endif
- extern int _fdata[];
-# define DATASTART ((ptr_t)(_fdata))
- extern char _end[];
-# define DATAEND ((ptr_t)(&_end))
-# define DYNAMIC_LOADING
-# endif
+# define OS_TYPE "OPENBSD"
+# define CPP_WORDSZ _MIPS_SZPTR
+# define ALIGNMENT (_MIPS_SZPTR/8)
+# include <machine/vmparam.h> /* define USRSTACK */
+# define STACKBOTTOM USRSTACK
+ extern int _fdata[];
+# define DATASTART ((ptr_t)(_fdata))
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# endif /* OPENBSD */
# if defined(NONSTOP)
# define CPP_WORDSZ 32
# define OS_TYPE "NONSTOP"
@@ -1555,20 +1536,15 @@
# define DATAEND (&_end)
# endif /* LINUX */
# ifdef OPENBSD
-# define OS_TYPE "OPENBSD"
-# ifdef GC_OPENBSD_THREADS
-# define UTHREAD_SP_OFFSET 520
-# else
-# include <sys/param.h>
-# include <uvm/uvm_extern.h>
-# define STACKBOTTOM USRSTACK
-# endif
- extern int __data_start[];
-# define DATASTART ((ptr_t)(__data_start))
- extern char _end[];
-# define DATAEND ((ptr_t)(&_end))
-# define DYNAMIC_LOADING
-# endif
+# define OS_TYPE "OPENBSD"
+# include <machine/vmparam.h> /* define USRSTACK */
+# define STACKBOTTOM USRSTACK
+ extern int __data_start[];
+# define DATASTART ((ptr_t)(__data_start))
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# endif /* OPENBSD */
# endif /* HP_PA */
# ifdef ALPHA
@@ -1585,21 +1561,16 @@
# define DYNAMIC_LOADING
# endif
# ifdef OPENBSD
-# define OS_TYPE "OPENBSD"
-# define ELF_CLASS ELFCLASS64
-# ifdef GC_OPENBSD_THREADS
-# define UTHREAD_SP_OFFSET 816
-# else
-# include <sys/param.h>
-# include <uvm/uvm_extern.h>
-# define STACKBOTTOM USRSTACK
-# endif
- extern int __data_start[];
-# define DATASTART ((ptr_t)(__data_start))
- extern char _end[];
-# define DATAEND ((ptr_t)(&_end))
-# define DYNAMIC_LOADING
-# endif
+# define OS_TYPE "OPENBSD"
+# define ELF_CLASS ELFCLASS64
+# include <machine/vmparam.h> /* define USRSTACK */
+# define STACKBOTTOM USRSTACK
+ extern int __data_start[];
+# define DATASTART ((ptr_t)(__data_start))
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# endif /* OPENBSD */
# ifdef FREEBSD
# define OS_TYPE "FREEBSD"
/* MPROTECT_VDB is not yet supported at all on FreeBSD/alpha. */
@@ -1869,19 +1840,14 @@
# ifdef OPENBSD
# define ALIGNMENT 4
# define OS_TYPE "OPENBSD"
-# ifdef GC_OPENBSD_THREADS
-# define UTHREAD_SP_OFFSET 176
-# else
-# include <sys/param.h>
-# include <uvm/uvm_extern.h>
-# define STACKBOTTOM USRSTACK
-# endif
- extern int __data_start[];
-# define DATASTART ((ptr_t)(__data_start))
- extern char _end[];
-# define DATAEND ((ptr_t)(&_end))
-# define DYNAMIC_LOADING
-# endif
+# include <machine/vmparam.h> /* define USRSTACK */
+# define STACKBOTTOM USRSTACK
+ extern int __data_start[];
+# define DATASTART ((ptr_t)(__data_start))
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# endif /* OPENBSD */
# ifdef NOSYS
/* __data_start is usually defined in the target linker script. */
extern int __data_start[];
@@ -1926,20 +1892,15 @@
# define DYNAMIC_LOADING
# endif
# ifdef OPENBSD
-# define OS_TYPE "OPENBSD"
-# ifdef GC_OPENBSD_THREADS
-# define UTHREAD_SP_OFFSET 332
-# else
-# include <sys/param.h>
-# include <uvm/uvm_extern.h>
-# define STACKBOTTOM USRSTACK
-# endif
- extern int __data_start[];
-# define DATASTART ((ptr_t)(__data_start))
- extern char _end[];
-# define DATAEND ((ptr_t)(&_end))
-# define DYNAMIC_LOADING
-# endif
+# define OS_TYPE "OPENBSD"
+# include <machine/vmparam.h> /* define USRSTACK */
+# define STACKBOTTOM USRSTACK
+ extern int __data_start[];
+# define DATASTART ((ptr_t)(__data_start))
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# endif /* OPENBSD */
# endif
# ifdef SH4
@@ -1973,22 +1934,17 @@
# define HBLKSIZE 4096
# endif
# ifdef OPENBSD
-# define OS_TYPE "OPENBSD"
-# define ELF_CLASS ELFCLASS64
-# ifdef GC_OPENBSD_THREADS
-# define UTHREAD_SP_OFFSET 400
-# else
-# include <sys/param.h>
-# include <uvm/uvm_extern.h>
-# define STACKBOTTOM USRSTACK
-# endif
- extern int __data_start[];
+# define OS_TYPE "OPENBSD"
+# define ELF_CLASS ELFCLASS64
+# include <machine/vmparam.h> /* define USRSTACK */
+# define STACKBOTTOM USRSTACK
+ extern int __data_start[];
/* PLTSCHEME: commented out these two: */
/*# define DATASTART ((ptr_t)(__data_start)) */
/* extern char _end[]; */
-# define DATAEND ((ptr_t)(&_end))
-# define DYNAMIC_LOADING
-# endif
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# endif /* OPENBSD */
# define CACHE_LINE_SIZE 64
# ifdef LINUX
# define OS_TYPE "LINUX"
@@ -2077,6 +2033,7 @@
# if defined(NETBSD) || defined(OPENBSD)
# ifdef NETBSD
# define OS_TYPE "NETBSD"
+# define HEURISTIC2
# endif
# ifdef OPENBSD
# define OS_TYPE "OPENBSD"
@@ -2084,7 +2041,6 @@
# ifdef __ELF__
# define DYNAMIC_LOADING
# endif
-# define HEURISTIC2
extern char etext[];
# define SEARCH_FOR_DATA_START
# endif
@@ -2143,7 +2099,7 @@
# endif
# define DATAEND /* not needed */
# endif
-# endif
+# endif /* X86_64 */
#if defined(LINUX_STACKBOTTOM) && defined(NO_PROC_STAT) \
&& !defined(USE_LIBC_PRIVATES)
@@ -2204,7 +2160,8 @@
# define DATAEND (end)
# endif
-# if defined(SVR4) && !defined(GETPAGESIZE)
+/* getpagesize() is considered obsolete on OpenBSD, use sysconf(_SC_PAGESIZE) */
+# if (defined(SVR4) || defined(OPENBSD)) && !defined(GETPAGESIZE)
# include <unistd.h>
# define GETPAGESIZE() sysconf(_SC_PAGESIZE)
# endif

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-src_racket_sconfig_h,v 1.5 2014/06/22 10:59:37 juanfra Exp $
$OpenBSD: patch-src_racket_sconfig_h,v 1.6 2014/07/15 00:13:16 juanfra Exp $
--- src/racket/sconfig.h.orig Thu Apr 17 21:58:42 2014
+++ src/racket/sconfig.h Sat Jun 14 00:26:23 2014
@@ -313,12 +313,22 @@
+++ src/racket/sconfig.h Mon Jul 14 22:39:35 2014
@@ -313,12 +313,24 @@
/************** x86/OpenBSD with gcc ****************/
/* Thanks to Bengt Kleberg */
@ -19,6 +19,8 @@ $OpenBSD: patch-src_racket_sconfig_h,v 1.5 2014/06/22 10:59:37 juanfra Exp $
+# else
+# define SCHEME_PLATFORM_LIBRARY_SUBPATH "mips64-openbsd"
+# endif
+# elif defined(__powerpc__)
+# define SCHEME_PLATFORM_LIBRARY_SUBPATH "ppc-openbsd"
+# elif defined(__hppa__)
+# define SCHEME_PLATFORM_LIBRARY_SUBPATH "hppa-openbsd"
+# else
@ -26,15 +28,43 @@ $OpenBSD: patch-src_racket_sconfig_h,v 1.5 2014/06/22 10:59:37 juanfra Exp $
# endif
# include "uconfig.h"
@@ -356,8 +366,6 @@
# define MZ_USE_JIT_I386
# define MZ_JIT_USE_MPROTECT
# define MZ_TRY_EXTFLONUMS
@@ -331,9 +343,7 @@
# undef UNIX_STACK_MAXIMUM
# define UNIX_STACK_MAXIMUM 4194304
-#ifndef __ELF__
# define UNDERSCORE_DYNLOAD_SYMBOL_PREFIX
-#endif
# define USE_DLOPEN_GLOBAL_BY_DEFAULT
@@ -348,17 +358,15 @@
# define USE_TM_GMTOFF_FIELD
# define USE_TM_ZONE_FIELD
-#if defined(__x86_64__)
-# define MZ_USE_JIT_X86_64
-# define MZ_JIT_USE_MPROTECT
-# define MZ_TRY_EXTFLONUMS
-#elif defined(__i386__)
-# define MZ_USE_JIT_I386
-# define MZ_JIT_USE_MPROTECT
-# define MZ_TRY_EXTFLONUMS
-#else
-# error Unported platform.
#endif
-#endif
+# if defined(__x86_64__)
+# define MZ_USE_JIT_X86_64
+# define MZ_JIT_USE_MPROTECT
+# define MZ_TRY_EXTFLONUMS
+# elif defined(__i386__)
+# define MZ_USE_JIT_I386
+# define MZ_JIT_USE_MPROTECT
+# define MZ_TRY_EXTFLONUMS
+# endif
# define FLAGS_ALREADY_SET
@@ -428,7 +436,7 @@
/************** SGI/IRIX with SGI cc ****************/

View File

@ -1,19 +1,21 @@
$OpenBSD: patch-src_racket_src_gmp_gmplonglong_h,v 1.1 2014/01/16 01:49:32 juanfra Exp $
$OpenBSD: patch-src_racket_src_gmp_gmplonglong_h,v 1.2 2014/07/15 00:13:16 juanfra Exp $
Racket uses an old version of gmp. It's so old even doesn't include
assembler code for amd64, where racket uses C.
This patch changes every platform to use the C code because these days
racket is mostly tested on amd64 on other OS and this can help us in
This patch changes some platforms to use the C code because these days
racket is mostly tested on amd64/i386 on other OS and this can help us in
the effort to port racket to other platforms.
--- src/racket/src/gmp/gmplonglong.h.orig Fri Jan 10 04:35:39 2014
+++ src/racket/src/gmp/gmplonglong.h Fri Jan 10 04:36:33 2014
@@ -96,6 +96,7 @@ MA 02111-1307, USA. */
--- src/racket/src/gmp/gmplonglong.h.orig Thu Apr 17 21:58:42 2014
+++ src/racket/src/gmp/gmplonglong.h Tue Jul 15 01:31:10 2014
@@ -96,6 +96,12 @@ MA 02111-1307, USA. */
If any of these macros are left undefined for a particular CPU,
C macros are used. */
+#define MZ_GMP_NO_ASM 1
+/* These days only i386 and amd64 are tested */
+#if !defined(__i386__) || !defined(__x86_64__)
+# define MZ_GMP_NO_ASM 1
+# define NO_ASM 1
+#endif
+
#ifndef MZ_GMP_NO_ASM
/* The CPUs come in alphabetical order below.