This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA/commit/AIX] put -lpthread into LIBS instead of CONFIG_LDFLAGS.


From: Tristan Gingold <gingold@adacore.com>

This is a change that Tristan made in our tree and forgot to contribute.
The problem showed up on AIX when we switched from the system linker to
GNU ld. What happens is that configure is adding -lpthdebug to
CONFIG_LDFLAGS when AIX thread debugging support is detected.  But
this causes the "-lpthread" switch to be placed at the _before_
GDB's .o files (see Makefile.in):

    INTERNAL_LDFLAGS = [...] $(CONFIG_LDFLAGS)
    [...]
    gdb$(EXEEXT): gdb.o $(LIBGDB_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
            rm -f gdb$(EXEEXT)
            $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
                    -o gdb$(EXEEXT) gdb.o $(LIBGDB_OBS) \
                    $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)

And as a result of this, the linker reports an error due to some
symbols in aix-thread.o not being satisfied.

This patch adds the "-lpthread" switch to LIBS instead, which should
be the right place to add it.

gdb/ChangeLog (Tristan Gingold):

	* configure.ac (aix): Put -lpthread into libs.
	* configure: Regenerate.

Tested on ppc-aix.  Will commit in a few days unless there are
some comments about the patch.

---
 gdb/configure    |    2 +-
 gdb/configure.ac |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/configure b/gdb/configure
index 71ae0b2..6e15f60 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -16190,7 +16190,7 @@ $as_echo "$gdb_cv_have_aix_thread_debug" >&6; }
       if test $gdb_cv_have_aix_thread_debug = yes; then
          CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c"
          CONFIG_OBS="${CONFIG_OBS} aix-thread.o"
-         CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -lpthdebug"
+         LIBS="$LIBS -lpthdebug"
 
          # Older versions of AIX do not provide the declaration for
          # the getthrds function (it appears that it was introduced
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 5867782..13be36c 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1670,7 +1670,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
       if test $gdb_cv_have_aix_thread_debug = yes; then
          CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c"
          CONFIG_OBS="${CONFIG_OBS} aix-thread.o"
-         CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -lpthdebug"
+         LIBS="$LIBS -lpthdebug"
 
          # Older versions of AIX do not provide the declaration for
          # the getthrds function (it appears that it was introduced
-- 
1.6.5.rc2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]