put -lpthread into LIBS instead of CONFIG_LDFLAGS.
authorJoel Brobecker <brobecker@gnat.com>
Wed, 18 Apr 2012 15:11:59 +0000 (15:11 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Wed, 18 Apr 2012 15:11:59 +0000 (15:11 +0000)
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.

gdb/ChangeLog
gdb/configure
gdb/configure.ac

index 3fa5738676a7f543f8132435933010167efcf3e8..464d412e21a453b8c5c24e9749d3097a5187e8f4 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-18  Tristan Gingold  <gingold@adacore.com>
+
+       * configure.ac (aix): Put -lpthread into libs.
+       * configure: Regenerate.
+
 2012-04-18  Tom Tromey  <tromey@redhat.com>
 
        * linespec.c (convert_linespec_to_sals): Don't use
index bb2d3c0e81e66fb9abe4da35a366455cb1da71b1..60652d67eedbac318f899c15cdee188c552c98d0 100755 (executable)
@@ -16221,7 +16221,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
index de500cc578d6c55d849a7fb97c1aa393cedc4780..03cd666516744b022faba510e41b6bc70d411c43 100644 (file)
@@ -1682,7 +1682,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
This page took 0.038115 seconds and 4 git commands to generate.