summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/uclibc/uclibc-git/0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch
blob: 297a40bd04c4ef4b7f492985139672f1478c5b97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
From d021e6252b33e779857846714fb1899a25c9965d Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 23 Jun 2012 15:59:01 -0700
Subject: [PATCH] nptl/atfork: Hide pthread_atfork in shared versions

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
---
 libpthread/nptl/Makefile.in      |    4 +++-
 libpthread/nptl/pthread_atfork.c |   12 ++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in
index 158bcae..3ef7175 100644
--- a/libpthread/nptl/Makefile.in
+++ b/libpthread/nptl/Makefile.in
@@ -16,6 +16,7 @@ libc-shared-routines-y = forward.c libc-cancellation.c
 libc-static-routines-y = alloca_cutoff.c libc-cancellation.c
 libpthread-shared-only-routines-y = version.c
 libpthread-static-only-routines-y = pthread_atfork.c
+
 libpthread-routines- += $(notdir $(wildcard $(libpthread_DIR)/gen_*.c)) # dummy generated files
 libpthread-routines- += allocatestack.c # dummy included by pthread_create.c
 libpthread-routines- += pthread_mutex_getprioceiling.c pthread_mutex_setprioceiling.c # XXX: delete those or use them!
@@ -208,7 +209,7 @@ CFLAGS-msgsnd.c = -fexceptions -fasynchronous-unwind-tables
 CFLAGS-tcdrain.c = -fexceptions -fasynchronous-unwind-tables
 
 CFLAGS-pt-system.c = -fexceptions -I$(top_srcdir)libc/stdlib
-
+CFLAGS-pthread_atfork.c = -DNOT_IN_libc
 #
 # The rest of this file is uClibc specific.
 #
@@ -224,3 +225,4 @@ CFLAGS-OMIT-alloca_cutoff.c = $(CFLAGS-nptl)
 CFLAGS-OMIT-forward.c = $(CFLAGS-nptl)
 CFLAGS-OMIT-libc-lowlevelock.c = $(CFLAGS-nptl)
 CFLAGS-OMIT-libc-cancellation.c = $(CFLAGS-nptl)
+
diff --git a/libpthread/nptl/pthread_atfork.c b/libpthread/nptl/pthread_atfork.c
index e607d49..6224c17 100644
--- a/libpthread/nptl/pthread_atfork.c
+++ b/libpthread/nptl/pthread_atfork.c
@@ -38,13 +38,17 @@
 #include <fork.h>
 
 /* This is defined by newer gcc version unique for each module.  */
-extern void *__dso_handle __attribute__ ((__weak__));
-					  //,__visibility__ ("hidden")));
+extern void *__dso_handle __attribute__ ((__weak__,
+					  __visibility__ ("hidden")));
 
 
 /* Hide the symbol so that no definition but the one locally in the
    executable or DSO is used.  */
 int
+#ifndef __pthread_atfork
+/* Don't mark the compatibility function as hidden.  */
+attribute_hidden
+#endif
 __pthread_atfork (
      void (*prepare) (void),
      void (*parent) (void),
@@ -53,4 +57,8 @@ __pthread_atfork (
   return __register_atfork (prepare, parent, child,
 			    &__dso_handle == NULL ? NULL : __dso_handle);
 }
+#ifndef __pthread_atfork
+extern int pthread_atfork (void (*prepare) (void), void (*parent) (void),
+	                           void (*child) (void)) attribute_hidden;
 strong_alias (__pthread_atfork, pthread_atfork)
+#endif
-- 
1.7.9.5