This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

__librt_multiple_threads for nptl?


No current ports need this (not even the FR-V port, that has recently
been converted to use info from the TCB instead of relying on this
global var), but it was surprising to me that any DTV_AT_TP port is
now required to use this trick.  It sure is a tiny little bit more
efficient for uses within librt, but what if it required an ABI
change?

I was a bit concerned about breaking ABI compatibility changing FR-V
to use multiple_threads in the TCB, as opposed to using this
variable, but I'm now convinced it's not an issue.  Am I mistake?

Anyhow, how about installing this patch, or at least enabling a port
to define some macro to get this variable defined in librt?  Some mq
functions definitely need it.

Index: nptl/ChangeLog
2005-02-03  Alexandre Oliva  <aoliva@redhat.com>

	* sysdeps/unix/sysv/linux/libc_multiple_threads.c
	(__librt_multiple_threads): Alias to __libc_multiple_threads.
	* Versions: Export it from libc.so as GLIBC_PRIVATE.

Index: nptl/Versions
--- nptl/Versions	2004-12-05 00:18:42.000000000 -0200
+++ nptl/Versions	2005-02-03 08:54:51.000000000 -0200
@@ -29,6 +29,7 @@
   GLIBC_PRIVATE {
     # Internal libc interface to libpthread
     __libc_dl_error_tsd;
+    __librt_multiple_threads;
   }
 }
 
Index: nptl/sysdeps/unix/sysv/linux/libc_multiple_threads.c
--- nptl/sysdeps/unix/sysv/linux/libc_multiple_threads.c	2003-03-12 22:49:25.000000000 -0300
+++ nptl/sysdeps/unix/sysv/linux/libc_multiple_threads.c	2005-02-03 07:09:23.000000000 -0200
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -21,6 +21,7 @@
 
 #ifndef NOT_IN_libc
 # ifndef TLS_MULTIPLE_THREADS_IN_TCB
-int __libc_multiple_threads attribute_hidden;
+int __libc_multiple_threads attribute_hidden __attribute__((nocommon));
+strong_alias (__libc_multiple_threads, __librt_multiple_threads);
 # endif
 #endif
-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]