Minor changes to build C++ threads in gcc (XCC)
authorDan Cross <crossd@gmail.com>
Tue, 22 Mar 2016 16:32:47 +0000 (12:32 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 22 Mar 2016 20:09:19 +0000 (16:09 -0400)
Added a constant and modified our Makefile to enable
C++ thread support when building GCC. Rebuild your
toolchain.

Signed-off-by: Dan Cross <crossd@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
tools/compilers/gcc-glibc/Makefile
user/pthread/pthread.h

index 41f4f8b..7f7857a 100644 (file)
@@ -643,7 +643,7 @@ native-gcc-stage3-configure: native-gcc-stage3-prep
                --with-isl=no \
                --with-cloog=no \
                --with-libelf=no \
-               --enable-threads=no \
+               --enable-threads=posix \
                --enable-tls \
                --disable-nls \
                --disable-multilib \
@@ -675,7 +675,7 @@ cross-gcc-stage3-configure:
                --with-isl=no \
                --with-cloog=no \
                --with-libelf=no \
-               --enable-threads=no \
+               --enable-threads=posix \
                --disable-nls \
                --disable-multilib \
                --with-local-prefix=$(SYSROOT) \
index 73ca3d4..a98df07 100644 (file)
@@ -71,6 +71,7 @@ struct sysc_mgmt {
 #define PTHREAD_MUTEX_INITIALIZER {0,0}
 #define PTHREAD_RWLOCK_INITIALIZER PTHREAD_MUTEX_INITIALIZER
 #define PTHREAD_MUTEX_NORMAL 0
+#define PTHREAD_MUTEX_RECURSIVE 1
 #define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL
 #define PTHREAD_MUTEX_SPINS 100 // totally arbitrary
 #define PTHREAD_BARRIER_SPINS 100 // totally arbitrary