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