• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 13f33eb9ee5367715e648871d18e0d9b14ace815 Mon Sep 17 00:00:00 2001
2From: David 'Digit' Turner <digit@android.com>
3Date: Fri, 20 Apr 2012 15:51:23 +0200
4Subject: ndk: Proper libthread_db support in gdbserver
5
6Change-Id: If1c5f967e0f57d205215f28945e682bb5c291170
7---
8 gdb-6.6/gdb/gdbserver/acinclude.m4   |    2 +-
9 gdb-6.6/gdb/gdbserver/configure      |    2 +-
10 gdb-7.1.x/gdb/gdbserver/Makefile.in  |    8 ++++----
11 gdb-7.1.x/gdb/gdbserver/configure    |    4 ++--
12 gdb-7.1.x/gdb/gdbserver/configure.ac |    4 ++--
13 5 files changed, 10 insertions(+), 10 deletions(-)
14
15diff --git a/gdb-6.6/gdb/gdbserver/acinclude.m4 b/gdb-6.6/gdb/gdbserver/acinclude.m4
16index aaad2e2549d349be0b2b61008b6c248c1cc2aab5..04f023c 100644
17--- a/gdb-6.6/gdb/gdbserver/acinclude.m4
18+++ b/gdb-6.6/gdb/gdbserver/acinclude.m4
19@@ -4,7 +4,7 @@ sinclude(../../bfd/bfd.m4)
20 AC_DEFUN([SRV_CHECK_THREAD_DB],
21 [AC_CACHE_CHECK([for libthread_db],[srv_cv_thread_db],
22  [old_LIBS="$LIBS"
23-  LIBS="$LIBS -lthread_db"
24+  LIBS="$LIBS -lthread_db -lc"
25   AC_TRY_LINK(
26   [void ps_pglobal_lookup() {}
27    void ps_pdread() {}
28diff --git a/gdb-6.6/gdb/gdbserver/configure b/gdb-6.6/gdb/gdbserver/configure
29index 9d97888..debb43a 100755
30--- a/gdb-6.6/gdb/gdbserver/configure
31+++ b/gdb-6.6/gdb/gdbserver/configure
32@@ -3657,7 +3657,7 @@ if test "${srv_cv_thread_db+set}" = set; then
33   echo $ECHO_N "(cached) $ECHO_C" >&6
34 else
35   old_LIBS="$LIBS"
36-  LIBS="$LIBS -lthread_db"
37+  LIBS="$LIBS -lthread_db -lc"
38   cat >conftest.$ac_ext <<_ACEOF
39 /* confdefs.h.  */
40 _ACEOF
41diff --git a/gdb-7.1.x/gdb/gdbserver/Makefile.in b/gdb-7.1.x/gdb/gdbserver/Makefile.in
42index 5bf82e2..bc2ed43 100644
43--- a/gdb-7.1.x/gdb/gdbserver/Makefile.in
44+++ b/gdb-7.1.x/gdb/gdbserver/Makefile.in
45@@ -176,13 +176,13 @@ clean-info:
46
47 gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS}
48 	rm -f gdbserver$(EXEEXT)
49-	${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT) $(OBS) \
50-	  $(GDBSERVER_LIBS) $(XM_CLIBS)
51+	${CC-LD} $(INTERNAL_CFLAGS) $(OBS) $(GDBSERVER_LIBS) $(XM_CLIBS) \
52+          $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT)
53
54 gdbreplay$(EXEEXT): $(GDBREPLAY_OBS)
55 	rm -f gdbreplay$(EXEEXT)
56-	${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) \
57-	  $(XM_CLIBS)
58+	${CC-LD} $(INTERNAL_CFLAGS) -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) \
59+          $(XM_CLIBS) $(INTERNAL_LDFLAGS)
60
61 # Put the proper machine-specific files first, so M-. on a machine
62 # specific routine gets the one for the correct machine.
63diff --git a/gdb-7.1.x/gdb/gdbserver/configure b/gdb-7.1.x/gdb/gdbserver/configure
64index 47bd81a..399d08b 100755
65--- a/gdb-7.1.x/gdb/gdbserver/configure
66+++ b/gdb-7.1.x/gdb/gdbserver/configure
67@@ -4291,7 +4291,7 @@ srv_libs=
68 USE_THREAD_DB=
69
70 if test "$srv_linux_thread_db" = "yes"; then
71-  srv_libs="-ldl"
72+  srv_libs="-lthread_db -lc"
73   old_LDFLAGS="$LDFLAGS"
74   LDFLAGS="$LDFLAGS -rdynamic"
75   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
76@@ -4356,7 +4356,7 @@ if test "${with_libthread_db+set}" = set; then :
77
78 $as_echo "#define USE_LIBTHREAD_DB_DIRECTLY 1" >>confdefs.h
79
80-  srv_libs="$srv_libthread_db_path"
81+  srv_libs="$srv_libthread_db_path -lc"
82
83 fi
84
85diff --git a/gdb-7.1.x/gdb/gdbserver/configure.ac b/gdb-7.1.x/gdb/gdbserver/configure.ac
86index 638c228..a13117b 100644
87--- a/gdb-7.1.x/gdb/gdbserver/configure.ac
88+++ b/gdb-7.1.x/gdb/gdbserver/configure.ac
89@@ -180,7 +180,7 @@ srv_libs=
90 USE_THREAD_DB=
91
92 if test "$srv_linux_thread_db" = "yes"; then
93-  srv_libs="-ldl"
94+  srv_libs="-lthread_db -lc"
95   old_LDFLAGS="$LDFLAGS"
96   LDFLAGS="$LDFLAGS -rdynamic"
97   AC_TRY_LINK([], [], [RDYNAMIC=-rdynamic], [RDYNAMIC=])
98@@ -202,7 +202,7 @@ AC_ARG_WITH(libthread-db,
99 AS_HELP_STRING([--with-libthread-db=PATH], [use given libthread_db directly]),
100 [srv_libthread_db_path="${withval}"
101   AC_DEFINE(USE_LIBTHREAD_DB_DIRECTLY, 1, [Define if we should use libthread_db directly.])
102-  srv_libs="$srv_libthread_db_path"
103+  srv_libs="$srv_libthread_db_path -lc"
104 ])
105
106 if test "$srv_xmlfiles" != ""; then
107diff --git a/gdb-7.3.x/gdb/gdbserver/Makefile.in b/gdb-7.3.x/gdb/gdbserver/Makefile.in
108index 7d565af..e5e8ae4 100644
109--- a/gdb-7.3.x/gdb/gdbserver/Makefile.in
110+++ b/gdb-7.3.x/gdb/gdbserver/Makefile.in
111@@ -233,13 +233,13 @@ clean-info:
112
113 gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS}
114 	rm -f gdbserver$(EXEEXT)
115-	${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT) $(OBS) \
116-	  $(GDBSERVER_LIBS) $(XM_CLIBS)
117+	${CC-LD} $(INTERNAL_CFLAGS) $(OBS) $(GDBSERVER_LIBS) $(XM_CLIBS) \
118+          $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT)
119
120 gdbreplay$(EXEEXT): $(GDBREPLAY_OBS)
121 	rm -f gdbreplay$(EXEEXT)
122-	${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) \
123-	  $(XM_CLIBS)
124+	${CC-LD} $(INTERNAL_CFLAGS) -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) \
125+          $(XM_CLIBS) $(INTERNAL_LDFLAGS)
126
127 IPA_OBJS=tracepoint-ipa.o utils-ipa.o regcache-ipa.o remote-utils-ipa.o ${IPA_DEPFILES}
128
129diff --git a/gdb-7.3.x/gdb/gdbserver/configure b/gdb-7.3.x/gdb/gdbserver/configure
130index 110e406..c50e9ac 100755
131--- a/gdb-7.3.x/gdb/gdbserver/configure
132+++ b/gdb-7.3.x/gdb/gdbserver/configure
133@@ -4807,7 +4807,7 @@ rm -f core conftest.err conftest.$ac_objext \
134     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5
135 $as_echo "$found" >&6; }
136   else
137-    srv_libs="-lthread_db"
138+    srv_libs="-lthread_db -lc"
139   fi
140
141   srv_thread_depfiles="thread-db.o proc-service.o"
142@@ -4848,7 +4848,7 @@ fi
143 # Check whether --with-libthread-db was given.
144 if test "${with_libthread_db+set}" = set; then :
145   withval=$with_libthread_db; srv_libthread_db_path="${withval}"
146-  srv_libs="$srv_libthread_db_path"
147+  srv_libs="$srv_libthread_db_path -lc"
148
149 fi
150
151diff --git a/gdb-7.3.x/gdb/gdbserver/configure.ac b/gdb-7.3.x/gdb/gdbserver/configure.ac
152index 77e06c3..c70f3cf 100644
153--- a/gdb-7.3.x/gdb/gdbserver/configure.ac
154+++ b/gdb-7.3.x/gdb/gdbserver/configure.ac
155@@ -315,7 +315,7 @@ if test "$srv_linux_thread_db" = "yes"; then
156     LDFLAGS="$old_LDFLAGS"
157     AC_MSG_RESULT($found)
158   else
159-    srv_libs="-lthread_db"
160+    srv_libs="-lthread_db -lc"
161   fi
162
163   srv_thread_depfiles="thread-db.o proc-service.o"
164@@ -332,7 +332,7 @@ fi
165 AC_ARG_WITH(libthread-db,
166 AS_HELP_STRING([--with-libthread-db=PATH], [use given libthread_db directly]),
167 [srv_libthread_db_path="${withval}"
168-  srv_libs="$srv_libthread_db_path"
169+  srv_libs="$srv_libthread_db_path -lc"
170 ])
171
172 if test "$srv_libs" != "" -a "$srv_libs" != "-ldl"; then
173--
1741.7.6.rc0
175
176