libc: add option for c11 threads
Add a config option for C11 threads. Signed-off-by: Christopher Friedt <chris@friedt.co>
This commit is contained in:
parent
822807ab6b
commit
5dfdb4b04f
|
@ -19,6 +19,10 @@ config LIBC_SUPPORT_THREADS_POSIX
|
|||
bool
|
||||
select LIBC_SUPPORT_THREADS_ANY
|
||||
|
||||
config LIBC_SUPPORT_THREADS_C11
|
||||
bool
|
||||
select LIBC_SUPPORT_THREADS_ANY
|
||||
|
||||
config LIBC_SUPPORT_THREADS_NONE
|
||||
bool
|
||||
|
||||
|
@ -40,6 +44,7 @@ choice
|
|||
default THREADS_NATIVE if LIBC_SUPPORT_THREADS_NATIVE
|
||||
default THREADS_LT if LIBC_SUPPORT_THREADS_LT
|
||||
default THREADS_POSIX if LIBC_SUPPORT_THREADS_POSIX
|
||||
default THREADS_C11 if LIBC_SUPPORT_THREADS_C11
|
||||
default THREADS_NONE
|
||||
|
||||
config THREADS_NATIVE
|
||||
|
@ -63,6 +68,11 @@ config THREADS_POSIX
|
|||
prompt "posix"
|
||||
depends on LIBC_SUPPORT_THREADS_POSIX
|
||||
|
||||
config THREADS_C11
|
||||
bool
|
||||
prompt "c11"
|
||||
depends on LIBC_SUPPORT_THREADS_C11
|
||||
|
||||
config THREADS_NONE
|
||||
bool
|
||||
prompt "none"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
## depends on BARE_METAL
|
||||
## select LIBC_PROVIDES_CXA_ATEXIT
|
||||
## select LIBC_SUPPORT_THREADS_C11
|
||||
## select LIBC_SUPPORT_THREADS_NONE
|
||||
## select CC_CORE_NEEDED
|
||||
|
||||
|
@ -12,6 +13,9 @@
|
|||
## help array of processors, and will usually work on any architecture with
|
||||
## help the addition of a few low-level routines.
|
||||
|
||||
config THREADS
|
||||
default "c11" if THREADS_C11
|
||||
|
||||
config LIBC_NEWLIB_TARGET_CFLAGS
|
||||
string
|
||||
prompt "Target CFLAGS for newlib"
|
||||
|
|
|
@ -1073,16 +1073,21 @@ do_gcc_backend() {
|
|||
extra_config+=("--with-host-libstdcxx=${host_libstdcxx_flags[*]}")
|
||||
fi
|
||||
|
||||
if [ "${CT_THREADS}" = "none" ]; then
|
||||
case "${CT_THREADS}" in
|
||||
none)
|
||||
extra_config+=("--disable-threads")
|
||||
else
|
||||
if [ "${CT_THREADS}" = "win32" ]; then
|
||||
extra_config+=("--enable-threads=win32")
|
||||
extra_config+=("--disable-win32-registry")
|
||||
else
|
||||
extra_config+=("--enable-threads=posix")
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
win32)
|
||||
extra_config+=("--enable-threads=win32")
|
||||
extra_config+=("--disable-win32-registry")
|
||||
;;
|
||||
c11)
|
||||
extra_config+=("--enable-threads=c11")
|
||||
;;
|
||||
*)
|
||||
extra_config+=("--enable-threads=posix")
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${CT_CC_GCC_ENABLE_TARGET_OPTSPACE}" = "y" ] || \
|
||||
[ "${enable_optspace}" = "yes" ]; then
|
||||
|
|
Loading…
Reference in New Issue