diff --git a/repos/libports/include/stdcxx/README b/repos/libports/include/stdcxx/README index 6fca716b82..84fca7fabe 100644 --- a/repos/libports/include/stdcxx/README +++ b/repos/libports/include/stdcxx/README @@ -18,3 +18,4 @@ file origins - copy 'build/arm_v8a/noux-pkg/gcc_arm_64/aarch64-none-elf/libstdc++-v3/include/aarch64-none-elf/bits/c++config.h' - #define _GLIBCXX_HAS_GTHREADS 1 in all of the copied files - #undef _GLIBCXX_HAVE_TLS in all of the copied files +- bits/os_defines.h: manually created, based on config/os/generic/os_defines.h diff --git a/repos/libports/include/stdcxx/bits/os_defines.h b/repos/libports/include/stdcxx/bits/os_defines.h new file mode 100644 index 0000000000..604df73c51 --- /dev/null +++ b/repos/libports/include/stdcxx/bits/os_defines.h @@ -0,0 +1,35 @@ +/* + * \brief Genode-specific defines + * \author Christian Prochaska + * \date 2025-03-05 + */ + +/* + * Copyright (C) 2025 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU Affero General Public License version 3. + */ + +#ifndef _INCLUDE__STDCXX__BITS__OS_DEFINES_H_ +#define _INCLUDE__STDCXX__BITS__OS_DEFINES_H_ + +/* see config/os/generic/os_defines.h */ +#define _GLIBCXX_GTHREAD_USE_WEAK 0 + +/* prevent gcc headers from defining mbstate */ +#define _GLIBCXX_HAVE_MBSTATE_T 1 + +/* use compiler-builtin atomic operations */ +#define _GLIBCXX_ATOMIC_BUILTINS 1 + +/* no isinf isnan */ +#define _GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC 1 + +/* + * Use 'pthread_mutex_init()' and 'pthread_mutex_destroy()' + * instead of 'PTHREAD_MUTEX_INITIALIZER' to avoid memory leaks. + */ +#define _GTHREAD_USE_MUTEX_INIT_FUNC 1 + +#endif /* _INCLUDE__STDCXX__BITS__OS_DEFINES_H_ */ diff --git a/repos/libports/lib/import/import-stdcxx.mk b/repos/libports/lib/import/import-stdcxx.mk index 0431165dcb..a255e6af15 100644 --- a/repos/libports/lib/import/import-stdcxx.mk +++ b/repos/libports/lib/import/import-stdcxx.mk @@ -31,12 +31,3 @@ endif # stdcxx headers include libc headers include $(call select_from_repositories,lib/import/import-libc.mk) - -# prevent gcc headers from defining mbstate -CC_OPT += -D_GLIBCXX_HAVE_MBSTATE_T - -# use compiler-builtin atomic operations -CC_OPT += -D_GLIBCXX_ATOMIC_BUILTINS_4 - -# No isinf isnan -CC_OPT += -D_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC diff --git a/repos/libports/ports/stdcxx.hash b/repos/libports/ports/stdcxx.hash index 904dcd4bc2..9c46073b01 100644 --- a/repos/libports/ports/stdcxx.hash +++ b/repos/libports/ports/stdcxx.hash @@ -1 +1 @@ -4eddc2a55a80ed5d3a50fee3f5c25e7ac42afd72 +9bb0da098aecb00b1d9446d45eededda262d6e74 diff --git a/repos/libports/ports/stdcxx.port b/repos/libports/ports/stdcxx.port index 44cc913447..d15aafce58 100644 --- a/repos/libports/ports/stdcxx.port +++ b/repos/libports/ports/stdcxx.port @@ -46,7 +46,6 @@ DIR_CONTENT(include/stdcxx/bits) := \ src/lib/stdcxx/config/os/generic/ctype_base.h \ src/lib/stdcxx/config/os/generic/ctype_inline.h \ src/lib/stdcxx/config/os/generic/error_constants.h \ - src/lib/stdcxx/config/os/generic/os_defines.h \ src/lib/stdcxx/config/locale/generic/messages_members.h \ src/lib/stdcxx/config/locale/generic/time_members.h \ src/lib/stdcxx/gthr.h