pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

cyclone: update to cyclone-0.14



Module Name:	pkgsrc-wip
Committed By:	Yorick Hardy <yorickhardy%gmail.com@localhost>
Pushed By:	yhardy
Date:		Wed Feb 12 00:03:28 2020 +0200
Changeset:	1c36c04cc70f9e0fb7e6fd9d24f4ed939a548e6a

Modified Files:
	cyclone/Makefile
	cyclone/PLIST
	cyclone/distinfo
	cyclone/patches/patch-Makefile.config
Added Files:
	cyclone/patches/patch-Makefile

Log Message:
cyclone: update to cyclone-0.14

pkgsrc changes: use pkgsrc libtommath instead of the internal copy.

cyclone-0.13 was not released.

= Changelog

== 0.14 - February 11, 2020

Cyclone now automatically relocates any stack objects when performing a mutation. This prevents a whole range of race conditions that had previously been possible in multithreaded application code. And since this work is done by the Cyclone runtime no special code needs to be added to your applications.

Special thanks to Daniel Mendler, whose discussions were the inspiration for these changes.

Some background:

There was a long-standing issue where a mutation (via `set-car!`, `vector-set!`, `set!`, etc) could allow a global object on the heap to reference objects on a thread's local stack. This is problematic because threads periodically relocate objects from their stack, and for performance reasons these objects are moved without any coordination between threads. Thus it is critical that objects on the stack are only used by the thread that owns them.

In the past we provided functions such as `make-shared` that could be called from application code to guarantee safety. However, this approach is error-prone and asks too much of anyone using Cyclone for multithreaded development. The proper solution is for Cyclone to avoid this situation in the first place.

Other Features

 - Added `CYC_HIGH_RES_TIMERS` to the runtime code to allow logging of timer information for the GC. Note this can be passed to the C compiler via the `-D` option.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=1c36c04cc70f9e0fb7e6fd9d24f4ed939a548e6a

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 cyclone/Makefile                      |  3 ++-
 cyclone/PLIST                         |  1 -
 cyclone/distinfo                      | 11 +++++----
 cyclone/patches/patch-Makefile        | 46 +++++++++++++++++++++++++++++++++++
 cyclone/patches/patch-Makefile.config | 14 +++++++----
 5 files changed, 63 insertions(+), 12 deletions(-)

diffs:
diff --git a/cyclone/Makefile b/cyclone/Makefile
index 2ab3a315d3..fd40507e01 100644
--- a/cyclone/Makefile
+++ b/cyclone/Makefile
@@ -1,7 +1,7 @@
 # $NetBSD$
 
 GITHUB_PROJECT=	cyclone-bootstrap
-GITHUB_TAG=	v0.12
+GITHUB_TAG=	v0.14
 DISTNAME=	${GITHUB_TAG}
 PKGNAME=	cyclone-${DISTNAME:S,^v,,}
 CATEGORIES=	lang
@@ -19,4 +19,5 @@ USE_TOOLS+=	gmake pkg-config
 PKGCONFIG_OVERRIDE+=	third-party/libtommath-1.2.0/libtommath.pc.in
 
 .include "../../devel/concurrencykit/buildlink3.mk"
+.include "../../math/ltm/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/cyclone/PLIST b/cyclone/PLIST
index 09aee31100..578a04329b 100644
--- a/cyclone/PLIST
+++ b/cyclone/PLIST
@@ -8,7 +8,6 @@ include/cyclone/runtime-main.h
 include/cyclone/runtime.h
 include/cyclone/types.h
 lib/libcyclone.a
-lib/libcyclonebn.a
 share/cyclone/cyclone/concurrent.o
 share/cyclone/cyclone/concurrent.sld
 share/cyclone/cyclone/concurrent.so
diff --git a/cyclone/distinfo b/cyclone/distinfo
index 5445a23486..c741934799 100644
--- a/cyclone/distinfo
+++ b/cyclone/distinfo
@@ -1,7 +1,8 @@
 $NetBSD$
 
