• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From bc7aac86cdf8938f43bc5b9c6f1ac33c1882cf7b Mon Sep 17 00:00:00 2001
2From: David 'Digit' Turner <digit@android.com>
3Date: Thu, 25 Nov 2010 18:37:38 +0100
4Subject: [PATCH] Proper libthread_db support in gdbserver.
5
6Change-Id: I5ebbb18efe663e7bf24d6147f33cc92f38dea148
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 aaad2e2..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
107--
1081.7.3.1
109
110