diff --git a/Makefile b/Makefile index ba27b43c..a185eeef 100644 --- a/Makefile +++ b/Makefile @@ -180,6 +180,12 @@ hashset.o : hashset.c $(HEADERS) dispatch.o : dispatch.c $(HEADERS) $(CCOMP) -c $< -o $@ +dispatch-hack.o : dispatch-hack.c $(HEADERS) + $(CCOMP) -c $< -o $@ + +apply-hack.x86-64.o: apply-hack.x86-64.S + $(CCOMP) -c $< -o $@ + gc.o : gc.c $(HEADERS) $(CCOMP) -std=gnu99 -c $< -o $@ @@ -203,7 +209,7 @@ runtime.o : runtime.c $(HEADERS) -DCYC_PLATFORM=\"$(PLATFORM)\" \ $< -o $@ -libcyclone.a : runtime.o gc.o dispatch.o mstreams.o hashset.o +libcyclone.a : runtime.o gc.o dispatch-hack.o apply-hack.x86-64.o mstreams.o hashset.o $(CREATE_LIBRARY_COMMAND) $(CREATE_LIBRARY_FLAGS) $@ $& $(RANLIB_COMMAND) # Instructions from: http://www.adp-gmbh.ch/cpp/gcc/create_lib.html diff --git a/dispatch-hack.c b/dispatch-hack.c index d87f9099..a7782a47 100644 --- a/dispatch-hack.c +++ b/dispatch-hack.c @@ -58,8 +58,10 @@ extern void _C_do_apply_hack(void *proc, object args, int count); void do_dispatch(void *data, int argc, function_type func, object clo, object *b) { - int *buf[argc + 3]; + int *buf; void *proc; + buf = alloca((argc + 6) * sizeof(object)); + buf = (void *)((((unsigned int)buf) + 15) & ~15); // JAE - ???? buf[0] = data; buf[1] = argc + 3; buf[2] = clo;