[m-rev.] for review: Fixes for FreeBSD.

Peter Wang novalazy at gmail.com
Mon May 18 15:24:22 AEST 2015


configure.ac:
	Set flags for thread support on FreeBSD.

compiler/make.util.m:
	Use System V semaphores for `mmc --make' job control.

diff --git a/compiler/make.util.m b/compiler/make.util.m
index db6316f..c552c60 100644
--- a/compiler/make.util.m
+++ b/compiler/make.util.m
@@ -574,8 +574,10 @@ typedef struct MC_JobCtl MC_JobCtl;
   ** Darwin 5.x doesn't implement unnamed POSIX semaphores nor process-shared
   ** POSIX mutexes; the functions fail when you try to create them.
   ** System V semaphores do work however.
+  ** Similarly for FreeBSD.
   */
-  #if !defined(__APPLE__) && defined(MR_HAVE_PTHREAD_H) && \
+  #if !defined(__APPLE__) && !defined(__FreeBSD__) && \
+        defined(MR_HAVE_PTHREAD_H) && \
         defined(MR_HAVE_PTHREAD_MUTEXATTR_SETPSHARED)
     #include <pthread.h>
 
diff --git a/configure.ac b/configure.ac
index 78159b6..76408fd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3210,6 +3210,14 @@ case "$host" in
         ENABLE_BOEHM_PARALLEL_MARK="-DPARALLEL_MARK"
         ;;
 
+    *freebsd*)
+        CFLAGS_FOR_THREADS="-DGC_FREEBSD_THREADS"
+        THREAD_LIBS="-lpthread"
+        ENABLE_BOEHM_THREAD_LOCAL_ALLOC="-DTHREAD_LOCAL_ALLOC"
+        ENABLE_BOEHM_PARALLEL_MARK="-DPARALLEL_MARK"
+        avoid_sbrk=yes
+        ;;
+
 ### # The threads stuff on Digital Unix (OSF) is not yet enabled because
 ### # the Boehm garbage collector doesn't support threads on that platform
 ### # XXX probably we should enable it but report an error if you try to



More information about the reviews mailing list