patches/uClibc/0.9.30.2/150-LT-pthread_atfork-unhide.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Jan 03 23:40:22 2011 +0100 (2011-01-03)
changeset 2267 7af68e6083aa
permissions -rw-r--r--
libc-glibc: remove 2.3.6

This is an obsolete version which is no longer used by any sample (the only
user, the ia64 sample, has been removed).

It also makes the code path a bit complex, with twists just to accomodate
that version. Removing the version will make those twists go away, and
will ease commonalisation of glibc and eglibc in the future (hopefully!).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 From a05c4380c5aaa6e107a4c7e1e5a139ec4cc43f0c Mon Sep 17 00:00:00 2001
     2 From: Henning Heinold <heinold@inf.fu-berlin.de>
     3 Date: Sun, 21 Feb 2010 11:55:32 +0100
     4 Subject: [PATCH 14/15] LT pthread_atfork: unhide
     5 
     6 Trying to compile perl with uClibc new linuxthreads on arm.
     7 I run into the problem that pthread_atfork is not available.
     8 The problem was that it was synced with the glibc version, which has
     9 compat ifdefs we do not need in uClibc. The inital checked in version
    10 is right and works. So either revert the commit 2 years ago
    11 or patch it with the patch attached I made for openembedded.
    12 
    13 Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
    14 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
    15 ---
    16  libpthread/linuxthreads/Makefile.in      |    2 +-
    17  libpthread/linuxthreads/pthread_atfork.c |   13 +++----------
    18  2 files changed, 4 insertions(+), 11 deletions(-)
    19 
    20 diff --git a/libpthread/linuxthreads/Makefile.in b/libpthread/linuxthreads/Makefile.in
    21 index 947dea9..d53b5fa 100644
    22 --- a/libpthread/linuxthreads/Makefile.in
    23 +++ b/libpthread/linuxthreads/Makefile.in
    24 @@ -45,7 +45,7 @@ pthread_sysdep_SRC := $(patsubst %,$(libpthread_DIR)/sysdeps/pthread/%.c,$(pthre
    25  pthread_SRC := \
    26  	attr barrier cancel condvar errno events join pthread \
    27  	lockfile manager mutex pt-machine ptcleanup \
    28 -	ptclock_gettime ptclock_settime ptfork pthandles \
    29 +	ptclock_gettime ptclock_settime ptfork pthandles pthread_atfork \
    30  	pthread_setegid pthread_seteuid pthread_setgid pthread_setregid \
    31  	pthread_setresgid pthread_setresuid pthread_setreuid pthread_setuid \
    32  	rwlock semaphore sighandler signals specific spinlock
    33 diff --git a/libpthread/linuxthreads/pthread_atfork.c b/libpthread/linuxthreads/pthread_atfork.c
    34 index 2464acb..4c83dd0 100644
    35 --- a/libpthread/linuxthreads/pthread_atfork.c
    36 +++ b/libpthread/linuxthreads/pthread_atfork.c
    37 @@ -43,12 +43,8 @@ extern void *__dso_handle __attribute__ ((__weak__));
    38  
    39  /* Hide the symbol so that no definition but the one locally in the
    40     executable or DSO is used.  */
    41 -int
    42 -#ifndef __pthread_atfork
    43 -/* Don't mark the compatibility function as hidden.  */
    44 -attribute_hidden
    45 -#endif
    46 -__pthread_atfork (prepare, parent, child)
    47 +
    48 +int attribute_hidden __pthread_atfork (prepare, parent, child)
    49       void (*prepare) (void);
    50       void (*parent) (void);
    51       void (*child) (void);
    52 @@ -56,8 +52,5 @@ __pthread_atfork (prepare, parent, child)
    53    return __register_atfork (prepare, parent, child,
    54  			    &__dso_handle == NULL ? NULL : __dso_handle);
    55  }
    56 -#ifndef __pthread_atfork
    57 -extern int pthread_atfork (void (*prepare) (void), void (*parent) (void),
    58 -			   void (*child) (void)) attribute_hidden;
    59 +
    60  strong_alias (__pthread_atfork, pthread_atfork)
    61 -#endif
    62 -- 
    63 1.6.6.1
    64