diff options
author | LIU Hao <lh_mouse@126.com> | 2022-04-16 00:46:23 +0800 |
---|---|---|
committer | Jonathan Yong <10walls@gmail.com> | 2022-10-19 13:52:37 +0000 |
commit | f036d759ecee538555fa8c6b11963e4033732463 (patch) | |
tree | b1f521e7f71c849d3b8f64e2d65d8df081b977ce /gcc/config/i386 | |
parent | f3b957ea8b9dadfb1ed30f24f463529684b7a36a (diff) | |
download | gcc-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 'gcc/config/i386')
-rw-r--r-- | gcc/config/i386/mingw-mcfgthread.h | 1 | ||||
-rw-r--r-- | gcc/config/i386/mingw32.h | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/config/i386/mingw-mcfgthread.h b/gcc/config/i386/mingw-mcfgthread.h new file mode 100644 index 0000000..7d4eda3 --- /dev/null +++ b/gcc/config/i386/mingw-mcfgthread.h @@ -0,0 +1 @@ +#define TARGET_USING_MCFGTHREAD 1 diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h index d3ca0cd..b5f31c3 100644 --- a/gcc/config/i386/mingw32.h +++ b/gcc/config/i386/mingw32.h @@ -32,6 +32,10 @@ along with GCC; see the file COPYING3. If not see | MASK_STACK_PROBE | MASK_ALIGN_DOUBLE \ | MASK_MS_BITFIELD_LAYOUT) +#ifndef TARGET_USING_MCFGTHREAD +#define TARGET_USING_MCFGTHREAD 0 +#endif + /* See i386/crtdll.h for an alternative definition. _INTEGRAL_MAX_BITS is for compatibility with native compiler. */ #define EXTRA_OS_CPP_BUILTINS() \ @@ -50,6 +54,8 @@ along with GCC; see the file COPYING3. If not see builtin_define_std ("WIN64"); \ builtin_define ("_WIN64"); \ } \ + if (TARGET_USING_MCFGTHREAD) \ + builtin_define ("__USING_MCFGTHREAD__"); \ } \ while (0) @@ -181,11 +187,16 @@ along with GCC; see the file COPYING3. If not see #else #define SHARED_LIBGCC_SPEC " -lgcc " #endif +#if TARGET_USING_MCFGTHREAD +#define MCFGTHREAD_SPEC " -lmcfgthread -lkernel32 -lntdll " +#else +#define MCFGTHREAD_SPEC "" +#endif #undef REAL_LIBGCC_SPEC #define REAL_LIBGCC_SPEC \ "%{mthreads:-lmingwthrd} -lmingw32 \ " SHARED_LIBGCC_SPEC " \ - -lmoldname -lmingwex -lmsvcrt -lkernel32" + -lmoldname -lmingwex -lmsvcrt -lkernel32 " MCFGTHREAD_SPEC #undef STARTFILE_SPEC #define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \ |