summaryrefslogtreecommitdiff
path: root/dev-libs/boehm-gc
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
commitb590c8d7572b727d565cc0b8ff660d43569845de (patch)
tree06f7a4102ea4e845df8b66660f252920d52952f9 /dev-libs/boehm-gc
parent24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff)
downloadbaldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip
Adding metadata
Diffstat (limited to 'dev-libs/boehm-gc')
-rw-r--r--dev-libs/boehm-gc/Manifest3
-rw-r--r--dev-libs/boehm-gc/boehm-gc-8.2.10-r1.ebuild67
-rw-r--r--dev-libs/boehm-gc/boehm-gc-8.2.10.ebuild63
-rw-r--r--dev-libs/boehm-gc/boehm-gc-8.2.12.ebuild63
-rw-r--r--dev-libs/boehm-gc/boehm-gc-8.2.8.ebuild63
-rw-r--r--dev-libs/boehm-gc/files/boehm-gc-8.2.10-crash.patch258
-rw-r--r--dev-libs/boehm-gc/metadata.xml15
7 files changed, 532 insertions, 0 deletions
diff --git a/dev-libs/boehm-gc/Manifest b/dev-libs/boehm-gc/Manifest
new file mode 100644
index 000000000000..83ed4fe94493
--- /dev/null
+++ b/dev-libs/boehm-gc/Manifest
@@ -0,0 +1,3 @@
+DIST gc-8.2.10.tar.gz 1229219 BLAKE2B 2f3da8273fd2a4b54041ea1b82e19cf93a301e07cc9cfd6f72444c057fc8a0cdb470c97c46e91ee49ddc33c5156875f7984993c298b385b5382424e230be5d9b SHA512 56558bf81716caa882fd015f3f0d0d86d05f38680266b22798153b1e7f4a6fbbcded2efb3e125c41a4c52d44259ac4900061e61729663f62427e73b691e317b0
+DIST gc-8.2.12.tar.gz 1231996 BLAKE2B 5e264f1ac0837cc4122b39c6dd8e1308f06f5da06ef733ea8fe213005b32999da1f3147b1e4aaee961b553c6bac3e9c76900a19baf3b1a7711c1069597356cb2 SHA512 af175b33f85b4ba9ea5d5fd4f62e96bfafb1582a5159b6c1798bac48893969f2988e95a05666635b6dee9761bdeedbd1d7212cad5fd272a3a07daf4ec2ea5cc4
+DIST gc-8.2.8.tar.gz 1219553 BLAKE2B 7e0da4d9596b53bacb41a9939c0dfc9c8cf9b57c032dd445a74678b9467bc9253749497ad3f9ae43060aafed42877191b27c5e8faad1a59f75e80a68fa6d37bd SHA512 e0994bac8d1068f79a8379fa5797efbd420b22eb923d6537613e7542fc6805f74f57be0c4ff7555539461f8ace849fa1534e2077752bfb61c0e14f367b5b55af
diff --git a/dev-libs/boehm-gc/boehm-gc-8.2.10-r1.ebuild b/dev-libs/boehm-gc/boehm-gc-8.2.10-r1.ebuild
new file mode 100644
index 000000000000..3ffe80b2e393
--- /dev/null
+++ b/dev-libs/boehm-gc/boehm-gc-8.2.10-r1.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit dot-a multilib-minimal libtool
+
+MY_P="gc-${PV}"
+
+DESCRIPTION="The Boehm-Demers-Weiser conservative garbage collector"
+HOMEPAGE="https://www.hboehm.info/gc/ https://github.com/bdwgc/bdwgc/"
+SRC_URI="https://github.com/bdwgc/bdwgc/releases/download/v${PV}/${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="boehm-gc"
+# SONAME: libgc.so.1 libgccpp.so.1
+# We've been using subslot 0 for these instead of "1.1".
+SLOT="0"
+# Don't keyword versions if upstream mark them as pre-release.
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~arm64-macos ~x64-macos ~x64-solaris"
+IUSE="cxx +large static-libs +threads"
+
+RDEPEND=">=dev-libs/libatomic_ops-7.4[${MULTILIB_USEDEP}]"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-8.2.10-crash.patch
+)
+
+src_prepare() {
+ default
+
+ # bug #594754
+ elibtoolize
+}
+
+src_configure() {
+ use static-libs && lto-guarantee-fat
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local config=(
+ --disable-docs
+ --with-libatomic-ops
+ $(use_enable cxx cplusplus)
+ $(use_enable static-libs static)
+ $(use threads || echo --disable-threads)
+ $(use_enable large large-config)
+ )
+
+ ECONF_SOURCE="${S}" econf "${config[@]}"
+}
+
+multilib_src_install_all() {
+ local HTML_DOCS=( doc/*.md )
+ einstalldocs
+ dodoc doc/README{.environment,.linux,.macros}
+
+ # Package provides .pc files
+ find "${ED}" -name '*.la' -delete || die
+
+ newman doc/gc.man GC_malloc.1
+
+ strip-lto-bytecode
+}
diff --git a/dev-libs/boehm-gc/boehm-gc-8.2.10.ebuild b/dev-libs/boehm-gc/boehm-gc-8.2.10.ebuild
new file mode 100644
index 000000000000..8ef2abd30140
--- /dev/null
+++ b/dev-libs/boehm-gc/boehm-gc-8.2.10.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit dot-a multilib-minimal libtool
+
+MY_P="gc-${PV}"
+
+DESCRIPTION="The Boehm-Demers-Weiser conservative garbage collector"
+HOMEPAGE="https://www.hboehm.info/gc/ https://github.com/bdwgc/bdwgc/"
+SRC_URI="https://github.com/bdwgc/bdwgc/releases/download/v${PV}/${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="boehm-gc"
+# SONAME: libgc.so.1 libgccpp.so.1
+# We've been using subslot 0 for these instead of "1.1".
+SLOT="0"
+# Don't keyword versions if upstream mark them as pre-release.
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris"
+IUSE="cxx +large static-libs +threads"
+
+RDEPEND=">=dev-libs/libatomic_ops-7.4[${MULTILIB_USEDEP}]"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+src_prepare() {
+ default
+
+ # bug #594754
+ elibtoolize
+}
+
+src_configure() {
+ use static-libs && lto-guarantee-fat
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local config=(
+ --disable-docs
+ --with-libatomic-ops
+ $(use_enable cxx cplusplus)
+ $(use_enable static-libs static)
+ $(use threads || echo --disable-threads)
+ $(use_enable large large-config)
+ )
+
+ ECONF_SOURCE="${S}" econf "${config[@]}"
+}
+
+multilib_src_install_all() {
+ local HTML_DOCS=( doc/*.md )
+ einstalldocs
+ dodoc doc/README{.environment,.linux,.macros}
+
+ # Package provides .pc files
+ find "${ED}" -name '*.la' -delete || die
+
+ newman doc/gc.man GC_malloc.1
+
+ strip-lto-bytecode
+}
diff --git a/dev-libs/boehm-gc/boehm-gc-8.2.12.ebuild b/dev-libs/boehm-gc/boehm-gc-8.2.12.ebuild
new file mode 100644
index 000000000000..e64cfed35a01
--- /dev/null
+++ b/dev-libs/boehm-gc/boehm-gc-8.2.12.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit dot-a multilib-minimal libtool
+
+MY_P="gc-${PV}"
+
+DESCRIPTION="The Boehm-Demers-Weiser conservative garbage collector"
+HOMEPAGE="https://www.hboehm.info/gc/ https://github.com/bdwgc/bdwgc/"
+SRC_URI="https://github.com/bdwgc/bdwgc/releases/download/v${PV}/${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="boehm-gc"
+# SONAME: libgc.so.1 libgccpp.so.1
+# We've been using subslot 0 for these instead of "1.1".
+SLOT="0"
+# Don't keyword versions if upstream mark them as pre-release.
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~arm64-macos ~x64-macos ~x64-solaris"
+IUSE="cxx +large static-libs +threads"
+
+RDEPEND=">=dev-libs/libatomic_ops-7.4[${MULTILIB_USEDEP}]"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+src_prepare() {
+ default
+
+ # bug #594754
+ elibtoolize
+}
+
+src_configure() {
+ use static-libs && lto-guarantee-fat
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local config=(
+ --disable-docs
+ --with-libatomic-ops
+ $(use_enable cxx cplusplus)
+ $(use_enable static-libs static)
+ $(use threads || echo --disable-threads)
+ $(use_enable large large-config)
+ )
+
+ ECONF_SOURCE="${S}" econf "${config[@]}"
+}
+
+multilib_src_install_all() {
+ local HTML_DOCS=( doc/*.md )
+ einstalldocs
+ dodoc doc/README{.environment,.linux,.macros}
+
+ # Package provides .pc files
+ find "${ED}" -name '*.la' -delete || die
+
+ newman doc/gc.man GC_malloc.1
+
+ strip-lto-bytecode
+}
diff --git a/dev-libs/boehm-gc/boehm-gc-8.2.8.ebuild b/dev-libs/boehm-gc/boehm-gc-8.2.8.ebuild
new file mode 100644
index 000000000000..cd56aac085d8
--- /dev/null
+++ b/dev-libs/boehm-gc/boehm-gc-8.2.8.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit dot-a multilib-minimal libtool
+
+MY_P="gc-${PV}"
+
+DESCRIPTION="The Boehm-Demers-Weiser conservative garbage collector"
+HOMEPAGE="https://www.hboehm.info/gc/ https://github.com/bdwgc/bdwgc/"
+SRC_URI="https://github.com/bdwgc/bdwgc/releases/download/v${PV}/${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="boehm-gc"
+# SONAME: libgc.so.1 libgccpp.so.1
+# We've been using subslot 0 for these instead of "1.1".
+SLOT="0"
+# Don't keyword versions if upstream mark them as pre-release.
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~arm64-macos ~x64-macos ~x64-solaris"
+IUSE="cxx +large static-libs +threads"
+
+RDEPEND=">=dev-libs/libatomic_ops-7.4[${MULTILIB_USEDEP}]"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+src_prepare() {
+ default
+
+ # bug #594754
+ elibtoolize
+}
+
+src_configure() {
+ use static-libs && lto-guarantee-fat
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local config=(
+ --disable-docs
+ --with-libatomic-ops
+ $(use_enable cxx cplusplus)
+ $(use_enable static-libs static)
+ $(use threads || echo --disable-threads)
+ $(use_enable large large-config)
+ )
+
+ ECONF_SOURCE="${S}" econf "${config[@]}"
+}
+
+multilib_src_install_all() {
+ local HTML_DOCS=( doc/*.md )
+ einstalldocs
+ dodoc doc/README{.environment,.linux,.macros}
+
+ # Package provides .pc files
+ find "${ED}" -name '*.la' -delete || die
+
+ newman doc/gc.man GC_malloc.1
+
+ strip-lto-bytecode
+}
diff --git a/dev-libs/boehm-gc/files/boehm-gc-8.2.10-crash.patch b/dev-libs/boehm-gc/files/boehm-gc-8.2.10-crash.patch
new file mode 100644
index 000000000000..be9986e52a96
--- /dev/null
+++ b/dev-libs/boehm-gc/files/boehm-gc-8.2.10-crash.patch
@@ -0,0 +1,258 @@
+https://github.com/bdwgc/bdwgc/issues/783
+https://github.com/bdwgc/bdwgc/issues/802
+https://github.com/bdwgc/bdwgc/commit/910b4f008f3bcb436a23a2d5f9784e5dd9ab66cd
+https://github.com/bdwgc/bdwgc/commit/1058994bc264dd99a7b6d3caefe0c129bfbd1fb7
+https://github.com/bdwgc/bdwgc/commit/73fdfdaf45fd35993c7f9e051875147ca39438c4
+
+From 910b4f008f3bcb436a23a2d5f9784e5dd9ab66cd Mon Sep 17 00:00:00 2001
+From: Ivan Maidanski <ivmai@mail.ru>
+Date: Sat, 25 Oct 2025 23:19:33 +0300
+Subject: [PATCH] Fix SIGSEGV in remove_all_threads_but_me if fork from
+ unregistered thread (a cherry-pick of commit 44fbb3b9e from 'master')
+
+Issue #783 (bdwgc).
+
+Some clients call `fork()` from an unregistered thread, thus we might
+find no entry for the current thread in `GC_remove_all_threads_but_me`.
+
+* include/gc.h (GC_atfork_child): Add comment about `fork()` from
+an unregistered thread.
+* pthread_support.c [CAN_HANDLE_FORK] (GC_remove_all_threads_but_me):
+If `me` is null, then return immediately after loop (instead of `ABORT`
+or the assertion, regardless of `CPPCHECK` and `LINT2`).
+* win32_threads.c [CAN_HANDLE_FORK] (GC_remove_all_threads_but_me):
+Likewise.
+---
+ include/gc.h | 1 +
+ pthread_support.c | 19 ++++++++-----------
+ win32_threads.c | 4 +++-
+ 3 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/include/gc.h b/include/gc.h
+index 54d704a06..b929240fc 100644
+--- a/include/gc.h
++++ b/include/gc.h
+@@ -512,6 +512,7 @@ GC_API void GC_CALL GC_set_handle_fork(int);
+ /* non-zero); GC_atfork_child is to be called immediately in the child */
+ /* branch (i.e., fork result is 0). Note that GC_atfork_child() call */
+ /* should, of course, precede GC_start_mark_threads call (if any). */
++/* Note that fork() could be called from an unregistered thread. */
+ GC_API void GC_CALL GC_atfork_prepare(void);
+ GC_API void GC_CALL GC_atfork_parent(void);
+ GC_API void GC_CALL GC_atfork_child(void);
+diff --git a/pthread_support.c b/pthread_support.c
+index dbde77f25..0efbcdd9c 100644
+--- a/pthread_support.c
++++ b/pthread_support.c
+@@ -829,11 +829,11 @@ GC_API void GC_CALL GC_register_altstack(void *stack, GC_word stack_size,
+ GC_threads[hv] = me;
+ }
+
+-/* Remove all entries from the GC_threads table, except the one for */
+-/* the current thread. Also update thread identifiers stored in */
+-/* the table for the current thread. We need to do this in the */
+-/* child process after a fork(), since only the current thread */
+-/* survives in the child. */
++/* Remove all entries from the GC_threads table, except the one (if */
++/* any) for the current thread. Also update thread identifiers */
++/* stored in the table for the current thread. We need to do this */
++/* in the child process after a fork(), since only the current */
++/* thread survives in the child. */
+ STATIC void GC_remove_all_threads_but_me(void)
+ {
+ int hv;
+@@ -870,12 +870,9 @@ STATIC void GC_remove_all_threads_but_me(void)
+ store_to_threads_table(hv, NULL);
+ }
+
+-# if defined(CPPCHECK) || defined(LINT2)
+- if (NULL == me)
+- ABORT("Current thread is not found after fork");
+-# else
+- GC_ASSERT(me != NULL);
+-# endif
++ if (NULL == me)
++ return; /* fork() is called from an unregistered thread */
++
+ /* Update pthread's id as it is not guaranteed to be the same */
+ /* between this (child) process and the parent one. */
+ me -> id = pthread_self();
+diff --git a/win32_threads.c b/win32_threads.c
+index d1b7d5dbe..0335085ed 100644
+--- a/win32_threads.c
++++ b/win32_threads.c
+@@ -1185,8 +1185,10 @@ GC_API void * GC_CALL GC_get_my_stackbottom(struct GC_stack_base *sb)
+ GC_threads[hv] = NULL;
+ }
+
++ if (NULL == me)
++ return; /* fork() is called from an unregistered thread */
++
+ /* Put "me" back to GC_threads. */
+- GC_ASSERT(me != NULL);
+ thread_id = GetCurrentThreadId(); /* differs from that in parent */
+ GC_threads[THREAD_TABLE_INDEX(thread_id)] = me;
+
+
+From 1058994bc264dd99a7b6d3caefe0c129bfbd1fb7 Mon Sep 17 00:00:00 2001
+From: Ivan Maidanski <ivmai@mail.ru>
+Date: Thu, 30 Oct 2025 23:39:44 +0300
+Subject: [PATCH] Fix code defect of LOCK/UNLOCK in separate 'if' in
+ GC_generic_malloc_many (a cherry-pick of commit c7d342c83 from 'master')
+
+* mallocx.c [PARALLEL_MARK] (GC_generic_malloc_many): Check
+`GC_parallel` once around `GC_reclaim_generic()` call (so that
+nearby `UNLOCK()` and the following `LOCK()` to be placed inside
+a single `if` statement block).
+---
+ mallocx.c | 82 +++++++++++++++++++++++++++----------------------------
+ 1 file changed, 41 insertions(+), 41 deletions(-)
+
+diff --git a/mallocx.c b/mallocx.c
+index 340bd5231..927008958 100644
+--- a/mallocx.c
++++ b/mallocx.c
+@@ -374,54 +374,54 @@ GC_API void GC_CALL GC_generic_malloc_many(size_t lb, int k, void **result)
+ ++ GC_fl_builder_count;
+ UNLOCK();
+ GC_release_mark_lock();
+- }
+-# endif
+- op = GC_reclaim_generic(hbp, hhdr, lb,
+- ok -> ok_init, 0, &my_bytes_allocd);
+- if (op != 0) {
+-# ifdef PARALLEL_MARK
+- if (GC_parallel) {
+- *result = op;
+- (void)AO_fetch_and_add(&GC_bytes_allocd_tmp,
+- (AO_t)my_bytes_allocd);
++
++ op = GC_reclaim_generic(hbp, hhdr, lb, ok -> ok_init, NULL,
++ &my_bytes_allocd);
++ if (op != NULL) {
++ *result = op;
++ (void)AO_fetch_and_add(&GC_bytes_allocd_tmp,
++ (AO_t)my_bytes_allocd);
++ GC_acquire_mark_lock();
++ -- GC_fl_builder_count;
++ if (GC_fl_builder_count == 0) GC_notify_all_builder();
++# ifdef THREAD_SANITIZER
++ GC_release_mark_lock();
++ LOCK();
++ GC_bytes_found += my_bytes_allocd;
++ UNLOCK();
++# else
++ GC_bytes_found += my_bytes_allocd;
++ /* The result may be inaccurate. */
++ GC_release_mark_lock();
++# endif
++ (void) GC_clear_stack(0);
++ return;
++ }
++
+ GC_acquire_mark_lock();
+ -- GC_fl_builder_count;
+ if (GC_fl_builder_count == 0) GC_notify_all_builder();
+-# ifdef THREAD_SANITIZER
+- GC_release_mark_lock();
+- LOCK();
+- GC_bytes_found += my_bytes_allocd;
+- UNLOCK();
+-# else
+- GC_bytes_found += my_bytes_allocd;
+- /* The result may be inaccurate. */
+- GC_release_mark_lock();
+-# endif
+- (void) GC_clear_stack(0);
+- return;
+- }
+-# endif
+- /* We also reclaimed memory, so we need to adjust */
+- /* that count. */
++ GC_release_mark_lock();
++ LOCK();
++ /* GC lock is needed for reclaim list access. We */
++ /* must decrement fl_builder_count before reacquiring */
++ /* the lock. Hopefully this path is rare. */
++
++ rlh = ok -> ok_reclaim_list; /* reload rlh after locking */
++ if (NULL == rlh) break;
++ continue;
++ }
++# endif
++
++ op = GC_reclaim_generic(hbp, hhdr, lb, ok -> ok_init, NULL,
++ &my_bytes_allocd);
++ if (op != NULL) {
++ /* We also reclaimed memory, so we need to adjust */
++ /* that count. */
+ GC_bytes_found += my_bytes_allocd;
+ GC_bytes_allocd += my_bytes_allocd;
+ goto out;
+ }
+-# ifdef PARALLEL_MARK
+- if (GC_parallel) {
+- GC_acquire_mark_lock();
+- -- GC_fl_builder_count;
+- if (GC_fl_builder_count == 0) GC_notify_all_builder();
+- GC_release_mark_lock();
+- LOCK();
+- /* GC lock is needed for reclaim list access. We */
+- /* must decrement fl_builder_count before reacquiring */
+- /* the lock. Hopefully this path is rare. */
+-
+- rlh = ok -> ok_reclaim_list; /* reload rlh after locking */
+- if (NULL == rlh) break;
+- }
+-# endif
+ }
+ }
+ /* Next try to use prefix of global free list if there is one. */
+From 73fdfdaf45fd35993c7f9e051875147ca39438c4 Mon Sep 17 00:00:00 2001
+From: Ivan Maidanski <ivmai@mail.ru>
+Date: Fri, 31 Oct 2025 22:44:52 +0300
+Subject: [PATCH] Fix SIGSEGV if pthread_detach is called before collector
+ initialization (a cherry-pick of commit e40697e26 from 'master')
+
+The only case this seems to be needed is when the client calls
+`pthread_detach(pthread_self())` before the collector initialization.
+
+* pthread_support.c [!SN_TARGET_ORBIS && !SN_TARGET_PSP2]
+(GC_pthread_detach): Call `GC_init()` if the collector is not
+initialized; add comment.
+* win32_threads.c [GC_PTHREADS] (GC_pthread_detach): Likewise.
+---
+ pthread_support.c | 7 +++++++
+ win32_threads.c | 1 +
+ 2 files changed, 8 insertions(+)
+
+diff --git a/pthread_support.c b/pthread_support.c
+index 0efbcdd9c..fb09f3d17 100644
+--- a/pthread_support.c
++++ b/pthread_support.c
+@@ -2016,6 +2016,13 @@ GC_INNER_PTHRSTART void GC_thread_exit_proc(void *arg)
+ DCL_LOCK_STATE;
+
+ INIT_REAL_SYMS();
++ if (!EXPECT(GC_is_initialized, TRUE)) {
++ /*
++ * The only case this seems to be needed is when the client calls
++ * pthread_detach(pthread_self()) before the collector initialization.
++ */
++ GC_init();
++ }
+ LOCK();
+ t = (GC_thread)COVERT_DATAFLOW(GC_lookup_thread(thread));
+ UNLOCK();
+diff --git a/win32_threads.c b/win32_threads.c
+index 0335085ed..0ec33cf95 100644
+--- a/win32_threads.c
++++ b/win32_threads.c
+@@ -3257,6 +3257,7 @@ GC_INNER void GC_thr_init(void)
+ GC_thread t;
+ DCL_LOCK_STATE;
+
++ if (!EXPECT(GC_is_initialized, TRUE)) GC_init();
+ GC_ASSERT(!GC_win32_dll_threads);
+ t = GC_lookup_pthread(thread);
+ result = pthread_detach(thread);
diff --git a/dev-libs/boehm-gc/metadata.xml b/dev-libs/boehm-gc/metadata.xml
new file mode 100644
index 000000000000..a080ad2c69bf
--- /dev/null
+++ b/dev-libs/boehm-gc/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+ </maintainer>
+ <use>
+ <flag name="large">optimize for large heap size (also increases max root sets)</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:boehm-demers-weiser:garbage_collector</remote-id>
+ </upstream>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>