aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorLIU Hao <lh_mouse@126.com>2022-04-16 00:46:23 +0800
committerJonathan Yong <10walls@gmail.com>2022-10-19 13:52:37 +0000
commitf036d759ecee538555fa8c6b11963e4033732463 (patch)
treeb1f521e7f71c849d3b8f64e2d65d8df081b977ce /libgcc
parentf3b957ea8b9dadfb1ed30f24f463529684b7a36a (diff)
downloadgcc-f036d759ecee538555fa8c6b11963e4033732463.zip
gcc-f036d759ecee538555fa8c6b11963e4033732463.tar.gz
gcc-f036d759ecee538555fa8c6b11963e4033732463.tar.bz2
gcc: Add 'mcf' thread model support from mcfgthread
This patch adds the new thread model `mcf`, which implements mutexes and condition variables with the mcfgthread library. Source code for mcfgthread is available at <https://github.com/lhmouse/mcfgthread>. config/ChangeLog: * gthr.m4 (GCC_AC_THREAD_HEADER): Add new case for `mcf` thread model gcc/ChangeLog: * config/i386/mingw-mcfgthread.h: New file * config/i386/mingw32.h: Add builtin macro and default libraries for mcfgthread when thread model is `mcf` * config.gcc: Include 'i386/mingw-mcfgthread.h' when thread model is `mcf` * configure.ac: Recognize `mcf` as a valid thread model * config.in: Regenerate * configure: Regenerate libatomic/ChangeLog: * configure.tgt: Add new case for `mcf` thread model libgcc/ChangeLog: * config.host: Add new cases for `mcf` thread model * config/i386/gthr-mcf.h: New file * config/i386/t-mingw-mcfgthread: New file * config/i386/t-slibgcc-cygming: Add mcfgthread for libgcc DLL * configure: Regenerate libstdc++-v3/ChangeLog: * libsupc++/atexit_thread.cc (__cxa_thread_atexit): Use implementation from mcfgthread if available * libsupc++/guard.cc (__cxa_guard_acquire, __cxa_guard_release, __cxa_guard_abort): Use implementations from mcfgthread if available * configure: Regenerate
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/config.host6
-rw-r--r--libgcc/config/i386/gthr-mcf.h1
-rw-r--r--libgcc/config/i386/t-mingw-mcfgthread1
-rw-r--r--libgcc/config/i386/t-slibgcc-cygming6
-rwxr-xr-xlibgcc/configure1
5 files changed, 14 insertions, 1 deletions
diff --git a/libgcc/config.host b/libgcc/config.host
index 0fbf9a3..eb23abe 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -825,6 +825,9 @@ i[34567]86-*-mingw*)
posix)
tmake_file="i386/t-mingw-pthread $tmake_file"
;;
+ mcf)
+ tmake_file="i386/t-mingw-mcfgthread $tmake_file"
+ ;;
esac
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
if test x$ac_cv_sjlj_exceptions = xyes; then
@@ -849,6 +852,9 @@ x86_64-*-mingw*)
posix)
tmake_file="i386/t-mingw-pthread $tmake_file"
;;
+ mcf)
+ tmake_file="i386/t-mingw-mcfgthread $tmake_file"
+ ;;
esac
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
if test x$ac_cv_sjlj_exceptions = xyes; then
diff --git a/libgcc/config/i386/gthr-mcf.h b/libgcc/config/i386/gthr-mcf.h
new file mode 100644
index 0000000..58131bb
--- /dev/null
+++ b/libgcc/config/i386/gthr-mcf.h
@@ -0,0 +1 @@
+#include <mcfgthread/gthr.h>
diff --git a/libgcc/config/i386/t-mingw-mcfgthread b/libgcc/config/i386/t-mingw-mcfgthread
new file mode 100644
index 0000000..c5b817f
--- /dev/null
+++ b/libgcc/config/i386/t-mingw-mcfgthread
@@ -0,0 +1 @@
+SHLIB_MCFGTHREAD_LIBS = -lmcfgthread -lkernel32 -lntdll
diff --git a/libgcc/config/i386/t-slibgcc-cygming b/libgcc/config/i386/t-slibgcc-cygming
index 6236c78..6871498 100644
--- a/libgcc/config/i386/t-slibgcc-cygming
+++ b/libgcc/config/i386/t-slibgcc-cygming
@@ -27,6 +27,9 @@ endif
ifndef SHLIB_PTHREAD_LDFLAG
SHLIB_PTHREAD_LDFLAG =
endif
+ifndef SHLIB_MCFGTHREAD_LIBS
+SHLIB_MCFGTHREAD_LIBS =
+endif
SHLIB_LINK = $(LN_S) -f $(SHLIB_MAP) $(SHLIB_MAP).def && \
if [ ! -d $(SHLIB_DIR) ]; then \
@@ -37,7 +40,8 @@ SHLIB_LINK = $(LN_S) -f $(SHLIB_MAP) $(SHLIB_MAP).def && \
$(SHLIB_MAP).def \
-Wl,--out-implib,$(SHLIB_DIR)/$(SHLIB_IMPLIB).tmp \
-o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \
- $(SHLIB_OBJS) ${SHLIB_PTHREAD_LDFLAG} $(SHLIB_LC) && \
+ $(SHLIB_OBJS) ${SHLIB_PTHREAD_LDFLAG} $(SHLIB_LC) \
+ $(SHLIB_MCFGTHREAD_LIBS) && \
if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \
mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \
$(SHLIB_DIR)/$(SHLIB_SONAME).backup; \
diff --git a/libgcc/configure b/libgcc/configure
index 61f3ace..be5d45f 100755
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -5699,6 +5699,7 @@ case $target_thread_file in
tpf) thread_header=config/s390/gthr-tpf.h ;;
vxworks) thread_header=config/gthr-vxworks.h ;;
win32) thread_header=config/i386/gthr-win32.h ;;
+ mcf) thread_header=config/i386/gthr-mcf.h ;;
esac