-SHA1 (cyclone-bootstrap/v0.12.tar.gz) = b8be08b93fd2fe371e4244e06a3a6ddaef41c655
-RMD160 (cyclone-bootstrap/v0.12.tar.gz) = a90dd6a60015a44af8969427bc90754b3f0eef5e
-SHA512 (cyclone-bootstrap/v0.12.tar.gz) = 774994b134c8cc205a9c14195b2133cb69d2d47751312d3edcaa7c7d6d71207efb38b74aed69215ce3568a3738cdb93148f6d87194e69fbe7529734a206f5c6f
-Size (cyclone-bootstrap/v0.12.tar.gz) = 2946589 bytes
-SHA1 (patch-Makefile.config) = f78164a871b0f3cf158dd97eb535906f1ec06598
+SHA1 (cyclone-bootstrap/v0.14.tar.gz) = 83c87f68a5df69fc501c6020148e00b7856c6780
+RMD160 (cyclone-bootstrap/v0.14.tar.gz) = 7cbc253a8aa9d827817f4332bfc448bfc0090a83
+SHA512 (cyclone-bootstrap/v0.14.tar.gz) = 4a57910bf7eb09d183da68d283d7d42b649aa06dd39a80a9043a36c0b041d5e323f641b16d8eb4089faf983b30ec91047718eb7516eeaf2475926891d164f670
+Size (cyclone-bootstrap/v0.14.tar.gz) = 3110851 bytes
+SHA1 (patch-Makefile) = 161e365902752ed81c987e862f79a20915828965
+SHA1 (patch-Makefile.config) = b5f857305be64f8c05c04449bf5125746e44eb51
diff --git a/cyclone/patches/patch-Makefile b/cyclone/patches/patch-Makefile
new file mode 100644
index 0000000000..74bf432e6e
--- /dev/null
+++ b/cyclone/patches/patch-Makefile
@@ -0,0 +1,46 @@
+$NetBSD$
+
+Use pkgsrc libtommath (internally named libcyclonebn).
+
+--- Makefile.orig	2020-02-10 21:34:59.000000000 +0000
++++ Makefile
+@@ -8,8 +8,8 @@ include Makefile.config
+ 
+ # Libraries
+ CYC_RT_LIB = libcyclone.a
+-CYC_BN_LIB = libcyclonebn.a
+-CYC_BN_LIB_SUBDIR = third-party/libtommath-1.2.0
++#CYC_BN_LIB = libcyclonebn.a
++#CYC_BN_LIB_SUBDIR = third-party/libtommath-1.2.0
+ CYC_LIBS = $(CYC_RT_LIB) $(CYC_BN_LIB)
+ 
+ COBJ = scheme/base \
+@@ -95,8 +95,8 @@ $(CYC_RT_LIB): runtime.c include/cyclone
+ 	  $(CREATE_LIBRARY_COMMAND) $(CREATE_LIBRARY_FLAGS) $(LIBRARY_OUTPUT_FILE) runtime.o gc.o dispatch.o mstreams.o hashset.o
+ 	  $(RANLIB_COMMAND)
+ 
+-$(CYC_BN_LIB) : $(CYC_BN_LIB_SUBDIR)/*.c
+-	cd $(CYC_BN_LIB_SUBDIR) ; $(MAKE) LIBNAME=$(CYC_BN_LIB) && cp $(CYC_BN_LIB) ../..
++#$(CYC_BN_LIB) : $(CYC_BN_LIB_SUBDIR)/*.c
++#	cd $(CYC_BN_LIB_SUBDIR) ; $(MAKE) LIBNAME=$(CYC_BN_LIB) && cp $(CYC_BN_LIB) ../..
+ 
+ cyclone: $(CFILES) $(COBJECTS) $(C_SHARED_OBJECTS) $(CYC_LIBS)
+ 	$(CC) cyclone.c $(CFLAGS) -c -o cyclone.o
+@@ -145,7 +145,7 @@ install:
+ #install-libs:
+ 	$(MKDIR) $(DESTDIR)$(LIBDIR)
+ 	$(INSTALL) -m0644 $(CYC_RT_LIB) $(DESTDIR)$(LIBDIR)/
+-	$(INSTALL) -m0644 $(CYC_BN_LIB) $(DESTDIR)$(LIBDIR)/
++#	$(INSTALL) -m0644 $(CYC_BN_LIB) $(DESTDIR)$(LIBDIR)/
+ #install-cyclone:
+ 	$(MKDIR) $(DESTDIR)$(BINDIR)
+ 	$(MKDIR) $(DESTDIR)$(DATADIR)/scheme/cyclone
+@@ -169,7 +169,7 @@ install:
+ 	$(INSTALL) -m0755 cyclone $(DESTDIR)$(BINDIR)/
+ 	$(INSTALL) -m0755 icyc $(DESTDIR)$(BINDIR)/
+ 	$(INSTALL) -m0644 $(CYC_RT_LIB) $(DESTDIR)$(LIBDIR)/
+-	$(INSTALL) -m0644 $(CYC_BN_LIB) $(DESTDIR)$(LIBDIR)/
++#	$(INSTALL) -m0644 $(CYC_BN_LIB) $(DESTDIR)$(LIBDIR)/
+ 	$(INSTALL) -m0644 include/cyclone/*.h $(DESTDIR)$(INCDIR)/
+ 	$(INSTALL) -m0644 scheme/*.sld $(DESTDIR)$(DATADIR)/scheme
+ 	$(INSTALL) -m0644 scheme/*.o $(DESTDIR)$(DATADIR)/scheme
diff --git a/cyclone/patches/patch-Makefile.config b/cyclone/patches/patch-Makefile.config
index 03e805edbb..9502297767 100644
--- a/cyclone/patches/patch-Makefile.config
+++ b/cyclone/patches/patch-Makefile.config
@@ -5,13 +5,17 @@ $NetBSD$
 
 2) Set the RPATH when creating executables and shared libraries.
 
---- Makefile.config.orig	2019-12-30 23:58:30.000000000 +0000
+3) Use pkgsrc libtommath instead of cyclone libtommath (cyclonebn).
+
+--- Makefile.config.orig	2020-02-10 21:34:59.000000000 +0000
 +++ Makefile.config
-@@ -16,13 +16,15 @@ OS = $(shell uname)
+@@ -16,14 +16,16 @@ CYC_GCC_OPT_FLAGS ?= -O2
+ OS = $(shell uname)
  CC ?= cc
  
- LIBS = -pthread -lcyclone -lck -lm -lcyclonebn
+-LIBS = -pthread -lcyclone -lck -lm -lcyclonebn
 -ifneq ($(OS),FreeBSD)
++LIBS = -pthread -lcyclone -lck -lm -ltommath
 +ifeq (,$(findstring $(OS),FreeBSD NetBSD OpenBSD DragonFly))
  # libdl is part of libc on FreeBSD
  LIBS += -ldl
@@ -24,7 +28,7 @@ $NetBSD$
  BASE_CFLAGS  ?= $(CYC_PROFILING) $(CYC_GCC_OPT_FLAGS) -fPIC -Wall -Wno-shift-negative-value -Wno-unused-command-line-argument -I$(PREFIX)/include
  # Used by Cyclone to compile programs, no need for PIC there
  BASE_PROG_CFLAGS  ?= $(CYC_PROFILING) $(CYC_GCC_OPT_FLAGS) -Wall -I$(PREFIX)/include
-@@ -39,7 +41,8 @@ endif
+@@ -40,7 +42,8 @@ endif
  #CFLAGS = -g -pg -Wall
  
  # Linker options
@@ -34,7 +38,7 @@ $NetBSD$
  LIBRARY_OUTPUT_FILE = libcyclone.a
  ifeq ($(OS),Darwin)
  LDFLAGS     += -Wl,-undefined -Wl,dynamic_lookup
-@@ -63,9 +66,9 @@ endif
+@@ -64,9 +67,9 @@ endif
  
  # Commands "baked into" cyclone for invoking the C compiler
  CC_PROG ?= "$(CC) ~src-file~ $(COMP_PROG_CFLAGS) -c -o ~exec-file~.o"


Home | Main Index | Thread Index | Old Index