Update to Racket 6.5.
This commit is contained in:
parent
57b6df44d9
commit
0a32a06d5e
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.20 2016/04/14 18:12:17 juanfra Exp $
|
||||
# $OpenBSD: Makefile,v 1.21 2016/05/16 22:20:16 juanfra Exp $
|
||||
|
||||
PORTROACH_COMMENT = hide pre-release versions (e.g. 6.1.90.900)
|
||||
PORTROACH = limit:!.*\.[0-9][0-9][0-9]-src-builtpkgs$$
|
||||
@ -7,8 +7,7 @@ ONLY_FOR_ARCHS = amd64 i386 powerpc sparc64
|
||||
|
||||
COMMENT = multi-paradigm programming language
|
||||
|
||||
V = 6.4
|
||||
REVISION = 3
|
||||
V = 6.5
|
||||
PKGNAME = racket-minimal-$V
|
||||
DISTFILES = racket-minimal-$V-src-builtpkgs${EXTRACT_SUFX} \
|
||||
racket-openbsd-1${EXTRACT_SUFX}
|
||||
@ -34,6 +33,11 @@ MASTER_SITES = https://mirror.racket-lang.org/installers/${V}/ \
|
||||
ftp://download.tuxfamily.org/jod/lang/racket/
|
||||
EXTRACT_SUFX = .tgz
|
||||
|
||||
# GCC4 is only needed by the TLS flavor. "places" and "futures" only work
|
||||
# correctly on amd64 for this version.
|
||||
MODULES += gcc4
|
||||
MODGCC4_LANGS = c
|
||||
MODGCC4_ARCHS = amd64
|
||||
LIB_DEPENDS = converters/libiconv \
|
||||
devel/libffi>=3.0.9p2
|
||||
|
||||
@ -77,20 +81,27 @@ CFLAGS += -ggdb3
|
||||
# - "places" and "futures" require thread-local storage, atomic CAS and JIT
|
||||
# http://article.gmane.org/gmane.comp.lang.racket.user/16723
|
||||
# - Using gcc4 to enable "places". It broke Racket in the past.
|
||||
# - The JIT doesn't work on powerpc when TLS is enabled
|
||||
# - The JIT doesn't work on powerpc when TLS is enabled. "places" and
|
||||
# "futures" don't work on powerpc.
|
||||
# https://github.com/racket/racket/issues/1239
|
||||
# - Racket builds fine with -O2 (and -O1 and -Os) on powerpc but
|
||||
# it doesn't pass the tests.
|
||||
.if ${FLAVOR:Mno_jit}
|
||||
ONLY_FOR_ARCHS = amd64 i386
|
||||
ONLY_FOR_ARCHS = amd64 i386 powerpc
|
||||
CONFIGURE_ARGS += --disable-jit \
|
||||
--disable-places \
|
||||
--disable-futures
|
||||
.elif ${MACHINE_ARCH} != "sparc64" && ${MACHINE_ARCH} != "powerpc"
|
||||
MODULES += gcc4
|
||||
MODGCC4_LANGS = c c++
|
||||
MODGCC4_ARCHS = amd64 i386
|
||||
.elif ${MACHINE_ARCH} == "amd64"
|
||||
CONFIGURE_ARGS += --enable-jit \
|
||||
--enable-places \
|
||||
--enable-futures
|
||||
.elif ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc"
|
||||
CONFIGURE_ARGS += --enable-jit \
|
||||
--disable-places \
|
||||
--disable-futures
|
||||
.elif ${MACHINE_ARCH} == "powerpc"
|
||||
CONFIGURE_ENV += CFLAGS="${CFLAGS} -O0 -Wall -Wno-unused-value" \
|
||||
CPPFLAGS="${CPPFLAGS} -O0 -Wall -Wno-unused-value"
|
||||
.else
|
||||
CONFIGURE_ARGS += --disable-jit \
|
||||
--disable-places \
|
||||
|
@ -1,4 +1,4 @@
|
||||
SHA256 (racket-minimal-6.4-src-builtpkgs.tgz) = z3F9SYP0GY/OiXPq1dQnvJ2ni3O9Uf7ha1jIlMKhRug=
|
||||
SHA256 (racket-minimal-6.5-src-builtpkgs.tgz) = RP6VpOxNRCtPb2jjYBBMqXFb0f43ldMC1s3azrFWltw=
|
||||
SHA256 (racket-openbsd-1.tgz) = A41JvC/qwnaia8Umknoh+XQIOVtWVvG/231AdAeXe30=
|
||||
SIZE (racket-minimal-6.4-src-builtpkgs.tgz) = 10880010
|
||||
SIZE (racket-minimal-6.5-src-builtpkgs.tgz) = 11037268
|
||||
SIZE (racket-openbsd-1.tgz) = 276
|
||||
|
@ -1,60 +0,0 @@
|
||||
$OpenBSD: patch-collects_compiler_private_xform_rkt,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd2912f8bc15c3e2a81344fc113ac31df4304
|
||||
|
||||
"xform: better reporting for disallowed call"
|
||||
https://github.com/racket/racket/commit/18990701a69d6705e9c7c56be5e858ea6e821f9f
|
||||
|
||||
"xform: recognize some floating-point intrinsics"
|
||||
https://github.com/racket/racket/commit/c1b9cd6828ad7022158c68ebbf45ab8d0fe0202c
|
||||
|
||||
"xform: more 'signbit' variants"
|
||||
https://github.com/racket/racket/commit/f21aa8661bd5e97ef100f75042e2280158fe9179
|
||||
|
||||
"xform: another signbit intrinsic"
|
||||
https://github.com/racket/racket/commit/5b37bac183d04bed8dbf77e9c03bddb53c1e5198
|
||||
|
||||
--- collects/compiler/private/xform.rkt.orig Mon Jan 11 18:07:43 2016
|
||||
+++ collects/compiler/private/xform.rkt Fri Feb 12 03:35:26 2016
|
||||
@@ -898,12 +898,13 @@
|
||||
__get_errno_ptr ; QNX preprocesses errno to __get_errno_ptr
|
||||
__getreent ; Cygwin
|
||||
|
||||
- strlen cos cosl sin sinl exp expl pow powl log logl sqrt sqrtl atan2 atan2l
|
||||
- isnan isinf fpclass _fpclass __fpclassify __fpclassifyf __fpclassifyl
|
||||
- _isnan __isfinited __isnanl __isnan
|
||||
+ strlen cos cosl sin sinl exp expl pow powl log logl sqrt sqrtl atan2 atan2l frexp
|
||||
+ isnan isinf fpclass signbit _signbit _fpclass __fpclassify __fpclassifyf __fpclassifyl
|
||||
+ _isnan __isfinited __isnanl __isnan __signbit __signbitf __signbitd __signbitl
|
||||
__isinff __isinfl isnanf isinff __isinfd __isnanf __isnand __isinf
|
||||
- __inline_isnanl __inline_isnan
|
||||
- __builtin_popcount __builtin_clz
|
||||
+ __inline_isnanl __inline_isnan __inline_signbit __inline_signbitf __inline_signbitd __inline_signbitl
|
||||
+ __builtin_popcount __builtin_clz __builtin_isnan __builtin_isinf __builtin_signbit
|
||||
+ __builtin_signbitf __builtin_signbitd __builtin_signbitl __builtin_isinf_sign
|
||||
_Generic
|
||||
__inline_isinff __inline_isinfl __inline_isinfd __inline_isnanf __inline_isnand __inline_isinf
|
||||
floor floorl ceil ceill round roundl fmod fmodl modf modfl fabs fabsl __maskrune _errno __errno
|
||||
@@ -2542,9 +2543,10 @@
|
||||
type)))])
|
||||
(if (hash-ref non-gcing-functions name (lambda () #f))
|
||||
(when saw-gcing-call
|
||||
- (log-error "[GCING] ~a in ~a: Function ~a declared __xform_nongcing__, but includes a function call."
|
||||
+ (log-error "[GCING] ~a in ~a: Function ~a declared __xform_nongcing__, but includes a function call at ~s."
|
||||
(tok-line saw-gcing-call) (tok-file saw-gcing-call)
|
||||
- name))
|
||||
+ name
|
||||
+ (tok-n saw-gcing-call)))
|
||||
(unless saw-gcing-call
|
||||
'
|
||||
(eprintf "[SUGGEST] Consider declaring ~a as __xform_nongcing__.\n"
|
||||
@@ -3580,7 +3582,7 @@
|
||||
(list->seq (append func (list args))))
|
||||
;; Call with pointer pushes
|
||||
(begin
|
||||
- (set! saw-gcing-call (car e-))
|
||||
+ (set! saw-gcing-call (car func))
|
||||
(make-call
|
||||
"func call"
|
||||
#f #f
|
@ -1,15 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_gc2_Makefile_in,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"clean up GC implementation"
|
||||
https://github.com/racket/racket/commit/2ee721f
|
||||
|
||||
--- src/racket/gc2/Makefile.in.orig Mon Jan 11 18:07:43 2016
|
||||
+++ src/racket/gc2/Makefile.in Tue Feb 9 23:51:58 2016
|
||||
@@ -467,6 +467,7 @@ gc2.@LTO@: \
|
||||
$(srcdir)/newgc.c \
|
||||
$(srcdir)/newgc.h \
|
||||
$(srcdir)/page_range.c \
|
||||
+ $(srcdir)/places_gc.c \
|
||||
$(srcdir)/rlimit_heapsize.c \
|
||||
$(srcdir)/roots.c \
|
||||
$(srcdir)/stack_comp.c \
|
@ -1,119 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_gc2_block_cache_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/gc2/block_cache.c.orig Fri Oct 16 23:00:55 2015
|
||||
+++ src/racket/gc2/block_cache.c Tue Feb 9 23:13:12 2016
|
||||
@@ -168,8 +168,8 @@ static void *bc_alloc_std_page(BlockCache *bc, int dir
|
||||
|
||||
tryagain:
|
||||
if (!gclist_is_empty(free_head)) {
|
||||
- if (!gclist_first_item(free_head, block_desc*, gclist)->free) {
|
||||
- GC_ASSERT(!gclist_first_item(free_head, block_desc*, gclist)->freecnt);
|
||||
+ if (!gclist_first_item(free_head, block_desc, gclist)->free) {
|
||||
+ GC_ASSERT(!gclist_first_item(free_head, block_desc, gclist)->freecnt);
|
||||
gclist_move(free_head->next, &bg->full);
|
||||
goto tryagain;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ static void *bc_alloc_std_page(BlockCache *bc, int dir
|
||||
}
|
||||
|
||||
{
|
||||
- block_desc *bd = gclist_first_item(free_head, block_desc*, gclist);
|
||||
+ block_desc *bd = gclist_first_item(free_head, block_desc, gclist);
|
||||
pfree_list *fl = bd->free;
|
||||
void *p = fl;
|
||||
int pos = BD_BLOCK_PTR_TO_POS(p, bd);
|
||||
@@ -284,7 +284,7 @@ static void *block_cache_alloc_page(BlockCache* bc, si
|
||||
#if BC_ASSERTS
|
||||
static int find_addr_in_bd(GCList *head, void *p, char* msg) {
|
||||
block_desc *b;
|
||||
- gclist_each_item(b, head, block_desc*, gclist) {
|
||||
+ gclist_each_item(b, head, block_desc, gclist) {
|
||||
if (p >= b->block && p < b->block + b->size) {
|
||||
return 1;
|
||||
}
|
||||
@@ -349,12 +349,12 @@ static void compute_compacts(block_group *bg)
|
||||
intptr_t avail, wanted;
|
||||
|
||||
wanted = 0;
|
||||
- gclist_each_item(b, &bg->free, block_desc*, gclist) {
|
||||
+ gclist_each_item(b, &bg->free, block_desc, gclist) {
|
||||
wanted += (b->totalcnt - b->freecnt);
|
||||
}
|
||||
|
||||
avail = 0;
|
||||
- gclist_each_item(b, &bg->free, block_desc*, gclist) {
|
||||
+ gclist_each_item(b, &bg->free, block_desc, gclist) {
|
||||
if (avail > wanted)
|
||||
b->want_compact = 1;
|
||||
else {
|
||||
@@ -365,8 +365,8 @@ static void compute_compacts(block_group *bg)
|
||||
}
|
||||
|
||||
static int sort_full_to_empty(void *priv, GCList *a, GCList *b) {
|
||||
- block_desc *ba = gclist_item(a, block_desc*, gclist);
|
||||
- block_desc *bb = gclist_item(b, block_desc*, gclist);
|
||||
+ block_desc *ba = gclist_item(a, block_desc, gclist);
|
||||
+ block_desc *bb = gclist_item(b, block_desc, gclist);
|
||||
|
||||
if ((ba->freecnt) <= (bb->freecnt)) {
|
||||
return -1;
|
||||
@@ -384,13 +384,13 @@ static void block_cache_prep_for_compaction(BlockCache
|
||||
#if 0
|
||||
{
|
||||
block_desc *b;
|
||||
- gclist_each_item(b, &bc->atomic.full, block_desc*, gclist) {
|
||||
+ gclist_each_item(b, &bc->atomic.full, block_desc, gclist) {
|
||||
printf(" X ATOMIC _ %05li %03li %p\n", b->freecnt, b->totalcnt, b); }
|
||||
- gclist_each_item(b, &bc->atomic.free, block_desc*, gclist) {
|
||||
+ gclist_each_item(b, &bc->atomic.free, block_desc, gclist) {
|
||||
printf(" ATOMIC %d %05li %03li %p\n", b->want_compact, b->freecnt, b->totalcnt, b); }
|
||||
- gclist_each_item(b, &bc->non_atomic.full, block_desc*, gclist) {
|
||||
+ gclist_each_item(b, &bc->non_atomic.full, block_desc, gclist) {
|
||||
printf(" X NONATOMIC _ %05li %03li %p\n", b->freecnt, b->totalcnt, b); }
|
||||
- gclist_each_item(b, &bc->non_atomic.free, block_desc*, gclist) {
|
||||
+ gclist_each_item(b, &bc->non_atomic.free, block_desc, gclist) {
|
||||
printf(" NONATOMIC %d %05li %03li %p\n", b->want_compact, b->freecnt, b->totalcnt, b); }
|
||||
}
|
||||
#endif
|
||||
@@ -407,10 +407,10 @@ static ssize_t block_cache_flush_freed_pages(BlockCach
|
||||
ssize_t size_diff = 0;
|
||||
ssize_t alloc_cache_size_diff = 0;
|
||||
|
||||
- gclist_each_item_safe(b, bn, &bc->atomic.free, block_desc*, gclist) {
|
||||
+ gclist_each_item_safe(b, bn, &bc->atomic.free, block_desc, gclist) {
|
||||
if (b->freecnt == b->totalcnt) { size_diff += bc_free_std_block(b, 0); }
|
||||
}
|
||||
- gclist_each_item_safe(b, bn, &bc->non_atomic.free, block_desc*, gclist) {
|
||||
+ gclist_each_item_safe(b, bn, &bc->non_atomic.free, block_desc, gclist) {
|
||||
if (b->freecnt == b->totalcnt) { size_diff += bc_free_std_block(b, 1); }
|
||||
}
|
||||
alloc_cache_size_diff = alloc_cache_flush_freed_pages(bc->bigBlockCache);
|
||||
@@ -475,14 +475,14 @@ static void block_cache_queue_protect_range(BlockCache
|
||||
static void block_cache_flush_protect_ranges(BlockCache* bc, int writeable) {
|
||||
block_group *bg = &bc->non_atomic;
|
||||
block_desc *b;
|
||||
- gclist_each_item(b, &bg->full, block_desc*, gclist) {
|
||||
+ gclist_each_item(b, &bg->full, block_desc, gclist) {
|
||||
if (b->in_queue) {
|
||||
b->in_queue = 0;
|
||||
page_range_add(bc->page_range, b->block, b->size, writeable);
|
||||
memset(b->protect_map, writeable ? 0 : 255, 1+(b->size >> (LOG_APAGE_SIZE + 3)));
|
||||
}
|
||||
}
|
||||
- gclist_each_item(b, &bg->free, block_desc*, gclist) {
|
||||
+ gclist_each_item(b, &bg->free, block_desc, gclist) {
|
||||
if (b->in_queue) {
|
||||
b->in_queue = 0;
|
||||
page_range_add(bc->page_range, b->block, b->size, writeable);
|
||||
@@ -497,7 +497,7 @@ static void block_cache_flush_protect_ranges(BlockCach
|
||||
static int block_cache_chain_stat(GCList *head, int *blcnt) {
|
||||
block_desc *b;
|
||||
int freecnt = 0;
|
||||
- gclist_each_item(b, head, block_desc*, gclist) {
|
||||
+ gclist_each_item(b, head, block_desc, gclist) {
|
||||
pfree_list *fl;
|
||||
int lfcnt = 0;
|
||||
for (fl = b->free; fl; fl = fl->next) {
|
@ -1,16 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_gc2_gclist_h,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/gc2/gclist.h.orig Tue Mar 17 20:22:39 2015
|
||||
+++ src/racket/gc2/gclist.h Tue Feb 9 23:13:12 2016
|
||||
@@ -70,7 +70,7 @@ static inline void gclist_splice(GCList *head, GCList
|
||||
}
|
||||
|
||||
#define gclist_item(ptr, type, member) \
|
||||
- ((type) (((void*)(ptr)) - ((void *) (&(((type) 0x0)->member)))))
|
||||
+ ((type*) (((void*)(ptr)) - ((void *) offsetof(type, member))))
|
||||
|
||||
#define gclist_first_item(head, type, member) \
|
||||
gclist_item((head)->next, type, member)
|
File diff suppressed because it is too large
Load Diff
@ -1,81 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_gc2_newgc_h,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"clean up GC implementation"
|
||||
https://github.com/racket/racket/commit/2ee721f
|
||||
|
||||
--- src/racket/gc2/newgc.h.orig Mon Jan 11 18:07:43 2016
|
||||
+++ src/racket/gc2/newgc.h Tue Feb 9 23:51:58 2016
|
||||
@@ -1,14 +1,58 @@
|
||||
#include "commongc_internal.h"
|
||||
#include "gc2_obj.h"
|
||||
|
||||
-#if defined(MZ_USE_PLACES)
|
||||
-/*
|
||||
-# define GC_DEBUG_PAGES
|
||||
-# define MASTER_ALLOC_DEBUG
|
||||
-# define KILLING_DEBUG
|
||||
-*/
|
||||
-#endif
|
||||
+/* the page type constants */
|
||||
+enum {
|
||||
+ PAGE_TAGGED = 0,
|
||||
+ PAGE_ATOMIC = 1,
|
||||
+ PAGE_ARRAY = 2,
|
||||
+ PAGE_PAIR = 3,
|
||||
+ PAGE_BIG = 4,
|
||||
+ /* the number of page types in then gen1 array: */
|
||||
+ PAGE_TYPES = 5,
|
||||
+ /* medium page types: */
|
||||
+ PAGE_MED_ATOMIC = 6,
|
||||
+ PAGE_MED_NONATOMIC = 7
|
||||
+};
|
||||
|
||||
+enum {
|
||||
+ MED_PAGE_NONATOMIC_INDEX = 0,
|
||||
+ MED_PAGE_ATOMIC_INDEX = 1,
|
||||
+ /* the number of medium-page types in the array: */
|
||||
+ MED_PAGE_TYPES = 2
|
||||
+};
|
||||
+
|
||||
+enum {
|
||||
+ SIZE_CLASS_SMALL_PAGE = 0, /* can be a nursery page */
|
||||
+ SIZE_CLASS_MED_PAGE = 1,
|
||||
+ SIZE_CLASS_BIG_PAGE = 2,
|
||||
+ SIZE_CLASS_BIG_PAGE_MARKED = 3
|
||||
+};
|
||||
+
|
||||
+enum {
|
||||
+ MMU_ZEROED = 0,
|
||||
+ MMU_DIRTY = 1,
|
||||
+};
|
||||
+
|
||||
+enum {
|
||||
+ MMU_SMALL_GEN1 = 0,
|
||||
+ MMU_BIG_MED = 1,
|
||||
+ MMU_SMALL_GEN0 = 1,
|
||||
+};
|
||||
+
|
||||
+enum {
|
||||
+ MMU_NON_PROTECTABLE = 0,
|
||||
+ MMU_PROTECTABLE = 1,
|
||||
+};
|
||||
+
|
||||
+enum {
|
||||
+ AGE_GEN_0 = 0,
|
||||
+ AGE_GEN_HALF = 1,
|
||||
+ AGE_GEN_1 = 2,
|
||||
+ AGE_VACATED = 3, /* used for pages to be removed */
|
||||
+ AGE_GEN_INC = 4 /* used for naming a finalizer set */
|
||||
+};
|
||||
+
|
||||
typedef struct mpage {
|
||||
struct mpage *next;
|
||||
struct mpage *prev;
|
||||
@@ -300,6 +344,7 @@ typedef struct NewGC {
|
||||
void *park[2];
|
||||
void *park_fsave[2];
|
||||
void *park_isave[2];
|
||||
+# define CHECK_PARK_UNUSED(gc) GC_ASSERT(!gc->park[0])
|
||||
|
||||
unsigned short weak_array_tag;
|
||||
unsigned short weak_box_tag;
|
@ -1,520 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_gc2_places_gc_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"clean up GC implementation"
|
||||
https://github.com/racket/racket/commit/2ee721f
|
||||
|
||||
--- src/racket/gc2/places_gc.c.orig Tue Feb 9 23:51:58 2016
|
||||
+++ src/racket/gc2/places_gc.c Tue Feb 9 23:51:58 2016
|
||||
@@ -0,0 +1,512 @@
|
||||
+
|
||||
+#ifdef MZ_USE_PLACES
|
||||
+static NewGC *MASTERGC;
|
||||
+static NewGCMasterInfo *MASTERGCINFO;
|
||||
+inline static int premaster_or_master_gc(NewGC *gc) {
|
||||
+ return (!MASTERGC || gc == MASTERGC);
|
||||
+}
|
||||
+inline static int premaster_or_place_gc(NewGC *gc) {
|
||||
+ return (!MASTERGC || gc != MASTERGC);
|
||||
+}
|
||||
+inline static int postmaster_and_master_gc(NewGC *gc) {
|
||||
+ return (MASTERGC && gc == MASTERGC);
|
||||
+}
|
||||
+inline static int postmaster_and_place_gc(NewGC *gc) {
|
||||
+ return (MASTERGC && gc != MASTERGC);
|
||||
+}
|
||||
+
|
||||
+intptr_t GC_is_place() {
|
||||
+ NewGC *gc = GC_get_GC();
|
||||
+ return postmaster_and_place_gc(gc);
|
||||
+}
|
||||
+
|
||||
+struct Log_Master_Info {
|
||||
+ int ran, full;
|
||||
+ intptr_t pre_used, post_used, pre_admin, post_admin;
|
||||
+};
|
||||
+
|
||||
+# define PLACES_AND(v) v
|
||||
+#else
|
||||
+# define premaster_or_master_gc(gc) 1
|
||||
+# define premaster_or_place_gc(gc) 1
|
||||
+# define postmaster_and_master_gc(gc) 0
|
||||
+# define postmaster_and_place_gc(gc) 1
|
||||
+# define PLACES_AND(v) 0
|
||||
+#endif
|
||||
+
|
||||
+#ifdef MZ_USE_PLACES
|
||||
+static void adjust_page_lock(int is_a_master_page, mpage *page, intptr_t prev, intptr_t next)
|
||||
+{
|
||||
+ if (is_a_master_page) {
|
||||
+ while (!mzrt_cas(&page->page_lock, prev, next)) { /* spin! */ }
|
||||
+ }
|
||||
+}
|
||||
+# define TAKE_PAGE_LOCK(is_a_master_page, page) adjust_page_lock(is_a_master_page, page, 0, 1);
|
||||
+# define RELEASE_PAGE_LOCK(is_a_master_page, page) adjust_page_lock(is_a_master_page, page, 1, 0);
|
||||
+#else
|
||||
+# define TAKE_PAGE_LOCK(is_a_master_page, page) /* empty */
|
||||
+# define RELEASE_PAGE_LOCK(is_a_master_page, page) /* empty */
|
||||
+#endif
|
||||
+
|
||||
+/*****************************************************************************/
|
||||
+/* Debugging */
|
||||
+/*****************************************************************************/
|
||||
+
|
||||
+#if defined(MZ_USE_PLACES) && defined(GC_DEBUG_PAGES)
|
||||
+static FILE* gcdebugOUT(NewGC *gc) {
|
||||
+
|
||||
+ if (gc->GCVERBOSEFH) { fflush(gc->GCVERBOSEFH); }
|
||||
+ else {
|
||||
+ char buf[50];
|
||||
+ sprintf(buf, "GCDEBUGOUT_%i", gc->place_id);
|
||||
+ gc->GCVERBOSEFH = fopen(buf, "w");
|
||||
+ }
|
||||
+ return gc->GCVERBOSEFH;
|
||||
+}
|
||||
+
|
||||
+static void GCVERBOSEprintf(NewGC *gc, const char *fmt, ...) {
|
||||
+ va_list ap;
|
||||
+ va_start(ap, fmt);
|
||||
+ vfprintf(gcdebugOUT(gc), fmt, ap);
|
||||
+ va_end(ap);
|
||||
+}
|
||||
+
|
||||
+static void GCVERBOSEPAGE(NewGC *gc, const char *msg, mpage* page) {
|
||||
+ GCVERBOSEprintf(gc, "%s %p: %p %p %p\n", msg, gc, page, page->addr, (void*)((intptr_t)page->addr + real_page_size(page)));
|
||||
+}
|
||||
+#else
|
||||
+# define GCVERBOSEPAGE(gc, msg, page) /* EMPTY */
|
||||
+MAYBE_UNUSED static void GCVERBOSEprintf(NewGC *gc, const char *fmt, ...) {
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+/*****************************************************************************/
|
||||
+/* Coordinating place GC */
|
||||
+/*****************************************************************************/
|
||||
+
|
||||
+#ifdef MZ_USE_PLACES
|
||||
+enum {
|
||||
+ SIGNALED_BUT_NOT_REGISTERED = -3,
|
||||
+ REAPED_SLOT_AVAILABLE = -2,
|
||||
+ CREATED_BUT_NOT_REGISTERED = -1,
|
||||
+};
|
||||
+
|
||||
+void GC_allow_master_gc_check() {
|
||||
+ NewGC *gc = GC_get_GC();
|
||||
+ gc->dont_master_gc_until_child_registers = 0;
|
||||
+}
|
||||
+static void NewGCMasterInfo_initialize() {
|
||||
+ int i;
|
||||
+ MASTERGCINFO = ofm_malloc_zero(sizeof(NewGCMasterInfo));
|
||||
+ MASTERGCINFO->size = 4;
|
||||
+ MASTERGCINFO->alive = 0;
|
||||
+ MASTERGCINFO->ready = 0;
|
||||
+ MASTERGCINFO->signal_fds = (void **)ofm_malloc(sizeof(void*) * MASTERGCINFO->size);
|
||||
+ for (i=0; i < MASTERGCINFO->size; i++ ) {
|
||||
+ MASTERGCINFO->signal_fds[i] = (void *)REAPED_SLOT_AVAILABLE;
|
||||
+ }
|
||||
+ mzrt_rwlock_create(&MASTERGCINFO->cangc);
|
||||
+ mzrt_sema_create(&MASTERGCINFO->wait_go_sema, 0);
|
||||
+ mzrt_sema_create(&MASTERGCINFO->wait_done_sema, 0);
|
||||
+}
|
||||
+
|
||||
+#if 0
|
||||
+/* Not yet used: */
|
||||
+static void NewGCMasterInfo_cleanup() {
|
||||
+ mzrt_rwlock_destroy(MASTERGCINFO->cangc);
|
||||
+ ofm_free(MASTERGCINFO->signal_fds, sizeof(void*) * MASTERGCINFO->size);
|
||||
+ ofm_free(MASTERGCINFO, sizeof(NewGCMasterInfo));
|
||||
+ MASTERGCINFO = NULL;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+/* signals every place to do a full gc at then end of
|
||||
+ garbage_collect the places will call
|
||||
+ wait_while_master_in_progress and
|
||||
+ rendezvous for a master gc */
|
||||
+/* this is only called from the master so the cangc lock should already be held */
|
||||
+static void master_collect_request() {
|
||||
+ if (MASTERGC->major_places_gc == 0) {
|
||||
+ int i = 0;
|
||||
+ int size = MASTERGCINFO->size;
|
||||
+ int count = 0;
|
||||
+ MASTERGC->major_places_gc = 1;
|
||||
+ MASTERGCINFO->ready = 0;
|
||||
+
|
||||
+ for (i = 1; i < size; i++) {
|
||||
+ void *signal_fd = MASTERGCINFO->signal_fds[i];
|
||||
+ if (signal_fd < (void*) -2) {
|
||||
+ scheme_signal_received_at(signal_fd);
|
||||
+#if defined(GC_DEBUG_PAGES)
|
||||
+ printf("%i SIGNALED BUT NOT COLLECTED\n", i);
|
||||
+ GCVERBOSEprintf(gc, "%i SIGNALED BUT NOT COLLECTED\n", i);
|
||||
+#endif
|
||||
+ count++;
|
||||
+ }
|
||||
+ else if ( signal_fd == (void*)-1) {
|
||||
+ /* printf("%i SIGNALED BUT NOT REGISTERED YET\n", i); */
|
||||
+ MASTERGCINFO->signal_fds[i] = (void*) SIGNALED_BUT_NOT_REGISTERED;
|
||||
+ count++;
|
||||
+ }
|
||||
+ if (count == (MASTERGCINFO->alive - 1)) {
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ if (count != (MASTERGCINFO->alive - 1)) {
|
||||
+ printf("GC2 count != MASTERGCINFO->alive %i %" PRIdPTR "\n", count, MASTERGCINFO->alive);
|
||||
+ abort();
|
||||
+ }
|
||||
+#if defined(GC_DEBUG_PAGES)
|
||||
+ printf("Woke up %i places for MASTER GC\n", count);
|
||||
+ GCVERBOSEprintf(gc, "Woke up %i places for MASTER GC\n", count);
|
||||
+#endif
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void collect_master(Log_Master_Info *lmi) {
|
||||
+ NewGC *saved_gc;
|
||||
+ saved_gc = GC_switch_to_master_gc();
|
||||
+ {
|
||||
+#if defined(GC_DEBUG_PAGES)
|
||||
+ NewGC *gc = GC_get_GC();
|
||||
+ printf("START MASTER COLLECTION\n");
|
||||
+ GCVERBOSEprintf(gc, "START MASTER COLLECTION\n");
|
||||
+#endif
|
||||
+ MASTERGC->major_places_gc = 0;
|
||||
+ garbage_collect(MASTERGC, 1, 0, 0, lmi);
|
||||
+#if defined(GC_DEBUG_PAGES)
|
||||
+ printf("END MASTER COLLECTION\n");
|
||||
+ GCVERBOSEprintf(gc, "END MASTER COLLECTION\n");
|
||||
+#endif
|
||||
+
|
||||
+ MASTERGC->prev_pending_msg_size = MASTERGC->pending_msg_size;
|
||||
+
|
||||
+ {
|
||||
+ int i = 0;
|
||||
+ int alive = MASTERGCINFO->alive;
|
||||
+ /* wake everyone back up, except MASTERGC and ourself */
|
||||
+ for (i = 2; i < alive; i++) {
|
||||
+ mzrt_sema_post(MASTERGCINFO->wait_done_sema);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ GC_switch_back_from_master(saved_gc);
|
||||
+}
|
||||
+
|
||||
+static void sync_master_progress(NewGC *gc, int done, Log_Master_Info *lmi) {
|
||||
+ int last_one_here = -1;
|
||||
+
|
||||
+ mzrt_rwlock_wrlock(MASTERGCINFO->cangc);
|
||||
+
|
||||
+ if (MASTERGC->major_places_gc == 1) {
|
||||
+ MASTERGCINFO->ready++;
|
||||
+#if defined(GC_DEBUG_PAGES)
|
||||
+ printf("%i READY\n", gc->place_id);
|
||||
+ GCVERBOSEprintf(gc, "%i READY\n", gc->place_id);
|
||||
+ GCVERBOSEprintf(gc, "START MASTER COLLECTION\n");
|
||||
+#endif
|
||||
+ /* don't count MASTERGC */
|
||||
+ if ((MASTERGCINFO->alive - 1) == MASTERGCINFO->ready) {
|
||||
+ last_one_here = 1;
|
||||
+ MASTERGCINFO->ready = 0;
|
||||
+ } else {
|
||||
+ last_one_here = 0;
|
||||
+ }
|
||||
+ } else {
|
||||
+ last_one_here = -1;
|
||||
+ }
|
||||
+
|
||||
+ mzrt_rwlock_unlock(MASTERGCINFO->cangc);
|
||||
+
|
||||
+ switch(last_one_here) {
|
||||
+ case -1:
|
||||
+ /* master doesn't want to collect */
|
||||
+ return;
|
||||
+ break;
|
||||
+ case 0:
|
||||
+ /* wait on semaphore */
|
||||
+ if (done) {
|
||||
+ mzrt_sema_wait(MASTERGCINFO->wait_done_sema);
|
||||
+ GCVERBOSEprintf(gc, "END MASTER COLLECTION\n");
|
||||
+ } else
|
||||
+ mzrt_sema_wait(MASTERGCINFO->wait_go_sema);
|
||||
+ break;
|
||||
+ case 1:
|
||||
+ /* You're the last one here. */
|
||||
+ if (done) {
|
||||
+ collect_master(lmi); /* notifies other places on completion */
|
||||
+ GCVERBOSEprintf(gc, "END MASTER COLLECTION\n");
|
||||
+ } else {
|
||||
+ int i = 0;
|
||||
+ int alive = MASTERGCINFO->alive;
|
||||
+ /* wake everyone back up, except MASTERGC and ourself */
|
||||
+ for (i = 2; i < alive; i++) {
|
||||
+ mzrt_sema_post(MASTERGCINFO->wait_go_sema);
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ printf("GC2 sync_master_in_progress invalid case, unreachable\n");
|
||||
+ abort();
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void wait_until_master_in_progress(NewGC *gc) {
|
||||
+ sync_master_progress(gc, 0, NULL);
|
||||
+}
|
||||
+
|
||||
+static void wait_while_master_in_progress(NewGC *gc, Log_Master_Info *lmi) {
|
||||
+ sync_master_progress(gc, 1, lmi);
|
||||
+}
|
||||
+
|
||||
+/* MUST CALL WITH cangc lock */
|
||||
+static intptr_t NewGCMasterInfo_find_free_id() {
|
||||
+ int i, size;
|
||||
+
|
||||
+ GC_ASSERT(MASTERGCINFO->alive <= MASTERGCINFO->size);
|
||||
+ if ((MASTERGCINFO->alive + 1) == MASTERGCINFO->size) {
|
||||
+ void **new_signal_fds;
|
||||
+
|
||||
+ size = MASTERGCINFO->size * 2;
|
||||
+ new_signal_fds = ofm_malloc(sizeof(void*) * size);
|
||||
+ memcpy(new_signal_fds, MASTERGCINFO->signal_fds, sizeof(void*) * MASTERGCINFO->size);
|
||||
+
|
||||
+ for (i = MASTERGCINFO->size; i < size; i++ ) {
|
||||
+ new_signal_fds[i] = (void *)REAPED_SLOT_AVAILABLE;
|
||||
+ }
|
||||
+
|
||||
+ ofm_free(MASTERGCINFO->signal_fds, sizeof(void*) * MASTERGCINFO->size);
|
||||
+
|
||||
+ MASTERGCINFO->signal_fds = new_signal_fds;
|
||||
+ MASTERGCINFO->size = size;
|
||||
+ }
|
||||
+
|
||||
+ size = MASTERGCINFO->size;
|
||||
+ for (i = 0; i < size; i++) {
|
||||
+ if (MASTERGCINFO->signal_fds[i] == (void*) REAPED_SLOT_AVAILABLE) {
|
||||
+ MASTERGCINFO->alive++;
|
||||
+ return i;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ printf("Error in MASTERGCINFO table\n");
|
||||
+ abort();
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void NewGCMasterInfo_register_gc(NewGC *newgc) {
|
||||
+ mzrt_rwlock_wrlock(MASTERGCINFO->cangc);
|
||||
+ {
|
||||
+ intptr_t newid = NewGCMasterInfo_find_free_id();
|
||||
+ newgc->place_id = newid;
|
||||
+ MASTERGCINFO->signal_fds[newid] = (void *) CREATED_BUT_NOT_REGISTERED;
|
||||
+ }
|
||||
+ mzrt_rwlock_unlock(MASTERGCINFO->cangc);
|
||||
+}
|
||||
+
|
||||
+void GC_set_put_external_event_fd(void *fd) {
|
||||
+ NewGC *gc = GC_get_GC();
|
||||
+ mzrt_rwlock_wrlock(MASTERGCINFO->cangc);
|
||||
+ {
|
||||
+ if ( MASTERGCINFO->signal_fds[gc->place_id] == (void*) SIGNALED_BUT_NOT_REGISTERED) {
|
||||
+ scheme_signal_received_at(fd);
|
||||
+ /* printf("%i THERE WAITING ON ME\n", gc->place_id); */
|
||||
+ }
|
||||
+ MASTERGCINFO->signal_fds[gc->place_id] = fd;
|
||||
+ }
|
||||
+ mzrt_rwlock_unlock(MASTERGCINFO->cangc);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+/*****************************************************************************/
|
||||
+/* Creating and switching GCs */
|
||||
+/*****************************************************************************/
|
||||
+
|
||||
+#ifdef MZ_USE_PLACES
|
||||
+void GC_construct_child_gc(struct NewGC *parent_gc, intptr_t limit) {
|
||||
+ NewGC *gc = MASTERGC;
|
||||
+ NewGC *newgc = init_type_tags_worker(gc, parent_gc, 0, 0, 0, gc->weak_box_tag, gc->ephemeron_tag,
|
||||
+ gc->weak_array_tag, gc->cust_box_tag, gc->phantom_tag);
|
||||
+ newgc->primoridal_gc = MASTERGC;
|
||||
+ newgc->dont_master_gc_until_child_registers = 1;
|
||||
+ if (limit)
|
||||
+ newgc->place_memory_limit = limit;
|
||||
+}
|
||||
+
|
||||
+void GC_destruct_child_gc() {
|
||||
+ NewGC *gc = GC_get_GC();
|
||||
+ int waiting = 0;
|
||||
+
|
||||
+ do {
|
||||
+ mzrt_rwlock_wrlock(MASTERGCINFO->cangc);
|
||||
+ waiting = MASTERGC->major_places_gc;
|
||||
+ if (!waiting) {
|
||||
+ MASTERGCINFO->signal_fds[gc->place_id] = (void *) REAPED_SLOT_AVAILABLE;
|
||||
+ gc->place_id = -1;
|
||||
+ MASTERGCINFO->alive--;
|
||||
+ }
|
||||
+ mzrt_rwlock_unlock(MASTERGCINFO->cangc);
|
||||
+
|
||||
+ if (waiting) {
|
||||
+ collect_now(gc, 1, 0);
|
||||
+ waiting = 1;
|
||||
+ }
|
||||
+ } while (waiting == 1);
|
||||
+
|
||||
+ free_child_gc();
|
||||
+}
|
||||
+
|
||||
+static inline void save_globals_to_gc(NewGC *gc) {
|
||||
+ gc->saved_GC_variable_stack = GC_variable_stack;
|
||||
+ gc->saved_GC_gen0_alloc_page_ptr = GC_gen0_alloc_page_ptr;
|
||||
+ gc->saved_GC_gen0_alloc_page_end = GC_gen0_alloc_page_end;
|
||||
+}
|
||||
+
|
||||
+static inline void restore_globals_from_gc(NewGC *gc) {
|
||||
+ GC_variable_stack = gc->saved_GC_variable_stack;
|
||||
+ GC_gen0_alloc_page_ptr = gc->saved_GC_gen0_alloc_page_ptr;
|
||||
+ GC_gen0_alloc_page_end = gc->saved_GC_gen0_alloc_page_end;
|
||||
+}
|
||||
+
|
||||
+void GC_switch_out_master_gc() {
|
||||
+ static int initialized = 0;
|
||||
+
|
||||
+ if(!initialized) {
|
||||
+ NewGC *gc = GC_get_GC();
|
||||
+
|
||||
+ initialized = 1;
|
||||
+
|
||||
+ if (!gc->avoid_collection)
|
||||
+ garbage_collect(gc, 1, 0, 1, NULL);
|
||||
+
|
||||
+#ifdef MZ_USE_PLACES
|
||||
+ GC_gen0_alloc_page_ptr = 2;
|
||||
+ GC_gen0_alloc_page_end = 1;
|
||||
+ gc->dont_master_gc_until_child_registers = 0;
|
||||
+#endif
|
||||
+
|
||||
+ MASTERGC = gc;
|
||||
+
|
||||
+ save_globals_to_gc(MASTERGC);
|
||||
+ GC_construct_child_gc(NULL, 0);
|
||||
+ GC_allow_master_gc_check();
|
||||
+ }
|
||||
+ else {
|
||||
+ GCPRINT(GCOUTF, "GC_switch_out_master_gc should only be called once!\n");
|
||||
+ abort();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*used in scheme_master_fast_path*/
|
||||
+void *GC_switch_to_master_gc() {
|
||||
+ NewGC *gc = GC_get_GC();
|
||||
+ /* return if MASTERGC hasn't been constructed yet, allow recursive locking */
|
||||
+ if (premaster_or_master_gc(gc)) { return MASTERGC; }
|
||||
+
|
||||
+ save_globals_to_gc(gc);
|
||||
+
|
||||
+ /*obtain exclusive access to MASTERGC*/
|
||||
+ mzrt_rwlock_wrlock(MASTERGCINFO->cangc);
|
||||
+
|
||||
+ GC_set_GC(MASTERGC);
|
||||
+ restore_globals_from_gc(MASTERGC);
|
||||
+ return gc;
|
||||
+}
|
||||
+
|
||||
+void GC_switch_back_from_master(void *gc) {
|
||||
+ /* return if MASTERGC hasn't been constructed yet, allow recursive locking */
|
||||
+ if (premaster_or_master_gc(gc)) { return; }
|
||||
+ save_globals_to_gc(MASTERGC);
|
||||
+
|
||||
+ /*release exclusive access to MASTERGC*/
|
||||
+ mzrt_rwlock_unlock(MASTERGCINFO->cangc);
|
||||
+
|
||||
+ GC_set_GC(gc);
|
||||
+ restore_globals_from_gc(gc);
|
||||
+}
|
||||
+
|
||||
+int GC_is_using_master() {
|
||||
+ return postmaster_and_master_gc(GC_get_GC());
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+/*****************************************************************************/
|
||||
+/* More debugging */
|
||||
+/*****************************************************************************/
|
||||
+
|
||||
+/* Debuging pointer ownership */
|
||||
+/* #define POINTER_OWNERSHIP_CHECK 1 */
|
||||
+
|
||||
+#define SHARED_PAGE_ORPHANED ((NewGC *)0x1)
|
||||
+
|
||||
+#ifdef POINTER_OWNERSHIP_CHECK
|
||||
+
|
||||
+static mzrt_mutex *lock;
|
||||
+static PageMap shared_pagemap;
|
||||
+
|
||||
+static void shared_pagemap_set(void *ptr, size_t len, NewGC *owner)
|
||||
+{
|
||||
+ if (!lock) {
|
||||
+ mzrt_mutex_create(&lock);
|
||||
+# ifdef SIXTY_FOUR_BIT_INTEGERS
|
||||
+ shared_pagemap = ofm_malloc_zero(PAGEMAP64_LEVEL1_SIZE * sizeof (mpage***));
|
||||
+# else
|
||||
+ shared_pagemap = ofm_malloc_zero(PAGEMAP32_SIZE * sizeof (mpage*));
|
||||
+# endif
|
||||
+ }
|
||||
+
|
||||
+ mzrt_mutex_lock(lock);
|
||||
+ while (len > 0) {
|
||||
+ pagemap_set(shared_pagemap, ptr, (mpage*)owner);
|
||||
+ len -= APAGE_SIZE;
|
||||
+ ptr = (char *)ptr + APAGE_SIZE;
|
||||
+ }
|
||||
+ mzrt_mutex_unlock(lock);
|
||||
+}
|
||||
+
|
||||
+static void check_page_owner(NewGC *gc, const void *p)
|
||||
+{
|
||||
+ NewGC *owner;
|
||||
+ owner = (NewGC *)pagemap_find_page(shared_pagemap, p);
|
||||
+ if (owner && (owner != gc) && (owner != MASTERGC) && (owner != SHARED_PAGE_ORPHANED)) {
|
||||
+ mzrt_mutex_lock(lock);
|
||||
+ owner = (NewGC *)pagemap_find_page(shared_pagemap, p);
|
||||
+ if (owner && (owner != gc) && (owner != MASTERGC) && (owner != SHARED_PAGE_ORPHANED)) {
|
||||
+ printf("%p is owned by place %i not the current place %i\n", p, owner->place_id, gc->place_id);
|
||||
+ abort();
|
||||
+ }
|
||||
+ mzrt_mutex_unlock(lock);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+
|
||||
+static void shared_pagemap_set(void *ptr, size_t len, NewGC *owner) { }
|
||||
+static void check_page_owner(NewGC *gc, const void *p) { }
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+/*****************************************************************************/
|
||||
+/* Memory-use propagation */
|
||||
+/*****************************************************************************/
|
||||
+
|
||||
+intptr_t GC_propagate_hierarchy_memory_use()
|
||||
+{
|
||||
+ NewGC *gc = GC_get_GC();
|
||||
+
|
||||
+#ifdef MZ_USE_PLACES
|
||||
+ if (gc->parent_gc) {
|
||||
+ /* report memory use to parent */
|
||||
+ intptr_t total = gc->memory_in_use + gc->child_gc_total;
|
||||
+ intptr_t delta = total - gc->previously_reported_total;
|
||||
+ mzrt_mutex_lock(gc->parent_gc->child_total_lock);
|
||||
+ gc->parent_gc->child_gc_total += delta;
|
||||
+ mzrt_mutex_unlock(gc->parent_gc->child_total_lock);
|
||||
+ gc->previously_reported_total = total;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+ return add_no_overflow(gc->memory_in_use, gc->child_gc_total);
|
||||
+}
|
@ -1,16 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_include_scheme_h,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/include/scheme.h.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/include/scheme.h Tue Feb 9 23:13:12 2016
|
||||
@@ -700,7 +700,7 @@ typedef struct Scheme_Offset_Cptr
|
||||
/* fast basic Scheme constructor macros */
|
||||
/*========================================================================*/
|
||||
|
||||
-#define scheme_make_integer(i) LONG_TO_OBJ ((OBJ_TO_LONG(i) << 1) | 0x1)
|
||||
+#define scheme_make_integer(i) LONG_TO_OBJ ((((uintptr_t)OBJ_TO_LONG(i)) << 1) | 0x1)
|
||||
#define scheme_make_character(ch) ((((mzchar)ch) < 256) ? scheme_char_constants[(unsigned char)(ch)] : scheme_make_char(ch))
|
||||
#define scheme_make_ascii_character(ch) scheme_char_constants[(unsigned char)(ch)]
|
||||
|
@ -1,43 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_bignum_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/src/bignum.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/bignum.c Tue Feb 9 23:13:12 2016
|
||||
@@ -193,7 +193,7 @@ Scheme_Object *scheme_make_small_bignum(intptr_t v, Sm
|
||||
o->o.iso.so.type = scheme_bignum_type;
|
||||
SCHEME_SET_BIGPOS(&o->o, ((v >= 0) ? 1 : 0));
|
||||
if (v < 0)
|
||||
- bv = -v;
|
||||
+ bv = -((bigdig)v);
|
||||
else
|
||||
bv = v;
|
||||
|
||||
@@ -414,7 +414,7 @@ int scheme_bignum_get_long_long_val(const Scheme_Objec
|
||||
/* Special case for the most negative number representable in a signed long long */
|
||||
mzlonglong v2;
|
||||
v2 = 1;
|
||||
- v2 = (v2 << 63);
|
||||
+ v2 = ((umzlonglong)v2 << 63);
|
||||
*v = v2;
|
||||
return 1;
|
||||
} else if ((SCHEME_BIGDIG(o)[MAX_BN_SIZE_FOR_LL - 1] & FIRST_BIT_MASK_LL) != 0) { /* Won't fit into a signed long long */
|
||||
@@ -423,7 +423,7 @@ int scheme_bignum_get_long_long_val(const Scheme_Objec
|
||||
mzlonglong v2;
|
||||
v2 = SCHEME_BIGDIG(o)[0];
|
||||
if (SCHEME_BIGLEN(o) > 1) {
|
||||
- v2 |= ((mzlonglong)(SCHEME_BIGDIG(o)[1])) << 32;
|
||||
+ v2 |= ((umzlonglong)(SCHEME_BIGDIG(o)[1])) << 32;
|
||||
}
|
||||
if (!SCHEME_BIGPOS(o)) {
|
||||
v2 = -v2;
|
||||
@@ -1658,7 +1658,7 @@ static uintptr_t fixnum_sqrt(uintptr_t n, uintptr_t *r
|
||||
|
||||
for (i = SQRT_BIT_MAX; i >= 0; i--)
|
||||
{
|
||||
- try_root = root | ((intptr_t)0x1 << i);
|
||||
+ try_root = root | ((uintptr_t)0x1 << i);
|
||||
try_square = try_root * try_root;
|
||||
if (try_square <= n)
|
||||
{
|
@ -1,15 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_env_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"clean up GC implementation"
|
||||
https://github.com/racket/racket/commit/2ee721f
|
||||
|
||||
--- src/racket/src/env.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/env.c Tue Feb 9 23:51:58 2016
|
||||
@@ -570,7 +570,6 @@ static Scheme_Env *place_instance_init(void *stack_bas
|
||||
scheme_init_error_config();
|
||||
|
||||
/* BEGIN PRIMITIVE MODULES */
|
||||
- scheme_init_memtrace(env);
|
||||
#ifndef NO_TCP_SUPPORT
|
||||
scheme_init_network(env);
|
||||
#endif
|
@ -1,16 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_eval_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/src/eval.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/eval.c Tue Feb 9 23:13:12 2016
|
||||
@@ -6112,7 +6112,7 @@ static void mark_pruned_prefixes(struct NewGC *gc) XFO
|
||||
for (i = (maxpos + 31) / 32; i--; ) {
|
||||
int j;
|
||||
for (j = 0; j < 32; j++) {
|
||||
- if (!(use_bits[i] & (1 << j))) {
|
||||
+ if (!(use_bits[i] & ((unsigned)1 << j))) {
|
||||
int pos;
|
||||
pos = (i * 32) + j;
|
||||
if (pos < pf->num_toplevels)
|
@ -1,59 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_fun_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
"Avoid compiler warnings"
|
||||
https://github.com/racket/racket/commit/65eaff3
|
||||
|
||||
"fix mishandling of the continuation-mark depth"
|
||||
https://github.com/racket/racket/commit/81b5d74ed695b4d73b341194ccb77128b54a3fef
|
||||
|
||||
--- src/racket/src/fun.c.orig Sun Jan 24 16:39:49 2016
|
||||
+++ src/racket/src/fun.c Sun Feb 28 00:33:35 2016
|
||||
@@ -1202,7 +1202,7 @@ void scheme_set_dynamic_state(Scheme_Dynamic_State *st
|
||||
state->menv = menv;
|
||||
}
|
||||
|
||||
-static void *apply_again_k()
|
||||
+static void *apply_again_k(void)
|
||||
{
|
||||
Scheme_Thread *p = scheme_current_thread;
|
||||
Scheme_Object *val = p->ku.k.p1;
|
||||
@@ -2587,7 +2587,7 @@ Scheme_Object *scheme_get_or_check_procedure_shape(Sch
|
||||
/* Integer encoding, but shift to use low bit to indicate whether
|
||||
it preserves marks, which is useful information for the JIT. */
|
||||
intptr_t i = SCHEME_INT_VAL(p);
|
||||
- i <<= 1;
|
||||
+ i = ((uintptr_t)i) << 1;
|
||||
if (scheme_closure_preserves_marks(e)) {
|
||||
i |= 0x1;
|
||||
}
|
||||
@@ -3640,7 +3640,7 @@ static Scheme_Object *_apply_native(Scheme_Object *obj
|
||||
obj = data->start_code(obj, num_rands, rands EXTRA_NATIVE_ARGUMENT);
|
||||
|
||||
if (obj == SCHEME_TAIL_CALL_WAITING)
|
||||
- obj = force_values(obj, 1);
|
||||
+ obj = scheme_force_value_same_mark(obj);
|
||||
|
||||
MZ_CONT_MARK_STACK = old_cont_mark_stack;
|
||||
MZ_CONT_MARK_POS -= 2;
|
||||
@@ -9834,7 +9834,8 @@ static Scheme_Object *seconds_to_date(int argc, Scheme
|
||||
{
|
||||
UNBUNDLE_TIME_TYPE lnow;
|
||||
int get_gmt;
|
||||
- int hour, min, sec, month, day, year, wday, yday, dst;
|
||||
+ int hour, min, sec, month, day, wday, yday, dst;
|
||||
+ intptr_t year;
|
||||
long tzoffset;
|
||||
#ifdef USE_WIN32_TIME
|
||||
# define CHECK_TIME_T uintptr_t
|
||||
@@ -9959,7 +9960,7 @@ static Scheme_Object *seconds_to_date(int argc, Scheme
|
||||
|
||||
month = localTime->tm_mon + 1;
|
||||
day = localTime->tm_mday;
|
||||
- year = localTime->tm_year + 1900;
|
||||
+ year = (uintptr_t)localTime->tm_year + 1900;
|
||||
|
||||
wday = localTime->tm_wday;
|
||||
yday = localTime->tm_yday;
|
@ -1,64 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_hash_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
"fix a problem with 'hash-remove'"
|
||||
https://github.com/racket/racket/commit/9494216a9bd4431
|
||||
|
||||
--- src/racket/src/hash.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/hash.c Sun Feb 28 00:21:23 2016
|
||||
@@ -1387,9 +1387,10 @@ XFORM_NONGCING static uintptr_t fast_equal_hash_key(Sc
|
||||
if (!(MZ_OPT_HASH_KEY(&s->iso) & 0x1)) {
|
||||
/* Interned. Make key depend only on the content. */
|
||||
if (!(MZ_OPT_HASH_KEY(&s->iso) & 0xFFFC)) {
|
||||
- int i, h = 0;
|
||||
+ int i;
|
||||
+ unsigned int h = 0;
|
||||
for (i = s->len; i--; ) {
|
||||
- h += (h << 5) + h + s->s[i];
|
||||
+ h += (h << 5) + h + (unsigned int)s->s[i];
|
||||
}
|
||||
h += (h << 2);
|
||||
if (!(((short)h) & 0xFFFC))
|
||||
@@ -2617,7 +2618,9 @@ static Scheme_Hash_Tree *hamt_remove(Scheme_Hash_Tree
|
||||
return hamt_contract(ht, popcount, index, pos);
|
||||
ht = hamt_dup(ht, popcount);
|
||||
ht->count -= 1;
|
||||
- if ((sub_ht->count == 1) && !HASHTR_SUBTREEP(sub_ht->els[0])) {
|
||||
+ if (((sub_ht->count == 1) && !HASHTR_SUBTREEP(sub_ht->els[0]))
|
||||
+ || (HASHTR_COLLISIONP(sub_ht->els[0])
|
||||
+ && (sub_ht->count == ((Scheme_Hash_Tree *)sub_ht->els[0])->count))) {
|
||||
/* drop extra layer that has 1 immediate entry */
|
||||
ht->els[pos] = sub_ht->els[0];
|
||||
if (SCHEME_HASHTR_FLAGS(ht) & HASHTR_HAS_VAL) {
|
||||
@@ -2759,7 +2762,7 @@ XFORM_NONGCING static uintptr_t hamt_find_free_code(Sc
|
||||
Scheme_Hash_Tree *subtree;
|
||||
|
||||
for (i = 0; i < mzHAMT_WORD_SIZE; i++) {
|
||||
- if (!(tree->bitmap & (1 << i)))
|
||||
+ if (!(tree->bitmap & ((unsigned)1 << i)))
|
||||
return (i << shift) + base;
|
||||
}
|
||||
|
||||
@@ -2768,9 +2771,9 @@ XFORM_NONGCING static uintptr_t hamt_find_free_code(Sc
|
||||
minpos = mzHAMT_WORD_SIZE;
|
||||
for (i = mzHAMT_WORD_SIZE; i--; ) {
|
||||
if (!HASHTR_SUBTREEP(tree->els[i])) {
|
||||
- uintptr_t code = (i << shift) + base;
|
||||
+ uintptr_t code = ((unsigned)i << shift) + base;
|
||||
if (_mzHAMT_CODE(tree, i, mzHAMT_WORD_SIZE) == code)
|
||||
- return code + (1 << (shift + mzHAMT_LOG_WORD_SIZE));
|
||||
+ return code + ((unsigned)1 << (shift + mzHAMT_LOG_WORD_SIZE));
|
||||
else
|
||||
return code;
|
||||
} else {
|
||||
@@ -2784,7 +2787,7 @@ XFORM_NONGCING static uintptr_t hamt_find_free_code(Sc
|
||||
}
|
||||
|
||||
return hamt_find_free_code((Scheme_Hash_Tree *)tree->els[minpos],
|
||||
- (minpos << shift) + base,
|
||||
+ ((unsigned)minpos << shift) + base,
|
||||
shift + mzHAMT_LOG_WORD_SIZE);
|
||||
}
|
||||
|
@ -1,16 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_jit_h,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/src/jit.h.orig Mon Jan 11 18:07:43 2016
|
||||
+++ src/racket/src/jit.h Tue Feb 9 23:13:12 2016
|
||||
@@ -94,7 +94,7 @@ END_XFORM_ARITH;
|
||||
# define JIT_LOG_WORD_SIZE 2
|
||||
#endif
|
||||
#define JIT_WORD_SIZE (1 << JIT_LOG_WORD_SIZE)
|
||||
-#define WORDS_TO_BYTES(x) ((x) << JIT_LOG_WORD_SIZE)
|
||||
+#define WORDS_TO_BYTES(x) ((unsigned)(x) << JIT_LOG_WORD_SIZE)
|
||||
#define MAX_TRY_SHIFT 30
|
||||
|
||||
#ifdef USE_THREAD_LOCAL
|
@ -1,84 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_jitarith_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/src/jitarith.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/jitarith.c Tue Feb 9 23:13:12 2016
|
||||
@@ -1640,7 +1640,7 @@ int scheme_generate_arith_for(mz_jit_state *jitter, Sc
|
||||
__START_INNER_TINY__(branch_short);
|
||||
/* watch out for negation of most negative fixnum,
|
||||
which is a positive number too big for a fixnum */
|
||||
- refz = jit_beqi_p(jit_forward(), JIT_R0, (void *)(((intptr_t)1 << ((8 * JIT_WORD_SIZE) - 2))));
|
||||
+ refz = jit_beqi_p(jit_forward(), JIT_R0, (void *)(((uintptr_t)1 << ((8 * JIT_WORD_SIZE) - 2))));
|
||||
__END_INNER_TINY__(branch_short);
|
||||
if (reversed)
|
||||
jit_mulr_l(JIT_R2, JIT_R0, JIT_R2);
|
||||
@@ -1678,12 +1678,12 @@ int scheme_generate_arith_for(mz_jit_state *jitter, Sc
|
||||
if (!unsafe_fx || overflow_refslow) {
|
||||
GC_CAN_IGNORE jit_insn *refx;
|
||||
__START_INNER_TINY__(branch_short);
|
||||
- refx = jit_bnei_p(jit_forward(), JIT_R0, (void *)(((intptr_t)1 << ((8 * JIT_WORD_SIZE) - 2))));
|
||||
+ refx = jit_bnei_p(jit_forward(), JIT_R0, (void *)(((uintptr_t)1 << ((8 * JIT_WORD_SIZE) - 2))));
|
||||
__END_INNER_TINY__(branch_short);
|
||||
/* first argument must have been most negative fixnum,
|
||||
second argument must have been -1: */
|
||||
if (reversed)
|
||||
- (void)jit_movi_p(JIT_R0, (void *)(((intptr_t)1 << ((8 * JIT_WORD_SIZE) - 1)) | 0x1));
|
||||
+ (void)jit_movi_p(JIT_R0, (void *)(((uintptr_t)1 << ((8 * JIT_WORD_SIZE) - 1)) | 0x1));
|
||||
else
|
||||
(void)jit_movi_p(JIT_R0, scheme_make_integer(-1));
|
||||
(void)jit_jmpi(refslow);
|
||||
@@ -1800,10 +1800,10 @@ int scheme_generate_arith_for(mz_jit_state *jitter, Sc
|
||||
/* Non-constant arg is in JIT_R0 */
|
||||
if (arith == ARITH_ADD) {
|
||||
if (unsafe_fx && !overflow_refslow)
|
||||
- jit_addi_l(dest, JIT_R0, v << 1);
|
||||
+ jit_addi_l(dest, JIT_R0, (uintptr_t)v << 1);
|
||||
else {
|
||||
jit_movr_p(JIT_R2, JIT_R0);
|
||||
- (void)jit_boaddi_l(refslow, JIT_R2, v << 1);
|
||||
+ (void)jit_boaddi_l(refslow, JIT_R2, (uintptr_t)v << 1);
|
||||
jit_movr_p(dest, JIT_R2);
|
||||
}
|
||||
} else if (arith == ARITH_SUB) {
|
||||
@@ -1816,10 +1816,10 @@ int scheme_generate_arith_for(mz_jit_state *jitter, Sc
|
||||
jit_addi_ul(dest, JIT_R2, 0x1);
|
||||
} else {
|
||||
if (unsafe_fx && !overflow_refslow)
|
||||
- jit_subi_l(dest, JIT_R0, v << 1);
|
||||
+ jit_subi_l(dest, JIT_R0, (uintptr_t)v << 1);
|
||||
else {
|
||||
jit_movr_p(JIT_R2, JIT_R0);
|
||||
- (void)jit_bosubi_l(refslow, JIT_R2, v << 1);
|
||||
+ (void)jit_bosubi_l(refslow, JIT_R2, (uintptr_t)v << 1);
|
||||
jit_movr_p(dest, JIT_R2);
|
||||
}
|
||||
}
|
||||
@@ -1851,7 +1851,7 @@ int scheme_generate_arith_for(mz_jit_state *jitter, Sc
|
||||
jit_ori_ul(dest, JIT_R0, l);
|
||||
} else if (arith == ARITH_XOR) {
|
||||
/* xor */
|
||||
- jit_xori_ul(dest, JIT_R0, v << 1);
|
||||
+ jit_xori_ul(dest, JIT_R0, (uintptr_t)v << 1);
|
||||
} else if ((arith == ARITH_LSH) || (arith == ARITH_RSH)) {
|
||||
/* arithmetic-shift */
|
||||
/* We only get here when v is between -MAX_TRY_SHIFT and MAX_TRY_SHIFT, inclusive */
|
||||
@@ -1902,7 +1902,7 @@ int scheme_generate_arith_for(mz_jit_state *jitter, Sc
|
||||
__END_INNER_TINY__(branch_short);
|
||||
/* watch out for most negative fixnum! */
|
||||
if (!unsafe_fx || overflow_refslow)
|
||||
- (void)jit_beqi_p(refslow, JIT_R0, (void *)(((intptr_t)1 << ((8 * JIT_WORD_SIZE) - 1)) | 0x1));
|
||||
+ (void)jit_beqi_p(refslow, JIT_R0, (void *)(((uintptr_t)1 << ((8 * JIT_WORD_SIZE) - 1)) | 0x1));
|
||||
(void)jit_movi_p(JIT_R1, scheme_make_integer(0));
|
||||
jit_subr_l(JIT_R0, JIT_R1, JIT_R0);
|
||||
jit_ori_l(JIT_R0, JIT_R0, 0x1);
|
||||
@@ -2040,7 +2040,7 @@ int scheme_generate_arith_for(mz_jit_state *jitter, Sc
|
||||
jit_lshr_l(JIT_R0, JIT_V1, JIT_R0);
|
||||
ref3 = jit_bmcr_l(jit_forward(), JIT_R1, JIT_R0);
|
||||
} else {
|
||||
- ref3 = jit_bmci_l(jit_forward(), JIT_R0, 1 << (v+1));
|
||||
+ ref3 = jit_bmci_l(jit_forward(), JIT_R0, (uintptr_t)1 << (v+1));
|
||||
rs_can_keep = 1;
|
||||
}
|
||||
break;
|
@ -1,79 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_jitstate_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/src/jitstate.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/jitstate.c Tue Feb 9 23:13:12 2016
|
||||
@@ -502,7 +502,7 @@ void scheme_extra_pushed(mz_jit_state *jitter, int n)
|
||||
}
|
||||
v = (jitter->mappings[jitter->num_mappings]) >> 2;
|
||||
v += n;
|
||||
- jitter->mappings[jitter->num_mappings] = ((v << 2) | 0x1);
|
||||
+ jitter->mappings[jitter->num_mappings] = (((unsigned)v << 2) | 0x1);
|
||||
}
|
||||
|
||||
void scheme_mz_pushr_p_it(mz_jit_state *jitter, int reg)
|
||||
@@ -534,7 +534,7 @@ void scheme_extra_popped(mz_jit_state *jitter, int n)
|
||||
if (!v)
|
||||
--jitter->num_mappings;
|
||||
else
|
||||
- jitter->mappings[jitter->num_mappings] = ((v << 2) | 0x1);
|
||||
+ jitter->mappings[jitter->num_mappings] = (((unsigned)v << 2) | 0x1);
|
||||
}
|
||||
|
||||
void scheme_mz_popr_p_it(mz_jit_state *jitter, int reg, int discard)
|
||||
@@ -570,7 +570,7 @@ void scheme_mz_runstack_skipped(mz_jit_state *jitter,
|
||||
v = (jitter->mappings[jitter->num_mappings]) >> 2;
|
||||
JIT_ASSERT(v <= 0);
|
||||
v -= n;
|
||||
- jitter->mappings[jitter->num_mappings] = ((v << 2) | 0x1);
|
||||
+ jitter->mappings[jitter->num_mappings] = (((unsigned)v << 2) | 0x1);
|
||||
jitter->self_pos += n;
|
||||
}
|
||||
|
||||
@@ -589,7 +589,7 @@ void scheme_mz_runstack_unskipped(mz_jit_state *jitter
|
||||
if (!v)
|
||||
--jitter->num_mappings;
|
||||
else
|
||||
- jitter->mappings[jitter->num_mappings] = ((v << 2) | 0x1);
|
||||
+ jitter->mappings[jitter->num_mappings] = (((unsigned)v << 2) | 0x1);
|
||||
jitter->self_pos -= n;
|
||||
}
|
||||
|
||||
@@ -603,7 +603,7 @@ void scheme_mz_runstack_pushed(mz_jit_state *jitter, i
|
||||
|| (jitter->mappings[jitter->num_mappings] & 0x3)) {
|
||||
new_mapping(jitter);
|
||||
}
|
||||
- jitter->mappings[jitter->num_mappings] += (n << 2);
|
||||
+ jitter->mappings[jitter->num_mappings] += ((unsigned)n << 2);
|
||||
jitter->need_set_rs = 1;
|
||||
}
|
||||
|
||||
@@ -614,7 +614,7 @@ void scheme_mz_runstack_closure_pushed(mz_jit_state *j
|
||||
jitter->max_depth = jitter->depth;
|
||||
jitter->self_pos += 1;
|
||||
new_mapping(jitter);
|
||||
- jitter->mappings[jitter->num_mappings] = (a << 4) | (flags << 2) | 0x2;
|
||||
+ jitter->mappings[jitter->num_mappings] = ((unsigned)a << 4) | ((unsigned)flags << 2) | 0x2;
|
||||
jitter->need_set_rs = 1;
|
||||
/* closures are never popped; they go away due to returns or tail calls */
|
||||
}
|
||||
@@ -627,7 +627,7 @@ void scheme_mz_runstack_flonum_pushed(mz_jit_state *ji
|
||||
jitter->max_depth = jitter->depth;
|
||||
jitter->self_pos += 1;
|
||||
new_mapping(jitter);
|
||||
- jitter->mappings[jitter->num_mappings] = (pos << 2) | 0x3;
|
||||
+ jitter->mappings[jitter->num_mappings] = ((unsigned)pos << 2) | 0x3;
|
||||
jitter->need_set_rs = 1;
|
||||
/* flonums are never popped; they go away due to returns or tail calls */
|
||||
}
|
||||
@@ -651,7 +651,7 @@ void scheme_mz_runstack_popped(mz_jit_state *jitter, i
|
||||
if (!v)
|
||||
--jitter->num_mappings;
|
||||
else
|
||||
- jitter->mappings[jitter->num_mappings] = (v << 2);
|
||||
+ jitter->mappings[jitter->num_mappings] = ((unsigned)v << 2);
|
||||
jitter->need_set_rs = 1;
|
||||
}
|
||||
|
@ -1,53 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_letrec_check_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"add stack-overflow check in compiler's letrec-check pass"
|
||||
https://github.com/racket/racket/commit/db04b47cdb924aa302cf7d4187c801f470cf8965
|
||||
|
||||
--- src/racket/src/letrec_check.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/letrec_check.c Wed Feb 17 23:29:40 2016
|
||||
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "schpriv.h"
|
||||
+#include "schmach.h"
|
||||
|
||||
/* PLAN:
|
||||
*
|
||||
@@ -1032,9 +1033,37 @@ static Scheme_Object *letrec_check_module(Scheme_Objec
|
||||
return o;
|
||||
}
|
||||
|
||||
+static Scheme_Object *letrec_check_k(void)
|
||||
+{
|
||||
+ Scheme_Thread *p = scheme_current_thread;
|
||||
+ Scheme_Object *expr = (Scheme_Object *)p->ku.k.p1;
|
||||
+ Letrec_Check_Frame *frame = (Letrec_Check_Frame *)p->ku.k.p3;
|
||||
+ Scheme_Object *pos = (Scheme_Object *)p->ku.k.p3;
|
||||
+
|
||||
+ p->ku.k.p1 = NULL;
|
||||
+ p->ku.k.p2 = NULL;
|
||||
+ p->ku.k.p3 = NULL;
|
||||
+
|
||||
+ return letrec_check_expr(expr, frame, pos);
|
||||
+}
|
||||
+
|
||||
static Scheme_Object *letrec_check_expr(Scheme_Object *expr, Letrec_Check_Frame *frame, Scheme_Object *pos)
|
||||
{
|
||||
int type;
|
||||
+
|
||||
+#ifdef DO_STACK_CHECK
|
||||
+# include "mzstkchk.h"
|
||||
+ {
|
||||
+ Scheme_Thread *p = scheme_current_thread;
|
||||
+
|
||||
+ p->ku.k.p1 = (void *)expr;
|
||||
+ p->ku.k.p2 = (void *)frame;
|
||||
+ p->ku.k.p3 = (void *)pos;
|
||||
+
|
||||
+ return scheme_handle_stack_overflow(letrec_check_k);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
type = SCHEME_TYPE(expr);
|
||||
|
||||
SCHEME_USE_FUEL(1);
|
@ -1,19 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_lightning_i386_asm-common_h,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/src/lightning/i386/asm-common.h.orig Tue Mar 17 20:22:39 2015
|
||||
+++ src/racket/src/lightning/i386/asm-common.h Tue Feb 9 23:13:12 2016
|
||||
@@ -111,9 +111,9 @@ typedef uintptr_t _ul;
|
||||
#define _jit_L(L) _jit_VD(((*_jit.x.ul_pc++)= _jit_UL((L) )))
|
||||
#define _jit_I_noinc(I) _jit_VD(((*_jit.x.ui_pc)= _jit_UI((I) )))
|
||||
|
||||
-#define _COPY_HIGH_BIT(N, I) (((uintptr_t)(I) & (1 << ((N)-1))) ? ~_MASK(N) : 0)
|
||||
+#define _COPY_HIGH_BIT(N, I) (((uintptr_t)(I) & ((uintptr_t)1 << ((N)-1))) ? ~_MASK(N) : 0)
|
||||
|
||||
-#define _MASK(N) ((uintptr_t)(((intptr_t)1<<(N)))-1)
|
||||
+#define _MASK(N) ((uintptr_t)(((uintptr_t)1<<(N)))-1)
|
||||
#define _siP(N,I) (!((((uintptr_t)(I))^(_COPY_HIGH_BIT(N, I)))&~_MASK(N)))
|
||||
#define _uiP(N,I) (!(((uintptr_t)(I))&~_MASK(N)))
|
||||
#define _suiP(N,I) (_siP(N,I) | _uiP(N,I))
|
@ -1,21 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_marshal_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/src/marshal.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/marshal.c Tue Feb 9 23:13:12 2016
|
||||
@@ -983,11 +983,11 @@ static Scheme_Object *read_compiled_closure(Scheme_Obj
|
||||
for (i = 0; i < len/2; i++) {
|
||||
v1 = SCHEME_INT_VAL(SCHEME_VEC_ELS(tl_map)[2*i]);
|
||||
v2 = SCHEME_INT_VAL(SCHEME_VEC_ELS(tl_map)[(2*i) + 1]);
|
||||
- v2 = (v2 << 16) | v1;
|
||||
+ v2 = ((unsigned int)v2 << 16) | v1;
|
||||
n[i+1] = v2;
|
||||
}
|
||||
if ((len == 2) && (!(n[1] & 0x80000000)))
|
||||
- data->tl_map = (void *)(intptr_t)((n[1] << 1) | 0x1);
|
||||
+ data->tl_map = (void *)(intptr_t)(((uintptr_t)n[1] << 1) | 0x1);
|
||||
else
|
||||
data->tl_map = n;
|
||||
} else
|
@ -1,49 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_module_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
"fix internal array size on module redeclaration"
|
||||
https://github.com/racket/racket/commit/35acfab
|
||||
|
||||
--- src/racket/src/module.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/module.c Wed Feb 10 00:04:46 2016
|
||||
@@ -2249,10 +2249,12 @@ static Scheme_Object *do_namespace_attach_module(const
|
||||
}
|
||||
|
||||
past_checkeds = SCHEME_CDR(past_checkeds);
|
||||
- from_modchain = SCHEME_VEC_ELS(from_modchain)[2];
|
||||
- if (phase > orig_phase)
|
||||
- to_modchain = SCHEME_VEC_ELS(to_modchain)[2];
|
||||
- --phase;
|
||||
+ if (!SCHEME_NULLP(past_checkeds)) {
|
||||
+ from_modchain = SCHEME_VEC_ELS(from_modchain)[2];
|
||||
+ if (phase > orig_phase)
|
||||
+ to_modchain = SCHEME_VEC_ELS(to_modchain)[2];
|
||||
+ --phase;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Notify module name resolver of attached modules: */
|
||||
@@ -4959,7 +4961,7 @@ static void unlock_registry(Scheme_Env *env)
|
||||
|
||||
XFORM_NONGCING static intptr_t make_key(int base_phase, int eval_exp, int eval_run)
|
||||
{
|
||||
- return ((base_phase << 3)
|
||||
+ return (((unsigned)base_phase << 3)
|
||||
| (eval_exp ? ((eval_exp > 0) ? 2 : 4) : 0)
|
||||
| (eval_run ? 1 : 0));
|
||||
}
|
||||
@@ -5432,6 +5434,12 @@ static Scheme_Env *instantiate_module(Scheme_Module *m
|
||||
menv->link_midx = syntax_idx;
|
||||
} else {
|
||||
Scheme_Env *env2;
|
||||
+
|
||||
+ if (menv->module->num_phases < m->num_phases) {
|
||||
+ char *running;
|
||||
+ running = (char *)scheme_malloc_atomic(m->num_phases);
|
||||
+ menv->running = running;
|
||||
+ }
|
||||
|
||||
menv->module = m;
|
||||
memset(menv->running, 0, menv->module->num_phases);
|
@ -1,29 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_mzclpf_post_inc,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/src/mzclpf_post.inc.orig Mon Jan 11 18:07:43 2016
|
||||
+++ src/racket/src/mzclpf_post.inc Tue Feb 9 23:13:12 2016
|
||||
@@ -58,8 +58,8 @@
|
||||
map = (((uintptr_t)data->tl_map) >> 1) & 0x7FFFFFFF;
|
||||
if ((use_bits[0] & map) != map) {
|
||||
for (i = 0; i < 31; i++) {
|
||||
- if (map & (1 << i)) {
|
||||
- if (!(use_bits[0] & (1 << i))) {
|
||||
+ if (map & ((unsigned int)1 << i)) {
|
||||
+ if (!(use_bits[0] & ((unsigned int)1 << i))) {
|
||||
if ((i < pf->num_toplevels) || !pf->num_stxes)
|
||||
gcMARK2(pf->a[i], gc); /* top level */
|
||||
else if (i == pf->num_toplevels)
|
||||
@@ -78,8 +78,8 @@
|
||||
map = u[i+1];
|
||||
if ((use_bits[i] & map) != map) {
|
||||
for (j = 0; j < 32; j++) {
|
||||
- if (map & (1 << j)) {
|
||||
- if (!(use_bits[i] & (1 << j))) {
|
||||
+ if (map & ((unsigned int)1 << j)) {
|
||||
+ if (!(use_bits[i] & ((unsigned int)1 << j))) {
|
||||
pos = (i * 32) + j;
|
||||
if ((pos < pf->num_toplevels) || !pf->num_stxes)
|
||||
gcMARK2(pf->a[pos], gc); /* top level */
|
@ -1,55 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_numarith_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/src/numarith.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/numarith.c Tue Feb 9 23:13:12 2016
|
||||
@@ -592,12 +592,12 @@ static Scheme_Object *ADD(intptr_t a, intptr_t b)
|
||||
intptr_t r;
|
||||
Scheme_Object *o;
|
||||
|
||||
- r = a + b;
|
||||
+ r = (uintptr_t)a + (uintptr_t)b;
|
||||
|
||||
o = scheme_make_integer(r);
|
||||
r = SCHEME_INT_VAL(o);
|
||||
|
||||
- if (b == r - a)
|
||||
+ if (b == (uintptr_t)r - (uintptr_t)a)
|
||||
return o;
|
||||
else
|
||||
return ADD_slow(a, b);
|
||||
@@ -615,12 +615,12 @@ static Scheme_Object *SUBTRACT(intptr_t a, intptr_t b)
|
||||
intptr_t r;
|
||||
Scheme_Object *o;
|
||||
|
||||
- r = a - b;
|
||||
+ r = (uintptr_t)a - (uintptr_t)b;
|
||||
|
||||
o = scheme_make_integer(r);
|
||||
r = SCHEME_INT_VAL(o);
|
||||
|
||||
- if (a == r + b)
|
||||
+ if (a == (uintptr_t)r + (uintptr_t)b)
|
||||
return o;
|
||||
else
|
||||
return SUBTRACT_slow(a, b);
|
||||
@@ -634,12 +634,15 @@ static Scheme_Object *MULTIPLY(intptr_t a, intptr_t b)
|
||||
if (!b)
|
||||
return zeroi;
|
||||
|
||||
- r = a * b;
|
||||
+ r = (uintptr_t)a * (uintptr_t)b;
|
||||
|
||||
o = scheme_make_integer(r);
|
||||
r = SCHEME_INT_VAL(o);
|
||||
|
||||
- if (a == r / b)
|
||||
+ /* if b == -1, division could overflow; otherwise, division is defined */
|
||||
+ if ((b == -1)
|
||||
+ ? (a == (uintptr_t)r * (uintptr_t)-1)
|
||||
+ : (a == r / b))
|
||||
return o;
|
||||
else {
|
||||
Small_Bignum sa, sb;
|
@ -1,163 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_number_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/src/number.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/number.c Tue Feb 9 23:13:12 2016
|
||||
@@ -1661,7 +1661,7 @@ scheme_make_integer_value_from_long_halves(uintptr_t l
|
||||
#else
|
||||
mzlonglong v;
|
||||
|
||||
- v = (mzlonglong)lowhalf | ((mzlonglong)hihalf << 32);
|
||||
+ v = (mzlonglong)lowhalf | ((umzlonglong)hihalf << 32);
|
||||
|
||||
return scheme_make_integer_value_from_long_long(v);
|
||||
#endif
|
||||
@@ -1749,7 +1749,11 @@ double scheme_real_to_double(Scheme_Object *r)
|
||||
|
||||
XFORM_NONGCING static MZ_INLINE int minus_zero_p(double d)
|
||||
{
|
||||
+#ifdef MZ_IS_NEG_ZERO
|
||||
+ return MZ_IS_NEG_ZERO(d);
|
||||
+#else
|
||||
return (1 / d) < 0;
|
||||
+#endif
|
||||
}
|
||||
|
||||
int scheme_minus_zero_p(double d)
|
||||
@@ -3243,7 +3247,7 @@ static Scheme_Object *fixnum_expt(intptr_t x, intptr_t
|
||||
intptr_t orig_y = y;
|
||||
|
||||
if ((x == 2) && (y <= MAX_SHIFT_TRY))
|
||||
- return scheme_make_integer((intptr_t)1 << y);
|
||||
+ return scheme_make_integer((uintptr_t)1 << y);
|
||||
else {
|
||||
intptr_t result = 1;
|
||||
int neg_result = (x < 0) && (y & 0x1);
|
||||
@@ -3990,6 +3994,22 @@ scheme_exact_to_inexact (int argc, Scheme_Object *argv
|
||||
ESCAPED_BEFORE_HERE;
|
||||
}
|
||||
|
||||
+XFORM_NONGCING static int double_fits_fixnum(double d)
|
||||
+/* returns TRUE if the number definitely fits in an intptr_t
|
||||
+ and might fit in a fixnum */
|
||||
+{
|
||||
+ int exp;
|
||||
+
|
||||
+ if (MZ_IS_NAN(d)
|
||||
+ || MZ_IS_POS_INFINITY(d)
|
||||
+ || MZ_IS_NEG_INFINITY(d))
|
||||
+ return 0;
|
||||
+
|
||||
+ (void)frexp(d, &exp);
|
||||
+
|
||||
+ return (exp < (8 * sizeof(intptr_t)) - 1);
|
||||
+}
|
||||
+
|
||||
Scheme_Object *
|
||||
scheme_inexact_to_exact (int argc, Scheme_Object *argv[])
|
||||
{
|
||||
@@ -4001,9 +4021,12 @@ scheme_inexact_to_exact (int argc, Scheme_Object *argv
|
||||
t = _SCHEME_TYPE(o);
|
||||
if (t == scheme_double_type) {
|
||||
double d = SCHEME_DBL_VAL(o);
|
||||
+ Scheme_Object *i;
|
||||
|
||||
/* Try simple case: */
|
||||
- Scheme_Object *i = scheme_make_integer((intptr_t)d);
|
||||
+ i = (double_fits_fixnum(d)
|
||||
+ ? scheme_make_integer((intptr_t)d)
|
||||
+ : scheme_make_integer(0));
|
||||
if ((double)SCHEME_INT_VAL(i) == d) {
|
||||
#ifdef NAN_EQUALS_ANYTHING
|
||||
if (!MZ_IS_NAN(d))
|
||||
@@ -4016,9 +4039,12 @@ scheme_inexact_to_exact (int argc, Scheme_Object *argv
|
||||
#ifdef MZ_USE_SINGLE_FLOATS
|
||||
if (t == scheme_float_type) {
|
||||
float d = SCHEME_FLT_VAL(o);
|
||||
+ Scheme_Object *i;
|
||||
|
||||
/* Try simple case: */
|
||||
- Scheme_Object *i = scheme_make_integer((intptr_t)d);
|
||||
+ i = (double_fits_fixnum(d)
|
||||
+ ? scheme_make_integer((intptr_t)d)
|
||||
+ : scheme_make_integer(0));
|
||||
if ((double)SCHEME_INT_VAL(i) == d) {
|
||||
# ifdef NAN_EQUALS_ANYTHING
|
||||
if (!MZ_IS_NAN(d))
|
||||
@@ -4205,7 +4231,7 @@ scheme_bitwise_shift(int argc, Scheme_Object *argv[])
|
||||
} else if (shift <= MAX_SHIFT_TRY) {
|
||||
intptr_t n;
|
||||
|
||||
- n = i << shift;
|
||||
+ n = (uintptr_t)i << shift;
|
||||
if ((n > 0) && (SCHEME_INT_VAL(scheme_make_integer(n)) >> shift == i))
|
||||
return scheme_make_integer(n);
|
||||
}
|
||||
@@ -4239,7 +4265,7 @@ static Scheme_Object *bitwise_bit_set_p (int argc, Sch
|
||||
}
|
||||
if (SCHEME_INTP(so)) {
|
||||
if (v < (sizeof(intptr_t) * 8))
|
||||
- return ((((intptr_t)1 << v) & SCHEME_INT_VAL(so)) ? scheme_true : scheme_false);
|
||||
+ return ((((uintptr_t)1 << v) & SCHEME_INT_VAL(so)) ? scheme_true : scheme_false);
|
||||
else
|
||||
return ((SCHEME_INT_VAL(so) < 0) ? scheme_true : scheme_false);
|
||||
} else {
|
||||
@@ -4449,7 +4475,7 @@ integer_length(int argc, Scheme_Object *argv[])
|
||||
|
||||
/* if base is large enough that our later steps risk overflow
|
||||
then perform all the arithmetic using bignums. */
|
||||
- if (base >= (((intptr_t)1 << (MAX_SHIFT_TRY - 4))-1)) {
|
||||
+ if (base >= (((uintptr_t)1 << (MAX_SHIFT_TRY - 4))-1)) {
|
||||
/* bignum path */
|
||||
Scheme_Object *result;
|
||||
result = scheme_bin_mult(scheme_make_integer_value(base),
|
||||
@@ -5191,11 +5217,13 @@ static Scheme_Object *fl_to_fx (int argc, Scheme_Objec
|
||||
scheme_wrong_contract("fl->fx", "(and/c flonum? integer?)", 0, argc, argv);
|
||||
|
||||
d = SCHEME_DBL_VAL(argv[0]);
|
||||
- v = (intptr_t)d;
|
||||
- if ((double)v == d) {
|
||||
- o = scheme_make_integer_value(v);
|
||||
- if (SCHEME_INTP(o))
|
||||
- return o;
|
||||
+ if (double_fits_fixnum(d)) {
|
||||
+ v = (intptr_t)d;
|
||||
+ if ((double)v == d) {
|
||||
+ o = scheme_make_integer_value(v);
|
||||
+ if (SCHEME_INTP(o))
|
||||
+ return o;
|
||||
+ }
|
||||
}
|
||||
|
||||
scheme_contract_error("fl->fx", "no fixnum representation",
|
||||
@@ -5328,21 +5356,21 @@ SAFE_EXTFL(log)
|
||||
SAFE_BIN_EXTFL(expt)
|
||||
|
||||
|
||||
-#define UNSAFE_FX(name, op, fold) \
|
||||
+#define UNSAFE_FX(name, op, fold, type) \
|
||||
static Scheme_Object *name(int argc, Scheme_Object *argv[]) \
|
||||
{ \
|
||||
intptr_t v; \
|
||||
if (scheme_current_thread->constant_folding) return fold(argc, argv); \
|
||||
- v = SCHEME_INT_VAL(argv[0]) op SCHEME_INT_VAL(argv[1]); \
|
||||
+ v = (type)SCHEME_INT_VAL(argv[0]) op SCHEME_INT_VAL(argv[1]); \
|
||||
return scheme_make_integer(v); \
|
||||
}
|
||||
|
||||
-UNSAFE_FX(unsafe_fx_and, &, scheme_bitwise_and)
|
||||
-UNSAFE_FX(unsafe_fx_or, |, bitwise_or)
|
||||
-UNSAFE_FX(unsafe_fx_xor, ^, bitwise_xor)
|
||||
-UNSAFE_FX(unsafe_fx_lshift, <<, scheme_bitwise_shift)
|
||||
+UNSAFE_FX(unsafe_fx_and, &, scheme_bitwise_and, intptr_t)
|
||||
+UNSAFE_FX(unsafe_fx_or, |, bitwise_or, intptr_t)
|
||||
+UNSAFE_FX(unsafe_fx_xor, ^, bitwise_xor, intptr_t)
|
||||
+UNSAFE_FX(unsafe_fx_lshift, <<, scheme_bitwise_shift, uintptr_t)
|
||||
|
||||
-UNSAFE_FX(unsafe_fx_rshift, >>, neg_bitwise_shift)
|
||||
+UNSAFE_FX(unsafe_fx_rshift, >>, neg_bitwise_shift, intptr_t)
|
||||
|
||||
static Scheme_Object *unsafe_fx_not (int argc, Scheme_Object *argv[])
|
||||
{
|
@ -1,34 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_read_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/src/read.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/read.c Tue Feb 9 23:13:12 2016
|
||||
@@ -3305,7 +3305,7 @@ read_string(int is_byte, Scheme_Object *port,
|
||||
ch = scheme_peekc_special_ok(port);
|
||||
if (NOT_EOF_OR_SPECIAL(ch) && scheme_isxdigit(ch)) {
|
||||
initial[count] = ch;
|
||||
- n = n*16 + (ch<='9' ? ch-'0' : (scheme_toupper(ch)-'A'+10));
|
||||
+ n = ((unsigned)n<<4) + (ch<='9' ? ch-'0' : (scheme_toupper(ch)-'A'+10));
|
||||
scheme_getc(port); /* must be ch */
|
||||
count++;
|
||||
} else
|
||||
@@ -4050,7 +4050,7 @@ read_character(Scheme_Object *port,
|
||||
ch = scheme_peekc_special_ok(port);
|
||||
if (NOT_EOF_OR_SPECIAL(ch) && scheme_isxdigit(ch)) {
|
||||
nbuf[count] = ch;
|
||||
- n = n*16 + (ch<='9' ? ch-'0' : (scheme_toupper(ch)-'A'+10));
|
||||
+ n = ((unsigned)n<<4) + (ch<='9' ? ch-'0' : (scheme_toupper(ch)-'A'+10));
|
||||
scheme_getc(port); /* must be ch */
|
||||
count++;
|
||||
} else
|
||||
@@ -5617,7 +5617,7 @@ static void install_byecode_hash_code(CPort *rp, char
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 20; i++) {
|
||||
- l ^= ((mzlonglong)(hash_code[i]) << ((i % 8) * 8));
|
||||
+ l ^= ((umzlonglong)(hash_code[i]) << ((i % 8) * 8));
|
||||
}
|
||||
|
||||
/* Make sure the hash code leaves lots of room for
|
@ -1,18 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_regexp_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/src/regexp.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/regexp.c Tue Feb 9 23:13:12 2016
|
||||
@@ -5379,7 +5379,9 @@ static Scheme_Object *gen_compare(char *name, int pos,
|
||||
|
||||
dropped = scheme_make_integer(0);
|
||||
|
||||
- m = regexec(name, r, full_s, offset, endset - offset, offset, lazy_string,
|
||||
+ m = regexec(name, r, full_s,
|
||||
+ offset, (endset < 0 ? endset : endset - offset),
|
||||
+ offset, lazy_string,
|
||||
startp, maybep, endp, match_stack,
|
||||
iport, unless_evt, nonblock,
|
||||
&full_s, peek, pos, last_bytes_count, oport,
|
@ -1,16 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_resolve_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/src/resolve.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/resolve.c Tue Feb 9 23:13:12 2016
|
||||
@@ -2858,7 +2858,7 @@ static void set_tl_pos_used(Resolve_Info *info, int po
|
||||
if ((uintptr_t)info->tl_map & 0x1)
|
||||
info->tl_map = (void *)((uintptr_t)tl_map | ((uintptr_t)1 << (tl_pos + 1)));
|
||||
else
|
||||
- ((int *)tl_map)[1 + (tl_pos / 32)] |= (1 << (tl_pos & 31));
|
||||
+ ((int *)tl_map)[1 + (tl_pos / 32)] |= ((unsigned)1 << (tl_pos & 31));
|
||||
}
|
||||
|
||||
static void *merge_tl_map(void *tl_map, void *new_tl_map)
|
@ -1,26 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_schpriv_h,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
"clean up GC implementation"
|
||||
https://github.com/racket/racket/commit/2ee721f
|
||||
|
||||
--- src/racket/src/schpriv.h.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/schpriv.h Wed Feb 10 00:04:46 2016
|
||||
@@ -345,7 +345,6 @@ void scheme_init_dynamic_extension(Scheme_Env *env);
|
||||
#ifndef NO_REGEXP_UTILS
|
||||
extern void scheme_regexp_initialize(Scheme_Env *env);
|
||||
#endif
|
||||
-void scheme_init_memtrace(Scheme_Env *env);
|
||||
void scheme_init_paramz(Scheme_Env *env);
|
||||
void scheme_init_parameterization();
|
||||
void scheme_init_getenv(void);
|
||||
@@ -2317,6 +2316,7 @@ extern int scheme_is_nan(double);
|
||||
# define MZ_IS_POS_INFINITY(d) (isinf(d) && (d > 0))
|
||||
# define MZ_IS_NEG_INFINITY(d) (isinf(d) && (d < 0))
|
||||
# define MZ_IS_NAN(d) isnan(d)
|
||||
+# define MZ_IS_NEG_ZERO(d) signbit(d)
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
@ -1,53 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_string_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/src/string.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/string.c Tue Feb 9 23:13:12 2016
|
||||
@@ -179,6 +179,9 @@ static void reset_locale(void);
|
||||
|
||||
#define current_locale_name ((const mzchar *)current_locale_name_ptr)
|
||||
|
||||
+static const mzchar empty_char_string[1] = { 0 };
|
||||
+static const mzchar xes_char_string[2] = { 0x78787878, 0 };
|
||||
+
|
||||
#ifdef USE_ICONV_DLL
|
||||
static char *nl_langinfo(int which)
|
||||
{
|
||||
@@ -186,7 +189,7 @@ static char *nl_langinfo(int which)
|
||||
|
||||
reset_locale();
|
||||
if (!current_locale_name)
|
||||
- current_locale_name_ptr = "\0\0\0\0";
|
||||
+ current_locale_name_ptr = empty_char_string;
|
||||
|
||||
if ((current_locale_name[0] == 'C')
|
||||
&& !current_locale_name[1])
|
||||
@@ -986,7 +989,7 @@ scheme_init_string (Scheme_Env *env)
|
||||
|
||||
void scheme_init_string_places(void) {
|
||||
REGISTER_SO(current_locale_name_ptr);
|
||||
- current_locale_name_ptr = "xxxx\0\0\0\0";
|
||||
+ current_locale_name_ptr = (void *)xes_char_string;
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
@@ -1008,7 +1011,7 @@ Scheme_Object *scheme_make_sized_offset_utf8_string(ch
|
||||
NULL, 0 /* not UTF-16 */, 0xFFFD);
|
||||
us[ulen] = 0;
|
||||
} else {
|
||||
- us = (mzchar *)"\0\0\0";
|
||||
+ us = (mzchar *)empty_char_string;
|
||||
ulen = 0;
|
||||
}
|
||||
return scheme_make_sized_offset_char_string(us, 0, ulen, 0);
|
||||
@@ -4624,6 +4627,8 @@ static Scheme_Object *string_normalize_kd (int argc, S
|
||||
intptr_t scheme_char_strlen(const mzchar *s)
|
||||
{
|
||||
intptr_t i;
|
||||
+ if ((intptr_t)s & 0x3)
|
||||
+ abort();
|
||||
for (i = 0; s[i]; i++) {
|
||||
}
|
||||
return i;
|
@ -1,16 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_symbol_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid compiler warning"
|
||||
https://github.com/racket/racket/commit/6cd225e073c77092060481749310c782949795e2
|
||||
|
||||
--- src/racket/src/symbol.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/symbol.c Sun Feb 28 00:38:21 2016
|
||||
@@ -698,7 +698,7 @@ const char *scheme_symbol_name_and_size(Scheme_Object
|
||||
mzchar cbuf[100], *cs, *cresult;
|
||||
intptr_t clen;
|
||||
int p = 0;
|
||||
- uintptr_t i = 0;
|
||||
+ intptr_t i = 0;
|
||||
intptr_t rlen;
|
||||
|
||||
dz = 0;
|
@ -1,71 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_thread_c,v 1.3 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"clean up GC implementation"
|
||||
https://github.com/racket/racket/commit/2ee721f
|
||||
|
||||
--- src/racket/src/thread.c.orig Mon Jan 11 18:07:43 2016
|
||||
+++ src/racket/src/thread.c Tue Feb 9 23:51:58 2016
|
||||
@@ -334,8 +334,6 @@ static void register_traversers(void);
|
||||
static Scheme_Object *custodian_require_mem(int argc, Scheme_Object *args[]);
|
||||
static Scheme_Object *custodian_limit_mem(int argc, Scheme_Object *args[]);
|
||||
static Scheme_Object *custodian_can_mem(int argc, Scheme_Object *args[]);
|
||||
-static Scheme_Object *new_tracking_fun(int argc, Scheme_Object *args[]);
|
||||
-static Scheme_Object *union_tracking_val(int argc, Scheme_Object *args[]);
|
||||
|
||||
static Scheme_Object *collect_garbage(int argc, Scheme_Object *args[]);
|
||||
static Scheme_Object *current_memory_use(int argc, Scheme_Object *args[]);
|
||||
@@ -639,25 +637,6 @@ void scheme_init_thread_places(void) {
|
||||
gc_info_prefab = scheme_lookup_prefab_type(scheme_intern_symbol("gc-info"), 10);
|
||||
}
|
||||
|
||||
-void scheme_init_memtrace(Scheme_Env *env)
|
||||
-{
|
||||
- Scheme_Object *v;
|
||||
- Scheme_Env *newenv;
|
||||
-
|
||||
- v = scheme_intern_symbol("#%memtrace");
|
||||
- newenv = scheme_primitive_module(v, env);
|
||||
-
|
||||
- v = scheme_make_symbol("memory-trace-continuation-mark");
|
||||
- scheme_add_global("memory-trace-continuation-mark", v , newenv);
|
||||
- v = scheme_make_prim_w_arity(new_tracking_fun,
|
||||
- "new-memtrace-tracking-function", 1, 1);
|
||||
- scheme_add_global("new-memtrace-tracking-function", v, newenv);
|
||||
- v = scheme_make_prim_w_arity(union_tracking_val,
|
||||
- "unioned-memtrace-tracking-value", 1, 1);
|
||||
- scheme_add_global("unioned-memtrace-tracking-value", v, newenv);
|
||||
- scheme_finish_primitive_module(newenv);
|
||||
-}
|
||||
-
|
||||
void scheme_init_inspector() {
|
||||
REGISTER_SO(initial_inspector);
|
||||
initial_inspector = scheme_make_initial_inspectors();
|
||||
@@ -914,28 +893,6 @@ static Scheme_Object *custodian_can_mem(int argc, Sche
|
||||
#else
|
||||
return scheme_false;
|
||||
#endif
|
||||
-}
|
||||
-
|
||||
-static Scheme_Object *new_tracking_fun(int argc, Scheme_Object *args[])
|
||||
-{
|
||||
- int retval = 0;
|
||||
-
|
||||
-#ifdef MZ_PRECISE_GC
|
||||
- retval = GC_mtrace_new_id(args[0]);
|
||||
-#endif
|
||||
-
|
||||
- return scheme_make_integer(retval);
|
||||
-}
|
||||
-
|
||||
-static Scheme_Object *union_tracking_val(int argc, Scheme_Object *args[])
|
||||
-{
|
||||
- int retval = 0;
|
||||
-
|
||||
-#ifdef MZ_PRECISE_GC
|
||||
- retval = GC_mtrace_union_current_with(SCHEME_INT_VAL(args[0]));
|
||||
-#endif
|
||||
-
|
||||
- return scheme_make_integer(retval);
|
||||
}
|
||||
|
||||
static void ensure_custodian_space(Scheme_Custodian *m, int k)
|
@ -1,37 +0,0 @@
|
||||
$OpenBSD: patch-src_racket_src_validate_c,v 1.1 2016/03/10 02:35:29 juanfra Exp $
|
||||
|
||||
"avoid some C undefined behavior"
|
||||
https://github.com/racket/racket/commit/9a8fd29
|
||||
|
||||
--- src/racket/src/validate.c.orig Thu Jan 14 18:11:20 2016
|
||||
+++ src/racket/src/validate.c Tue Feb 9 23:13:12 2016
|
||||
@@ -1359,12 +1359,12 @@ static int validate_expr(Mz_CPort *port, Scheme_Object
|
||||
if ((uintptr_t)tl_use_map & 0x1) {
|
||||
if (p2 > 31)
|
||||
scheme_ill_formed_code(port);
|
||||
- if (!((uintptr_t)tl_use_map & (1 << (p2 + 1))))
|
||||
+ if (!((uintptr_t)tl_use_map & ((unsigned int)1 << (p2 + 1))))
|
||||
scheme_ill_formed_code(port);
|
||||
} else {
|
||||
if (p2 >= (*(int *)tl_use_map * 32))
|
||||
scheme_ill_formed_code(port);
|
||||
- if (!(((int *)tl_use_map)[1 + (p2 / 32)] & (1 << (p2 & 31))))
|
||||
+ if (!(((int *)tl_use_map)[1 + (p2 / 32)] & ((unsigned int)1 << (p2 & 31))))
|
||||
scheme_ill_formed_code(port);
|
||||
}
|
||||
}
|
||||
@@ -1757,12 +1757,12 @@ static int validate_expr(Mz_CPort *port, Scheme_Object
|
||||
if ((uintptr_t)tl_use_map & 0x1) {
|
||||
if (p > 31)
|
||||
scheme_ill_formed_code(port);
|
||||
- if (!((uintptr_t)tl_use_map & (1 << (p + 1))))
|
||||
+ if (!((uintptr_t)tl_use_map & ((unsigned int)1 << (p + 1))))
|
||||
scheme_ill_formed_code(port);
|
||||
} else {
|
||||
if (p >= (*(int *)tl_use_map * 32))
|
||||
scheme_ill_formed_code(port);
|
||||
- if (!(((int *)tl_use_map)[1 + (p / 32)] & (1 << (p & 31))))
|
||||
+ if (!(((int *)tl_use_map)[1 + (p / 32)] & ((unsigned int)1 << (p & 31))))
|
||||
scheme_ill_formed_code(port);
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
@comment $OpenBSD: PLIST,v 1.5 2016/03/10 02:35:29 juanfra Exp $
|
||||
@comment $OpenBSD: PLIST,v 1.6 2016/05/16 22:20:16 juanfra Exp $
|
||||
@conflict racket-<6.2
|
||||
@pkgpath lang/racket
|
||||
@bin bin/racket
|
||||
@ -793,36 +793,42 @@ share/racket/collects/racket/contract/compiled/region_rkt.dep
|
||||
share/racket/collects/racket/contract/compiled/region_rkt.zo
|
||||
share/racket/collects/racket/contract/parametric.rkt
|
||||
share/racket/collects/racket/contract/private/
|
||||
share/racket/collects/racket/contract/private/and.rkt
|
||||
share/racket/collects/racket/contract/private/application-arity-checking.rkt
|
||||
share/racket/collects/racket/contract/private/arity-checking.rkt
|
||||
share/racket/collects/racket/contract/private/arr-d.rkt
|
||||
share/racket/collects/racket/contract/private/arr-i-parse.rkt
|
||||
share/racket/collects/racket/contract/private/arr-i.rkt
|
||||
share/racket/collects/racket/contract/private/arr-util.rkt
|
||||
share/racket/collects/racket/contract/private/arrow-common.rkt
|
||||
share/racket/collects/racket/contract/private/arrow-higher-order.rkt
|
||||
share/racket/collects/racket/contract/private/arrow-val-first.rkt
|
||||
share/racket/collects/racket/contract/private/arrow.rkt
|
||||
share/racket/collects/racket/contract/private/base.rkt
|
||||
share/racket/collects/racket/contract/private/basic-opters.rkt
|
||||
share/racket/collects/racket/contract/private/blame.rkt
|
||||
share/racket/collects/racket/contract/private/box.rkt
|
||||
share/racket/collects/racket/contract/private/case-arrow.rkt
|
||||
share/racket/collects/racket/contract/private/compiled/
|
||||
share/racket/collects/racket/contract/private/compiled/and_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/and_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/application-arity-checking_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/application-arity-checking_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/arity-checking_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/arity-checking_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/arr-d_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/arr-d_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/arr-i-parse_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/arr-i-parse_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/arr-i_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/arr-i_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/arr-util_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/arr-util_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/arrow-common_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/arrow-common_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/arrow-higher-order_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/arrow-higher-order_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/arrow-val-first_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/arrow-val-first_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/arrow_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/arrow_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/base_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/base_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/basic-opters_rkt.dep
|
||||
@ -837,8 +843,6 @@ share/racket/collects/racket/contract/private/compiled/ds-helpers_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/ds-helpers_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/ds_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/ds_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/env_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/env_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/exists_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/exists_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/generate-base_rkt.dep
|
||||
@ -855,6 +859,8 @@ share/racket/collects/racket/contract/private/compiled/kwd-info-struct_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/kwd-info-struct_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/legacy_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/legacy_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/list_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/list_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/misc_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/misc_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/object_rkt.dep
|
||||
@ -885,11 +891,12 @@ share/racket/collects/racket/contract/private/compiled/top-sort_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/top-sort_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/types_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/types_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/unconstrained-domain-arrow_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/unconstrained-domain-arrow_rkt.zo
|
||||
share/racket/collects/racket/contract/private/compiled/vector_rkt.dep
|
||||
share/racket/collects/racket/contract/private/compiled/vector_rkt.zo
|
||||
share/racket/collects/racket/contract/private/ds-helpers.rkt
|
||||
share/racket/collects/racket/contract/private/ds.rkt
|
||||
share/racket/collects/racket/contract/private/env.rkt
|
||||
share/racket/collects/racket/contract/private/exists.rkt
|
||||
share/racket/collects/racket/contract/private/generate-base.rkt
|
||||
share/racket/collects/racket/contract/private/generate.rkt
|
||||
@ -898,6 +905,7 @@ share/racket/collects/racket/contract/private/hash.rkt
|
||||
share/racket/collects/racket/contract/private/helpers.rkt
|
||||
share/racket/collects/racket/contract/private/kwd-info-struct.rkt
|
||||
share/racket/collects/racket/contract/private/legacy.rkt
|
||||
share/racket/collects/racket/contract/private/list.rkt
|
||||
share/racket/collects/racket/contract/private/misc.rkt
|
||||
share/racket/collects/racket/contract/private/object.rkt
|
||||
share/racket/collects/racket/contract/private/opt-guts.rkt
|
||||
@ -913,6 +921,7 @@ share/racket/collects/racket/contract/private/struct-dc.rkt
|
||||
share/racket/collects/racket/contract/private/struct-prop.rkt
|
||||
share/racket/collects/racket/contract/private/top-sort.rkt
|
||||
share/racket/collects/racket/contract/private/types.rkt
|
||||
share/racket/collects/racket/contract/private/unconstrained-domain-arrow.rkt
|
||||
share/racket/collects/racket/contract/private/vector.rkt
|
||||
share/racket/collects/racket/contract/region.rkt
|
||||
share/racket/collects/racket/control.rkt
|
||||
@ -1809,8 +1818,6 @@ share/racket/collects/syntax/unsafe/compiled/for-transform_rkt.dep
|
||||
share/racket/collects/syntax/unsafe/compiled/for-transform_rkt.zo
|
||||
share/racket/collects/syntax/unsafe/for-transform.rkt
|
||||
share/racket/collects/syntax/wrap-modbeg.rkt
|
||||
share/racket/collects/unstable/
|
||||
share/racket/collects/unstable/compiled/
|
||||
share/racket/collects/version/
|
||||
share/racket/collects/version/check.rkt
|
||||
share/racket/collects/version/compiled/
|
||||
|
@ -1,4 +1,4 @@
|
||||
$OpenBSD: README,v 1.7 2016/04/05 23:14:01 juanfra Exp $
|
||||
$OpenBSD: README,v 1.8 2016/05/16 22:20:16 juanfra Exp $
|
||||
|
||||
+-----------------------------------------------------------------------
|
||||
| Running ${FULLPKGNAME} on OpenBSD
|
||||
@ -8,36 +8,14 @@ Limitations
|
||||
===========
|
||||
|
||||
- Racket's JIT only supports CPUs with SSE2 extensions or PowerPC CPUs. There
|
||||
is a "no_jit" flavor for i386 and amd64. The JIT on PowerPC is disabled by
|
||||
default due to a bug which breaks the build.
|
||||
is a "no_jit" flavor for amd64, i386 and powerpc.
|
||||
- DrRacket doesn't work correctly with the "no_jit" flavor.
|
||||
- Racket is slightly broken here and there on powerpc.
|
||||
- FFI is broken on sparc64.
|
||||
- Never run "raco pkg" commands as root, even when the commands are suggested
|
||||
by upstream. You're going to break the racket package.
|
||||
|
||||
Bugs
|
||||
====
|
||||
|
||||
"path: /usr/local/share/racket/collects/racket/compiled/drracket/ system error"
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
If you see this error in DrRacket:
|
||||
|
||||
make-directory: cannot make directory
|
||||
path: /usr/local/share/racket/collects/racket/compiled/drracket/
|
||||
system error: Permission denied; errno=13
|
||||
|
||||
Follow these steps to workaround the bug:
|
||||
- Open DrRacket
|
||||
- Click on "Determinate language from source" (the menu at the bottom of the
|
||||
window)
|
||||
- In the window "Choose Language", click on "Show details" and uncheck the
|
||||
option "Populate compiled directories"
|
||||
- Click on "OK"
|
||||
- Close DrRacket
|
||||
|
||||
The bug will be fixed in Racket 6.5.
|
||||
- Racket "places" and "futures" (using threads instead of processes) is
|
||||
only supported on amd64.
|
||||
|
||||
FAQ
|
||||
===
|
||||
|
Loading…
Reference in New Issue
Block a user