--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: glibc: [patch] make building glibc-2.4 without __thread support possible
- From: Michael Banck <mbanck@debian.org>
- Date: Thu, 6 Apr 2006 11:54:30 +0200
- Message-id: <20060406095429.GA30347@localhost.localdomain>
Package: glibc
Version: 2.3.999-1
Tags: experimental, patch
Hi,
the Hurd/Mach still has no TLS or __thread support. This is not that
big of a problem as there is --without-tls, but glibc-2.4 uses __thread
unconditionally at one place and Ulrich Drepper refused to support
systems without __thread support (see
http://sourceware.org/ml/libc-alpha/2005-08/msg00091.html ).
The attached patch fixes building on system without __thread support
(i.e. hurd-i386), is it OK to apply to the 2.4 branch?
cheers,
Michael
# All lines beginning with `# DP:' are a description of the patch.
# DP: Description: Fix build when __thread is not available.
# DP: Dpatch author: Michael Banck <mbanck@debian.org>
# DP: Patch author: Thomas Schwinge
# DP: Upstream status: Rejected
# DP: Date: 2005-08-28
2005-08-28 Thomas Schwinge <schwinge@nic-nac-project.de>
malloc/memusage.c: Only use __thread if USE___THREAD.
Index: malloc/memusage.c
===================================================================
RCS file: /cvs/glibc/libc/malloc/memusage.c,v
retrieving revision 1.12
diff -u -r1.12 memusage.c
--- malloc/memusage.c 20 Aug 2005 01:12:37 -0000 1.12
+++ malloc/memusage.c 27 Aug 2005 23:43:02 -0000
@@ -83,7 +83,11 @@
static memusage_cntr_t decreasing_mremap;
static memusage_size_t current_heap;
static memusage_size_t peak_use[3];
+#if USE___THREAD
static __thread uintptr_t start_sp;
+#else
+static uintptr_t start_sp;
+#endif
/* A few macros to make the source more readable. */
#define peak_heap peak_use[0]
--- End Message ---