summaryrefslogtreecommitdiff
path: root/debian/patches/libpthread_stubs.patch
blob: f1937df082cff83365a08f6c54a78ef2e835d95a (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
---
 config.make.in                                           |    1 +
 libpthread/Makefile                                      |   14 +++++++++++++-
 libpthread/include/libc-symbols.h                        |    1 +
 libpthread/sysdeps/generic/pt-atfork.c                   |    2 ++
 libpthread/sysdeps/generic/pt-getcpuclockid.c            |    1 +
 libpthread/sysdeps/generic/pt-getschedparam.c            |    2 ++
 libpthread/sysdeps/generic/pt-key-create.c               |    2 ++
 libpthread/sysdeps/generic/pt-key-delete.c               |    2 ++
 libpthread/sysdeps/generic/pt-mutex-getprioceiling.c     |    2 ++
 libpthread/sysdeps/generic/pt-mutex-setprioceiling.c     |    2 ++
 libpthread/sysdeps/generic/pt-mutexattr-getprioceiling.c |    2 ++
 libpthread/sysdeps/generic/pt-mutexattr-setprioceiling.c |    2 ++
 libpthread/sysdeps/generic/pt-setschedparam.c            |    2 ++
 libpthread/sysdeps/generic/pt-setschedprio.c             |    2 ++
 14 files changed, 36 insertions(+), 1 deletion(-)

--- a/config.make.in
+++ b/config.make.in
@@ -44,6 +44,7 @@ RANLIB = @RANLIB@
 MIG = @MIG@
 MIGCOM = $(MIG) -cc cat - /dev/null
 AWK = @AWK@
+OBJDUMP = objdump
 
 # Compilation flags.  Append these to the definitions already made by
 # the specific Makefile.
--- a/libpthread/Makefile
+++ b/libpthread/Makefile
@@ -186,7 +186,7 @@ CPPFLAGS += \
 	  -imacros $(srcdir)/not-in-libc.h
 
 
-install: install-headers $(libdir)/libpthread2.a $(libdir)/libpthread2_pic.a
+install: install-headers $(libdir)/libpthread2.a $(libdir)/libpthread2_pic.a install-stubs-pthread
 install-headers: $(addprefix $(includedir)/, $(sysdeps_headers))
 
 # XXX: If $(libdir)/libpthread2.a is installed and
@@ -205,6 +205,18 @@ $(libdir)/libpthread2_pic.a: $(libdir)/l
 	mv $< $@
 	$(INSTALL_DATA) $(srcdir)/libpthread_pic.a $<
 
+install-stubs-pthread: stubs-pthread.h
+	mkdir -p $(includedir)/gnu
+	$(INSTALL_DATA) $< $(includedir)/gnu/stubs-pthread.h
+
+stubs-pthread.h: $(OBJS)
+	$(OBJDUMP) -h $^ | \
+	$(AWK) '/\.gnu\.glibc-stub\./ { \
+		  sub(/\.gnu\.glibc-stub\./, "", $$2); \
+		stubs[$$2] = 1; } \
+		END { for (s in stubs) print "#define __stub_" s }' > $@T
+	mv -f $@T $@
+
 .PHONY: $(addprefix $(includedir)/, $(sysdeps_headers))
 
 $(addprefix $(includedir)/, $(sysdeps_headers)):
--- a/libpthread/include/libc-symbols.h
+++ b/libpthread/include/libc-symbols.h
@@ -252,6 +252,7 @@
 
 /* A canned warning for sysdeps/stub functions.  */
 #define	stub_warning(name) \
+  __make_section_unallocated (".gnu.glibc-stub." #name) \
   link_warning (name, \
 		"warning: " #name " is not implemented and will always fail")
 
--- a/libpthread/sysdeps/generic/pt-atfork.c
+++ b/libpthread/sysdeps/generic/pt-atfork.c
@@ -27,3 +27,5 @@ pthread_atfork (void (*prepare) (void),
 {
   return ENOSYS;
 }
+
+stub_warning (pthread_atfork)
--- a/libpthread/sysdeps/generic/pt-getcpuclockid.c
+++ b/libpthread/sysdeps/generic/pt-getcpuclockid.c
@@ -30,5 +30,6 @@ pthread_getcpuclockid (pthread_t thread,
   return 0;
 #else
   return ENOSYS;
+stub_warning (pthread_getcpuclockid)
 #endif
 }
--- a/libpthread/sysdeps/generic/pt-getschedparam.c
+++ b/libpthread/sysdeps/generic/pt-getschedparam.c
@@ -26,3 +26,5 @@ pthread_getschedparam (pthread_t thread,
 {
   return ENOSYS;
 }
+
+stub_warning (pthread_getschedparam)
--- a/libpthread/sysdeps/generic/pt-key-create.c
+++ b/libpthread/sysdeps/generic/pt-key-create.c
@@ -25,3 +25,5 @@ pthread_key_create (pthread_key_t *key, 
 {
   return ENOSYS;
 }
+
+stub_warning (pthread_key_create)
--- a/libpthread/sysdeps/generic/pt-key-delete.c
+++ b/libpthread/sysdeps/generic/pt-key-delete.c
@@ -25,3 +25,5 @@ pthread_key_delete (pthread_key_t key)
 {
   return ENOSYS;
 }
+
+stub_warning (pthread_key_delete)
--- a/libpthread/sysdeps/generic/pt-mutex-getprioceiling.c
+++ b/libpthread/sysdeps/generic/pt-mutex-getprioceiling.c
@@ -26,3 +26,5 @@ pthread_mutex_getprioceiling (const pthr
 {
   return ENOSYS;
 }
+
+stub_warning (pthread_mutex_getprioceiling)
--- a/libpthread/sysdeps/generic/pt-mutex-setprioceiling.c
+++ b/libpthread/sysdeps/generic/pt-mutex-setprioceiling.c
@@ -26,3 +26,5 @@ pthread_mutex_setprioceiling (pthread_mu
 {
   return ENOSYS;
 }
+
+stub_warning (pthread_mutex_setprioceiling)
--- a/libpthread/sysdeps/generic/pt-mutexattr-getprioceiling.c
+++ b/libpthread/sysdeps/generic/pt-mutexattr-getprioceiling.c
@@ -26,3 +26,5 @@ pthread_mutexattr_getprioceiling (const 
 {
   return ENOSYS;
 }
+
+stub_warning (pthread_mutexattr_getprioceiling)
--- a/libpthread/sysdeps/generic/pt-mutexattr-setprioceiling.c
+++ b/libpthread/sysdeps/generic/pt-mutexattr-setprioceiling.c
@@ -26,3 +26,5 @@ pthread_mutexattr_setprioceiling (pthrea
 {
   return ENOSYS;
 }
+
+stub_warning (pthread_mutexattr_setprioceiling)
--- a/libpthread/sysdeps/generic/pt-setschedparam.c
+++ b/libpthread/sysdeps/generic/pt-setschedparam.c
@@ -26,3 +26,5 @@ pthread_setschedparam (pthread_t thread,
 {
   return ENOSYS;
 }
+
+stub_warning (pthread_setschedparam)
--- a/libpthread/sysdeps/generic/pt-setschedprio.c
+++ b/libpthread/sysdeps/generic/pt-setschedprio.c
@@ -25,3 +25,5 @@ pthread_setschedprio (pthread_t thread, 
 {
   return ENOSYS;
 }
+
+stub_warning (pthread_setschedprio)