summaryrefslogtreecommitdiff
path: root/packages/uClibc-ng/1.0.25/0000-gdb8.patch
blob: ad6132bdc5d8f3ba3865554024d4da85d6535073 (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
commit 111f01d432d542a153c1cad83def3a6ab57df7af
Author: Waldemar Brodkorb <wbx@uclibc-ng.org>
Date:   Sat Aug 5 11:28:07 2017 +0200

    fix issues with gdb 8.0
    
    GDB 8.0 is compiled and linked with g++, but the
    linking of static targets (f.e. coldfire) fails,
    without declaring the functions in thread_db.h
    extern C.
    
    The compilation of gdb errors out with:
    thread-db.o: In function `thread_db_init()':
    thread-db.c:(.text+0x5b6): undefined reference to `td_ta_new(ps_prochandle*, td_thragent**)'
    thread-db.c:(.text+0x61e): undefined reference to `td_thr_get_info(td_thrhandle const*, td_thrinfo*)'
    thread-db.c:(.text+0x632): undefined reference to `td_symbol_list()'
    ..

---
 libpthread/linuxthreads_db/thread_db.h |    7 +++++++
 libpthread/nptl_db/thread_db.h         |    7 +++++++
 2 files changed, 14 insertions(+)

--- a/libpthread/linuxthreads_db/thread_db.h
+++ b/libpthread/linuxthreads_db/thread_db.h
@@ -27,6 +27,9 @@
 #include <sys/types.h>
 #include <sys/procfs.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* Error codes of the library.  */
 typedef enum
@@ -455,4 +458,8 @@
 /* Resume execution of thread TH.  */
 extern td_err_e td_thr_dbresume (const td_thrhandle_t *__th);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif	/* thread_db.h */
--- a/libpthread/nptl_db/thread_db.h
+++ b/libpthread/nptl_db/thread_db.h
@@ -27,6 +27,9 @@
 #include <sys/types.h>
 #include <sys/procfs.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* Error codes of the library.  */
 typedef enum
@@ -455,4 +458,8 @@
 /* Resume execution of thread TH.  */
 extern td_err_e td_thr_dbresume (const td_thrhandle_t *__th);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif	/* thread_db.h */