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)
commit7f5331423810a41cc31345c64cf7ee9fa55c5948
tree21c4cc725a82469739e824ca7a1ac74bac3f9e32
parent001822aa58d2998ecc11067c07863745630ad388
put -lpthread into LIBS instead of CONFIG_LDFLAGS.

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
This page took 0.038412 seconds and 4 git commands to generate.